.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. currentmodule:: wx.lib.agw.hypertreelist .. highlight:: python .. _wx.lib.agw.hypertreelist.HyperTreeList: ========================================================================================================================================== |phoenix_title| **wx.lib.agw.hypertreelist.HyperTreeList** ========================================================================================================================================== :class:`HyperTreeList` is a generic widget that combines the multicolumn features of a :class:`wx.ListCtrl` with the hierarchical features of a :class:`wx.TreeCtrl` This class does not rely on native native controls, as it is a full owner-drawn tree-list control. It manages two widgets internally: * :class:`TreeListHeaderWindow` displays the column headers. * :class:`TreeListMainWindow` is the main tree list based off :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl`. These widgets can be obtained by the :meth:`~HyperTreeList.GetHeaderWindow` and :meth:`~HyperTreeList.GetMainWindow` methods respectively although this shouldn't be needed in normal usage. Please note that in addition to the defined methods of :class:`HyperTreeList` many more methods are delegated to the internal :class:`TreeListMainWindow` and its subclass :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl`. These methods can be called directly from the ``HyperTreeList`` class: ================================================================================ ================================================================================== :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.AddRoot` Adds a root item to the :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AppendItem` Appends an item as a last child of its parent. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AssignButtonsImageList` Assigns the button image list. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AssignImageList` Assigns the normal image list. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AssignStateImageList` Assigns the state image list. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AutoCheckChild` Transverses the tree and checks/unchecks the items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AutoCheckParent` Traverses up the tree and checks/unchecks parent items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AutoToggleChild` Transverses the tree and toggles the items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.CheckChilds` Programmatically check/uncheck item children. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.CheckItem` Actually checks/uncheks an item, sending the two related events. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.CheckItem2` Used internally to avoid ``EVT_TREE_ITEM_CHECKED`` events. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.CheckSameLevel` Uncheck radio items which are on the same level of the checked one. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.Collapse` Collapse an item, sending the two related events. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.CollapseAndReset` Collapse the given item and deletes its children. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.Delete` Deletes an item. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.DeleteAllItems` Delete all items in the :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.DeleteChildren` Delete all the item's children. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.DeleteItemWindow` Deletes the window in the column associated to an item (if any). :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.DeleteRoot` Removes the tree root item (and subsequently all the items in the tree). :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.EditLabel` Starts editing an item label. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.EnableChildren` Enables/disables the item children. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.EnableItem` Enables/disables an item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.EnableSelectionGradient` Globally enables/disables drawing of gradient selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.EnableSelectionVista` Globally enables/disables drawing of Windows Vista selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.EnsureVisible` Scrolls and/or expands items to ensure that the given item is visible. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.Expand` Expands an item, sending the two related events. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.ExpandAll` Expands all :class:`TreeListMainWindow` items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.ExpandAllChildren` Expands all the items children of the input item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.FindItem` Finds the first item starting with the given prefix after the given parent. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetBackgroundImage` Returns the :class:`TreeListMainWindow` background image (if any). :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetBorderPen` Returns the pen used to draw the selected item border. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetBoundingRect` Retrieves the rectangle bounding the item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetButtonsImageList` Returns the buttons image list associated with :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetChildrenCount` Returns the item children count. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetColumnCount` Returns the total number of columns. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetConnectionPen` Returns the pen used to draw the connecting lines between items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetCount` Returns the global number of items in the tree. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetCurrentItem` Returns the current item. Simply calls :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetSelection`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetDisabledColour` Returns the colour for items in a disabled state. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetDragFullScreen` Returns whether built-in drag/drop will be full screen or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetEditControl` Returns a reference to the edit :class:`~wx.lib.agw.customtreectrl.TreeTextCtrl` if the item is being edited. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetFirstChild` Returns the item's first child and an integer value 'cookie'. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetFirstExpandedItem` Returns the first item which is in the expanded state. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetFirstGradientColour` Returns the first gradient colour for gradient-style selections. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetFirstVisibleItem` Returns the first visible item. GetFocusedItem Another name for :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetSelection` :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetGradientStyle` Returns the gradient style for gradient-style selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetHilightFocusColour` Returns the colour used to highlight focused selected items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetHilightNonFocusColour` Returns the colour used to highlight unfocused selected items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetHyperTextFont` Returns the font used to render hypertext items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetHyperTextNewColour` Returns the colour used to render a non-visited hypertext item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetHyperTextVisitedColour` Returns the colour used to render a visited hypertext item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetImageList` Returns the normal image list associated with :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetImageListCheck` Returns the ``wx.ImageList`` used for the check/radio buttons in :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetIndent` Returns the item indentation, in pixels. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItem3StateValue` Gets the state of a 3-state checkbox item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItemBackgroundColour` Returns the item background colour. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItemFont` Returns the item font. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetItemImage` Returns the item image. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItemParent` Returns the item parent (can be ``None`` for root items). GetItemPyData Another name for :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetPyData` :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetItemText` Returns the item text label. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItemTextColour` Returns the item text colour or separator horizontal line colour. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItemType` Returns the item type. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItemVisited` Returns whether an hypertext item was visited. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetItemWindow` Returns the window associated with an item. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetItemWindowEnabled` Returns whether the window associated with an item is enabled or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetLastChild` Returns the item last child. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetNext` Returns the next item. Only for internal use right now. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetNextChild` Returns the item's next child. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetNextExpanded` Returns the next expanded item after the input one. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetNextShown` Returns the next displayed item in the tree, visible or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetNextSibling` Returns the next sibling of an item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetNextVisible` Returns the next item that is visible to the user. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetPrev` Returns the previous item. Only for internal use right now. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetPrevChild` Returns the previous child of an item. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetPrevExpanded` Returns the previous expanded item before the input one. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetPrevShown` Returns the previous displayed item in the tree, visible or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetPrevSibling` Returns the previous sibling of an item. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetPrevVisible` Returns the previous item visible to the user. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetPyData` Returns the data associated to an item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetRootItem` Returns the root item, an instance of :class:`GenericTreeItem`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetSecondGradientColour` Returns the second gradient colour for gradient-style selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetSelection` Returns the current selection. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetSelections` Returns a list of selected items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetSpacing` Returns the spacing between the start and the text, in pixels. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetStateImageList` Returns the state image list associated with :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.HasChildren` Returns whether an item has children or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.HideItem` Hides/shows an item. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.HitTest` Finds which (if any) item is under the given point, returning the item plus flags. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.InsertItem` Inserts an item after the given previous. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsBold` Returns whether the item font is bold or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsDescendantOf` Checks if the given item is under another one in the tree hierarchy. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsExpanded` Returns whether the item is expanded or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsItem3State` Returns whether or not the checkbox item is a 3-state checkbox. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsItemChecked` Returns whether an item is checked or not. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.IsItemEnabled` Returns whether an item is enabled or disabled. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsItemHyperText` Returns whether an item is hypertext or not. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.IsItemVisible` Returns whether the item is visible or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsSelected` Returns whether the item is selected or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.ItemHasChildren` Returns whether the item has children or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.PrependItem` Prepends an item as a first child of parent. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.ScrollTo` Scrolls the specified item into view. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SelectAll` Selects all the item in the tree. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SelectAllChildren` Selects all the children of the given item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SelectItem` Selects/deselects an item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetBackgroundImage` Sets the :class:`TreeListMainWindow` background image. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetBorderPen` Sets the pen used to draw the selected item border. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetButtonsImageList` Sets the buttons image list for :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetConnectionPen` Sets the pen used to draw the connecting lines between items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetDisabledColour` Sets the colour for items in a disabled state. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetDragFullScreen` Sets whether a drag operation will be performed full screen or not. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.SetDragItem` Sets the specified item as member of a current drag and drop operation. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetFirstGradientColour` Sets the first gradient colour for gradient-style selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetGradientStyle` Sets the gradient style for gradient-style selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetHilightFocusColour` Sets the colour used to highlight focused selected items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetHilightNonFocusColour` Sets the colour used to highlight unfocused selected items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetHyperTextFont` Sets the font used to render hypertext items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetHyperTextNewColour` Sets the colour used to render a non-visited hypertext item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetHyperTextVisitedColour` Sets the colour used to render a visited hypertext item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetImageList` Sets the normal image list for :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetImageListCheck` Sets the checkbox/radiobutton image list. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetIndent` Currently has no effect on ``HyperTreeList``. The indent is auto-calculated. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItem3State` Sets whether the item has a 3-state value checkbox assigned to it or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItem3StateValue` Sets the checkbox item to the given `state`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemBackgroundColour` Sets the item background colour. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemBold` Sets the item font as bold/unbold. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemDropHighlight` Gives the item the visual feedback for drag and drop operations. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemFont` Sets the item font. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemHasChildren` Forces the appearance/disappearance of the button next to the item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemHyperText` Sets whether the item is hypertext or not. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.SetItemImage` Sets the item image for a particular item state. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemItalic` Sets the item font as italic/non-italic. SetItemPyData Another name for :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetPyData` :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.SetItemText` Sets the item text label. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemTextColour` Sets the item text colour or separator horizontal line colour. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemType` Sets the item type. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemVisited` Sets whether an hypertext item was visited. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.SetItemWindow` Sets the window associated to an item. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.SetItemWindowEnabled` Sets whether the window associated with an item is enabled or not. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.SetMainColumn` Sets the :class:`HyperTreeList` main column (i.e. the column of the tree). :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetPyData` Sets the data associated to an item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetSecondGradientColour` Sets the second gradient colour for gradient-style selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetSpacing` Currently has no effect on ``HyperTreeList``. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetStateImageList` Sets the state image list for :class:`TreeListMainWindow` :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.ShouldInheritColours` Return ``True`` to allow the window colours to be changed by `InheritAttributes`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.Toggle` Toggles the item state (collapsed/expanded). :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.ToggleItemSelection` Toggles the item selection. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.UnCheckRadioParent` Used internally to handle radio node parent correctly. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.Unselect` Unselects the current selection. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.UnselectAll` Unselect all the items. ================================================================================ ================================================================================== | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class HyperTreeList:
| |appearance| Control Appearance =============================== | .. figure:: _static/images/widgets/fullsize/wxmsw/wx.lib.agw.hypertreelist.hypertreelist.png :alt: wxMSW :figclass: floatleft **wxMSW** .. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png :alt: wxMAC :figclass: floatright **wxMAC** .. figure:: _static/images/widgets/fullsize/wxgtk/../no_appearance.png :alt: wxGTK :figclass: floatcenter **wxGTK** | |super_classes| Known Superclasses ================================== :class:`wx.Control` | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.__init__` Default class constructor. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.AddColumn` Appends a column to the :class:`HyperTreeList`. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.AddColumnInfo` Appends a column to the :class:`HyperTreeList`. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.CalculateAndSetHeaderHeight` Calculates the best header height and stores it. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.CreateEditCtrl` Create an edit control for editing a label of an item. By default, this :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.delegate` :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.DoGetBestSize` Gets the size which best suits the window: for a control, it would be the :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.DoHeaderLayout` Layouts the header control. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.Freeze` Freeze :class:`HyperTreeList` to allow rapid changes to the tree. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.GetAGWWindowStyleFlag` Returns the :class:`HyperTreeList` window style flag. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.GetColumn` Returns an instance of :class:`TreeListColumnInfo` containing column information. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.GetColumnAlignment` Returns the column text alignment. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.GetColumnColour` Returns the column text colour. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.GetColumnFont` Returns the column text font. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.GetColumnImage` Returns the image assigned to the specified column. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.GetColumnText` Returns the column text label. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.GetColumnWidth` Returns the column width, in pixels. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.GetHeaderWindow` Returns the header window, an instance of :class:`TreeListHeaderWindow`. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.GetMainWindow` Returns the main window, an instance of :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.GetTextCtrlAlignmentStyle` Return the alignment style to use for the text control that is used :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.GetTextCtrlStyle` Return the style to use for the text control that is used to edit :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.HasAGWFlag` Returns whether a flag is present in the :class:`HyperTreeList` style. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.InsertColumn` Inserts a column to the :class:`HyperTreeList` at the position specified :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.InsertColumnInfo` Inserts a column to the :class:`HyperTreeList` at the position specified :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.IsColumnEditable` Returns ``True`` if the column is editable, ``False`` otherwise. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.IsColumnShown` Returns ``True`` if the column is shown, ``False`` otherwise. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.OnCompareItems` Returns the comparison of two items. Used for sorting. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.OnGetItemText` If the ``TR_VIRTUAL`` style is set this function **must** be overloaded :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.OnHTLFocus` Handles the ``wx.EVT_SET_FOCUS`` event for :class:`HyperTreeList`. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.OnSize` Handles the ``wx.EVT_SIZE`` event for :class:`HyperTreeList`. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.Refresh` Causes this window, and all of its children recursively (except under wxGTK1 :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.RemoveColumn` Removes a column from the :class:`HyperTreeList`. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetAGWWindowStyleFlag` Sets the window style for :class:`HyperTreeList`. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetBackgroundColour` Changes the background colour of :class:`HyperTreeList`. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetBuffered` Sets/unsets the double buffering for the header and the main window. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetColumn` Sets a column using an instance of :class:`TreeListColumnInfo`. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetColumnAlignment` Sets the column text alignment. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetColumnColour` Sets the column text colour. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetColumnEditable` Sets the column as editable or non-editable. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetColumnFont` Sets the column text font. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetColumnImage` Sets an image on the specified column. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetColumnShown` Sets the column as shown or hidden. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetColumnSortIcon` Sets the sort icon to be displayed in the column header. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetColumnText` Sets the column text label. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetColumnWidth` Sets the column width, in pixels. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetFocus` This sets the window to receive keyboard input. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetFont` Sets the default font for the header window and the main window. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetForegroundColour` Changes the foreground colour of :class:`HyperTreeList`. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetHeaderCustomRenderer` Associate a custom renderer with the header - all columns will use it :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SetHeaderFont` Sets the default font for the header window.. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.SortChildren` Sorts the children of the given item using :meth:`~HyperTreeList.OnCompareItems` method of :class:`HyperTreeList`. :meth:`~wx.lib.agw.hypertreelist.HyperTreeList.Thaw` Thaw :class:`HyperTreeList`. ================================================================================ ================================================================================ | |api| Class API =============== .. class:: HyperTreeList(wx.Control) :class:`HyperTreeList` is a generic widget that combines the multicolumn features of a :class:`wx.ListCtrl` with the hierarchical features of a :class:`wx.TreeCtrl` This class does not rely on native native controls, as it is a full owner-drawn tree-list control. It manages two widgets internally: * :class:`TreeListHeaderWindow` displays the column headers. * :class:`TreeListMainWindow` is the main tree list based off :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl`. These widgets can be obtained by the :meth:`~HyperTreeList.GetHeaderWindow` and :meth:`~HyperTreeList.GetMainWindow` methods respectively although this shouldn't be needed in normal usage. Please note that in addition to the defined methods of :class:`HyperTreeList` many more methods are delegated to the internal :class:`TreeListMainWindow` and its subclass :class:`~wx.lib.agw.customtreectrl.CustomTreeCtrl`. These methods can be called directly from the ``HyperTreeList`` class: ================================================================================ ================================================================================== :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.AddRoot` Adds a root item to the :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AppendItem` Appends an item as a last child of its parent. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AssignButtonsImageList` Assigns the button image list. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AssignImageList` Assigns the normal image list. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AssignStateImageList` Assigns the state image list. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AutoCheckChild` Transverses the tree and checks/unchecks the items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AutoCheckParent` Traverses up the tree and checks/unchecks parent items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.AutoToggleChild` Transverses the tree and toggles the items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.CheckChilds` Programmatically check/uncheck item children. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.CheckItem` Actually checks/uncheks an item, sending the two related events. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.CheckItem2` Used internally to avoid ``EVT_TREE_ITEM_CHECKED`` events. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.CheckSameLevel` Uncheck radio items which are on the same level of the checked one. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.Collapse` Collapse an item, sending the two related events. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.CollapseAndReset` Collapse the given item and deletes its children. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.Delete` Deletes an item. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.DeleteAllItems` Delete all items in the :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.DeleteChildren` Delete all the item's children. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.DeleteItemWindow` Deletes the window in the column associated to an item (if any). :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.DeleteRoot` Removes the tree root item (and subsequently all the items in the tree). :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.EditLabel` Starts editing an item label. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.EnableChildren` Enables/disables the item children. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.EnableItem` Enables/disables an item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.EnableSelectionGradient` Globally enables/disables drawing of gradient selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.EnableSelectionVista` Globally enables/disables drawing of Windows Vista selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.EnsureVisible` Scrolls and/or expands items to ensure that the given item is visible. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.Expand` Expands an item, sending the two related events. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.ExpandAll` Expands all :class:`TreeListMainWindow` items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.ExpandAllChildren` Expands all the items children of the input item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.FindItem` Finds the first item starting with the given prefix after the given parent. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetBackgroundImage` Returns the :class:`TreeListMainWindow` background image (if any). :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetBorderPen` Returns the pen used to draw the selected item border. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetBoundingRect` Retrieves the rectangle bounding the item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetButtonsImageList` Returns the buttons image list associated with :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetChildrenCount` Returns the item children count. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetColumnCount` Returns the total number of columns. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetConnectionPen` Returns the pen used to draw the connecting lines between items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetCount` Returns the global number of items in the tree. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetCurrentItem` Returns the current item. Simply calls :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetSelection`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetDisabledColour` Returns the colour for items in a disabled state. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetDragFullScreen` Returns whether built-in drag/drop will be full screen or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetEditControl` Returns a reference to the edit :class:`~wx.lib.agw.customtreectrl.TreeTextCtrl` if the item is being edited. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetFirstChild` Returns the item's first child and an integer value 'cookie'. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetFirstExpandedItem` Returns the first item which is in the expanded state. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetFirstGradientColour` Returns the first gradient colour for gradient-style selections. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetFirstVisibleItem` Returns the first visible item. GetFocusedItem Another name for :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetSelection` :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetGradientStyle` Returns the gradient style for gradient-style selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetHilightFocusColour` Returns the colour used to highlight focused selected items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetHilightNonFocusColour` Returns the colour used to highlight unfocused selected items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetHyperTextFont` Returns the font used to render hypertext items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetHyperTextNewColour` Returns the colour used to render a non-visited hypertext item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetHyperTextVisitedColour` Returns the colour used to render a visited hypertext item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetImageList` Returns the normal image list associated with :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetImageListCheck` Returns the ``wx.ImageList`` used for the check/radio buttons in :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetIndent` Returns the item indentation, in pixels. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItem3StateValue` Gets the state of a 3-state checkbox item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItemBackgroundColour` Returns the item background colour. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItemFont` Returns the item font. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetItemImage` Returns the item image. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItemParent` Returns the item parent (can be ``None`` for root items). GetItemPyData Another name for :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetPyData` :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetItemText` Returns the item text label. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItemTextColour` Returns the item text colour or separator horizontal line colour. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItemType` Returns the item type. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetItemVisited` Returns whether an hypertext item was visited. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetItemWindow` Returns the window associated with an item. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetItemWindowEnabled` Returns whether the window associated with an item is enabled or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetLastChild` Returns the item last child. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetNext` Returns the next item. Only for internal use right now. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetNextChild` Returns the item's next child. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetNextExpanded` Returns the next expanded item after the input one. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetNextShown` Returns the next displayed item in the tree, visible or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetNextSibling` Returns the next sibling of an item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetNextVisible` Returns the next item that is visible to the user. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetPrev` Returns the previous item. Only for internal use right now. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetPrevChild` Returns the previous child of an item. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetPrevExpanded` Returns the previous expanded item before the input one. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetPrevShown` Returns the previous displayed item in the tree, visible or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetPrevSibling` Returns the previous sibling of an item. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.GetPrevVisible` Returns the previous item visible to the user. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetPyData` Returns the data associated to an item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetRootItem` Returns the root item, an instance of :class:`GenericTreeItem`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetSecondGradientColour` Returns the second gradient colour for gradient-style selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetSelection` Returns the current selection. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetSelections` Returns a list of selected items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetSpacing` Returns the spacing between the start and the text, in pixels. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.GetStateImageList` Returns the state image list associated with :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.HasChildren` Returns whether an item has children or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.HideItem` Hides/shows an item. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.HitTest` Finds which (if any) item is under the given point, returning the item plus flags. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.InsertItem` Inserts an item after the given previous. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsBold` Returns whether the item font is bold or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsDescendantOf` Checks if the given item is under another one in the tree hierarchy. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsExpanded` Returns whether the item is expanded or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsItem3State` Returns whether or not the checkbox item is a 3-state checkbox. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsItemChecked` Returns whether an item is checked or not. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.IsItemEnabled` Returns whether an item is enabled or disabled. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsItemHyperText` Returns whether an item is hypertext or not. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.IsItemVisible` Returns whether the item is visible or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.IsSelected` Returns whether the item is selected or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.ItemHasChildren` Returns whether the item has children or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.PrependItem` Prepends an item as a first child of parent. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.ScrollTo` Scrolls the specified item into view. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SelectAll` Selects all the item in the tree. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SelectAllChildren` Selects all the children of the given item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SelectItem` Selects/deselects an item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetBackgroundImage` Sets the :class:`TreeListMainWindow` background image. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetBorderPen` Sets the pen used to draw the selected item border. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetButtonsImageList` Sets the buttons image list for :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetConnectionPen` Sets the pen used to draw the connecting lines between items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetDisabledColour` Sets the colour for items in a disabled state. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetDragFullScreen` Sets whether a drag operation will be performed full screen or not. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.SetDragItem` Sets the specified item as member of a current drag and drop operation. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetFirstGradientColour` Sets the first gradient colour for gradient-style selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetGradientStyle` Sets the gradient style for gradient-style selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetHilightFocusColour` Sets the colour used to highlight focused selected items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetHilightNonFocusColour` Sets the colour used to highlight unfocused selected items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetHyperTextFont` Sets the font used to render hypertext items. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetHyperTextNewColour` Sets the colour used to render a non-visited hypertext item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetHyperTextVisitedColour` Sets the colour used to render a visited hypertext item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetImageList` Sets the normal image list for :class:`TreeListMainWindow`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetImageListCheck` Sets the checkbox/radiobutton image list. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetIndent` Currently has no effect on ``HyperTreeList``. The indent is auto-calculated. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItem3State` Sets whether the item has a 3-state value checkbox assigned to it or not. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItem3StateValue` Sets the checkbox item to the given `state`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemBackgroundColour` Sets the item background colour. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemBold` Sets the item font as bold/unbold. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemDropHighlight` Gives the item the visual feedback for drag and drop operations. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemFont` Sets the item font. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemHasChildren` Forces the appearance/disappearance of the button next to the item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemHyperText` Sets whether the item is hypertext or not. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.SetItemImage` Sets the item image for a particular item state. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemItalic` Sets the item font as italic/non-italic. SetItemPyData Another name for :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetPyData` :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.SetItemText` Sets the item text label. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemTextColour` Sets the item text colour or separator horizontal line colour. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemType` Sets the item type. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetItemVisited` Sets whether an hypertext item was visited. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.SetItemWindow` Sets the window associated to an item. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.SetItemWindowEnabled` Sets whether the window associated with an item is enabled or not. :meth:`~wx.lib.agw.hypertreelist.TreeListMainWindow.SetMainColumn` Sets the :class:`HyperTreeList` main column (i.e. the column of the tree). :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetPyData` Sets the data associated to an item. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetSecondGradientColour` Sets the second gradient colour for gradient-style selections. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetSpacing` Currently has no effect on ``HyperTreeList``. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.SetStateImageList` Sets the state image list for :class:`TreeListMainWindow` :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.ShouldInheritColours` Return ``True`` to allow the window colours to be changed by `InheritAttributes`. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.Toggle` Toggles the item state (collapsed/expanded). :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.ToggleItemSelection` Toggles the item selection. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.UnCheckRadioParent` Used internally to handle radio node parent correctly. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.Unselect` Unselects the current selection. :meth:`~wx.lib.agw.customtreectrl.CustomTreeCtrl.UnselectAll` Unselect all the items. ================================================================================ ================================================================================== .. method:: __init__(self, parent, id=wx.ID_ANY, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, agwStyle=wx.TR_DEFAULT_STYLE, validator=wx.DefaultValidator, name="HyperTreeList") Default class constructor. :param `parent`: parent window. Must not be ``None``; :param `id`: window identifier. A value of -1 indicates a default value; :param `pos`: the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform; :param `size`: the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform; :param `style`: the underlying :class:`wx.Control` style; :param `agwStyle`: the AGW-specific :class:`HyperTreeList` window style. see :mod:`~wx.lib.agw.hypertreelist` for a full list of flags. :param `validator`: window validator; :param `name`: window name. .. method:: AddColumn(self, text, width=_DEFAULT_COL_WIDTH, flag=wx.ALIGN_LEFT, image=-1, shown=True, colour=None, edit=False) Appends a column to the :class:`HyperTreeList`. :param `text`: the column text label; :param `width`: the column width in pixels; :param `flag`: the column alignment flag, one of ``wx.ALIGN_LEFT``, ``wx.ALIGN_RIGHT``, ``wx.ALIGN_CENTER``; :param `image`: an index within the normal image list assigned to :class:`HyperTreeList` specifying the image to use for the column; :param `shown`: ``True`` to show the column, ``False`` to hide it; :param `colour`: a valid :class:`wx.Colour`, representing the text foreground colour for the column; :param `edit`: ``True`` to set the column as editable, ``False`` otherwise. .. method:: AddColumnInfo(self, colInfo) Appends a column to the :class:`HyperTreeList`. :param `colInfo`: an instance of :class:`TreeListColumnInfo`. .. method:: CalculateAndSetHeaderHeight(self) Calculates the best header height and stores it. .. method:: CreateEditCtrl(self, item, column) Create an edit control for editing a label of an item. By default, this returns a text control. Override this function in the derived class to return a different type of control. :param `item`: an instance of :class:`TreeListItem`; :param `column`: an integer specifying the column index. .. method:: delegate(self, \*args, \*\*kwargs) .. method:: DoGetBestSize(self) Gets the size which best suits the window: for a control, it would be the minimal size which doesn't truncate the control, for a panel - the same size as it would have after a call to `Fit()`. .. note:: Overridden from :class:`wx.Control`. .. method:: DoHeaderLayout(self) Layouts the header control. .. method:: Freeze(self) Freeze :class:`HyperTreeList` to allow rapid changes to the tree. Freezes the HyperTreeList main (tree) and and header windows. This prevents any re-calculation or updates from taking place allowing mass updates to the tree very quickly. :meth:`~Thaw` must be called to re-enable updates. Calls to these two functions may be nested. .. method:: GetAGWWindowStyleFlag(self) Returns the :class:`HyperTreeList` window style flag. .. seealso:: :meth:`~HyperTreeList.SetAGWWindowStyleFlag` for a list of valid window styles. .. method:: GetColumn(self, column) Returns an instance of :class:`TreeListColumnInfo` containing column information. :param `column`: an integer specifying the column index. .. method:: GetColumnAlignment(self, column) Returns the column text alignment. :param `column`: an integer specifying the column index. .. method:: GetColumnColour(self, column) Returns the column text colour. :param `column`: an integer specifying the column index. .. method:: GetColumnFont(self, column) Returns the column text font. :param `column`: an integer specifying the column index. .. method:: GetColumnImage(self, column) Returns the image assigned to the specified column. :param `column`: an integer specifying the column index. .. method:: GetColumnText(self, column) Returns the column text label. :param `column`: an integer specifying the column index. .. method:: GetColumnWidth(self, column) Returns the column width, in pixels. :param `column`: an integer specifying the column index. .. method:: GetHeaderWindow(self) Returns the header window, an instance of :class:`TreeListHeaderWindow`. .. method:: GetMainWindow(self) Returns the main window, an instance of :class:`TreeListMainWindow`. .. method:: GetTextCtrlAlignmentStyle(self, column) Return the alignment style to use for the text control that is used to edit labels of items. The alignment style is derived from the column alignment. :param `column`: an integer specifying the column index. .. method:: GetTextCtrlStyle(self, column) Return the style to use for the text control that is used to edit labels of items. Override this function in the derived class to support a different style, e.g. ``wx.TE_MULTILINE``. :param `column`: an integer specifying the column index. .. method:: HasAGWFlag(self, flag) Returns whether a flag is present in the :class:`HyperTreeList` style. :param `flag`: one of the possible :class:`HyperTreeList` window styles. .. seealso:: :meth:`~HyperTreeList.SetAGWWindowStyleFlag` for a list of possible window style flags. .. method:: InsertColumn(self, before, text, width=_DEFAULT_COL_WIDTH, flag=wx.ALIGN_LEFT, image=-1, shown=True, colour=None, edit=False) Inserts a column to the :class:`HyperTreeList` at the position specified by `before`. :param `before`: the index at which we wish to insert the new column; :param `text`: the column text label; :param `width`: the column width in pixels; :param `flag`: the column alignment flag, one of ``wx.ALIGN_LEFT``, ``wx.ALIGN_RIGHT``, ``wx.ALIGN_CENTER``; :param `image`: an index within the normal image list assigned to :class:`HyperTreeList` specifying the image to use for the column; :param `shown`: ``True`` to show the column, ``False`` to hide it; :param `colour`: a valid :class:`wx.Colour`, representing the text foreground colour for the column; :param `edit`: ``True`` to set the column as editable, ``False`` otherwise. .. method:: InsertColumnInfo(self, before, colInfo) Inserts a column to the :class:`HyperTreeList` at the position specified by `before`. :param `before`: the index at which we wish to insert the new column; :param `colInfo`: an instance of :class:`TreeListColumnInfo`. .. method:: IsColumnEditable(self, column) Returns ``True`` if the column is editable, ``False`` otherwise. :param `column`: an integer specifying the column index. .. method:: IsColumnShown(self, column) Returns ``True`` if the column is shown, ``False`` otherwise. :param `column`: an integer specifying the column index. .. method:: OnCompareItems(self, item1, item2) Returns the comparison of two items. Used for sorting. Override this function in the derived class to change the sort order of the items in the :class:`HyperTreeList`. The function should return a negative, zero or positive value if the first item is less than, equal to or greater than the second one. :param `item1`: an instance of :class:`TreeListItem`; :param `item2`: another instance of :class:`TreeListItem`. .. note:: The base class version compares items alphabetically. .. method:: OnGetItemText(self, item, column) If the ``TR_VIRTUAL`` style is set this function **must** be overloaded in the derived class. It should return the string containing the text of the given column for the specified item. :param `item`: an instance of :class:`TreeListItem`; :param `column`: an integer specifying the column index. .. method:: OnHTLFocus(self, event) Handles the ``wx.EVT_SET_FOCUS`` event for :class:`HyperTreeList`. :param `event`: a :class:`wx.SizeEvent` event to be processed. .. method:: OnSize(self, event) Handles the ``wx.EVT_SIZE`` event for :class:`HyperTreeList`. :param `event`: a :class:`wx.SizeEvent` event to be processed. .. method:: Refresh(self, erase=True, rect=None) Causes this window, and all of its children recursively (except under wxGTK1 where this is not implemented), to be repainted. :param `erase`: If ``True``, the background will be erased; :param `rect`: If not ``None``, only the given rectangle will be treated as damaged. .. note:: Note that repainting doesn't happen immediately but only during the next event loop iteration, if you need to update the window immediately you should use `Update` instead. .. note:: Overridden from :class:`wx.Control`. .. method:: RemoveColumn(self, column) Removes a column from the :class:`HyperTreeList`. :param `column`: an integer specifying the column index. .. method:: SetAGWWindowStyleFlag(self, agwStyle) Sets the window style for :class:`HyperTreeList`. :param `agwStyle`: can be a combination of various bits. See :mod:`~wx.lib.agw.hypertreelist` for a full list of flags. .. note:: Please note that some styles cannot be changed after the window creation and that `Refresh()` might need to be be called after changing the others for the change to take place immediately. .. method:: SetBackgroundColour(self, colour) Changes the background colour of :class:`HyperTreeList`. :param `colour`: the colour to be used as the background colour, pass :class:`NullColour` to reset to the default colour. .. note:: The background colour is usually painted by the default :class:`EraseEvent` event handler function under Windows and automatically under GTK. .. note:: Setting the background colour does not cause an immediate refresh, so you may wish to call :meth:`wx.Window.ClearBackground` or :meth:`wx.Window.Refresh` after calling this function. .. note:: Overridden from :class:`wx.Control`. .. method:: SetBuffered(self, buffered) Sets/unsets the double buffering for the header and the main window. :param `buffered`: ``True`` to use double-buffering, ``False`` otherwise. .. note:: Currently we are using double-buffering only on Windows XP. .. method:: SetColumn(self, column, colInfo) Sets a column using an instance of :class:`TreeListColumnInfo`. :param `column`: an integer specifying the column index; :param `info`: an instance of :class:`TreeListColumnInfo`. .. method:: SetColumnAlignment(self, column, flag) Sets the column text alignment. :param `column`: an integer specifying the column index; :param `flag`: the alignment flag, one of ``wx.ALIGN_LEFT``, ``wx.ALIGN_RIGHT``, ``wx.ALIGN_CENTER``. .. method:: SetColumnColour(self, column, colour) Sets the column text colour. :param `column`: an integer specifying the column index; :param `colour`: a valid :class:`wx.Colour` object. .. method:: SetColumnEditable(self, column, edit) Sets the column as editable or non-editable. :param `column`: an integer specifying the column index; :param `edit`: ``True`` if the column should be editable, ``False`` otherwise. .. method:: SetColumnFont(self, column, font) Sets the column text font. :param `column`: an integer specifying the column index; :param `font`: a valid :class:`wx.Font` object. .. method:: SetColumnImage(self, column, image) Sets an image on the specified column. :param `column`: an integer specifying the column index. :param `image`: an index within the normal image list assigned to :class:`HyperTreeList` specifying the image to use for the column. .. method:: SetColumnShown(self, column, shown) Sets the column as shown or hidden. :param `column`: an integer specifying the column index; :param `shown`: ``True`` if the column should be shown, ``False`` if it should be hidden. .. method:: SetColumnSortIcon(self, column, sortIcon, colour=None) Sets the sort icon to be displayed in the column header. The sort icon will be displayed in the specified column number and all other columns will have the sort icon cleared. :param `column`: an integer specifying the column index; :param `sortIcon`: the sort icon to display, one of ``wx.HDR_SORT_ICON_NONE``, ``wx.HDR_SORT_ICON_UP``, ``wx.HDR_SORT_ICON_DOWN``. :param `colour`: the colour of the sort icon as a wx.Colour. Optional. Set to ``None`` to restore native colour. .. method:: SetColumnText(self, column, text) Sets the column text label. :param `column`: an integer specifying the column index; :param `text`: the new column label. .. method:: SetColumnWidth(self, column, width) Sets the column width, in pixels. :param `column`: an integer specifying the column index; :param `width`: the new column width, in pixels. .. method:: SetFocus(self) This sets the window to receive keyboard input. .. method:: SetFont(self, font) Sets the default font for the header window and the main window. :param `font`: a valid :class:`wx.Font` object. .. method:: SetForegroundColour(self, colour) Changes the foreground colour of :class:`HyperTreeList`. :param `colour`: the colour to be used as the foreground colour, pass :class:`NullColour` to reset to the default colour. .. note:: Overridden from :class:`wx.Control`. .. method:: SetHeaderCustomRenderer(self, renderer=None) Associate a custom renderer with the header - all columns will use it :param `renderer`: a class able to correctly render header buttons .. note:: the renderer class **must** implement the method `DrawHeaderButton` .. method:: SetHeaderFont(self, font) Sets the default font for the header window.. :param `font`: a valid :class:`wx.Font` object. .. method:: SortChildren(self, item) Sorts the children of the given item using :meth:`~HyperTreeList.OnCompareItems` method of :class:`HyperTreeList`. You should override that method to change the sort order (the default is ascending case-sensitive alphabetical order). :param `item`: an instance of :class:`TreeListItem`; .. method:: Thaw(self) Thaw :class:`HyperTreeList`. Reenables updates to the main (tree) and header windows after a previous call to :meth:`~Freeze`. To really thaw the control, it must be called exactly the same number of times as :meth:`~Freeze`. When fully thawed the tree will re-calculate and update itself. :raise: `Exception` if :meth:`~Thaw` has been called without an un-matching :meth:`~Freeze`.