phoenix_title wx.lib.agw.hypertreelist.HyperTreeList

HyperTreeList is a generic widget that combines the multicolumn features of a wx.ListCtrl with the hierarchical features of a 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:

These widgets can be obtained by the GetHeaderWindow and GetMainWindow methods respectively although this shouldn’t be needed in normal usage.

Please note that in addition to the defined methods of HyperTreeList many more methods are delegated to the internal TreeListMainWindow and its subclass CustomTreeCtrl. These methods can be called directly from the HyperTreeList class:

AddRoot

Adds a root item to the TreeListMainWindow.

AppendItem

Appends an item as a last child of its parent.

AssignButtonsImageList

Assigns the button image list.

AssignImageList

Assigns the normal image list.

AssignStateImageList

Assigns the state image list.

AutoCheckChild

Transverses the tree and checks/unchecks the items.

AutoCheckParent

Traverses up the tree and checks/unchecks parent items.

AutoToggleChild

Transverses the tree and toggles the items.

CheckChilds

Programmatically check/uncheck item children.

CheckItem

Actually checks/uncheks an item, sending the two related events.

CheckItem2

Used internally to avoid EVT_TREE_ITEM_CHECKED events.

CheckSameLevel

Uncheck radio items which are on the same level of the checked one.

Collapse

Collapse an item, sending the two related events.

CollapseAndReset

Collapse the given item and deletes its children.

Delete

Deletes an item.

DeleteAllItems

Delete all items in the TreeListMainWindow.

DeleteChildren

Delete all the item’s children.

DeleteItemWindow

Deletes the window in the column associated to an item (if any).

DeleteRoot

Removes the tree root item (and subsequently all the items in the tree).

EditLabel

Starts editing an item label.

EnableChildren

Enables/disables the item children.

EnableItem

Enables/disables an item.

EnableSelectionGradient

Globally enables/disables drawing of gradient selections.

EnableSelectionVista

Globally enables/disables drawing of Windows Vista selections.

EnsureVisible

Scrolls and/or expands items to ensure that the given item is visible.

Expand

Expands an item, sending the two related events.

ExpandAll

Expands all TreeListMainWindow items.

ExpandAllChildren

Expands all the items children of the input item.

FindItem

Finds the first item starting with the given prefix after the given parent.

GetBackgroundImage

Returns the TreeListMainWindow background image (if any).

GetBorderPen

Returns the pen used to draw the selected item border.

GetBoundingRect

Retrieves the rectangle bounding the item.

GetButtonsImageList

Returns the buttons image list associated with TreeListMainWindow.

GetChildrenCount

Returns the item children count.

GetColumnCount

Returns the total number of columns.

GetConnectionPen

Returns the pen used to draw the connecting lines between items.

GetCount

Returns the global number of items in the tree.

GetCurrentItem

Returns the current item. Simply calls GetSelection.

GetDisabledColour

Returns the colour for items in a disabled state.

GetDragFullScreen

Returns whether built-in drag/drop will be full screen or not.

GetEditControl

Returns a reference to the edit TreeTextCtrl if the item is being edited.

GetFirstChild

Returns the item’s first child and an integer value ‘cookie’.

GetFirstExpandedItem

Returns the first item which is in the expanded state.

GetFirstGradientColour

Returns the first gradient colour for gradient-style selections.

GetFirstVisibleItem

Returns the first visible item.

GetFocusedItem

Another name for GetSelection

GetGradientStyle

Returns the gradient style for gradient-style selections.

GetHilightFocusColour

Returns the colour used to highlight focused selected items.

GetHilightNonFocusColour

Returns the colour used to highlight unfocused selected items.

GetHyperTextFont

Returns the font used to render hypertext items.

GetHyperTextNewColour

Returns the colour used to render a non-visited hypertext item.

GetHyperTextVisitedColour

Returns the colour used to render a visited hypertext item.

GetImageList

Returns the normal image list associated with TreeListMainWindow.

GetImageListCheck

Returns the wx.ImageList used for the check/radio buttons in TreeListMainWindow.

GetIndent

Returns the item indentation, in pixels.

GetItem3StateValue

Gets the state of a 3-state checkbox item.

GetItemBackgroundColour

Returns the item background colour.

GetItemFont

Returns the item font.

GetItemImage

Returns the item image.

GetItemParent

Returns the item parent (can be None for root items).

GetItemPyData

Another name for GetPyData

GetItemText

Returns the item text label.

GetItemTextColour

Returns the item text colour or separator horizontal line colour.

GetItemType

Returns the item type.

GetItemVisited

Returns whether an hypertext item was visited.

GetItemWindow

Returns the window associated with an item.

GetItemWindowEnabled

Returns whether the window associated with an item is enabled or not.

GetLastChild

Returns the item last child.

GetNext

Returns the next item. Only for internal use right now.

GetNextChild

Returns the item’s next child.

GetNextExpanded

Returns the next expanded item after the input one.

GetNextShown

Returns the next displayed item in the tree, visible or not.

GetNextSibling

Returns the next sibling of an item.

GetNextVisible

Returns the next item that is visible to the user.

GetPrev

Returns the previous item. Only for internal use right now.

GetPrevChild

Returns the previous child of an item.

GetPrevExpanded

Returns the previous expanded item before the input one.

GetPrevShown

Returns the previous displayed item in the tree, visible or not.

GetPrevSibling

Returns the previous sibling of an item.

GetPrevVisible

Returns the previous item visible to the user.

GetPyData

Returns the data associated to an item.

GetRootItem

Returns the root item, an instance of GenericTreeItem.

GetSecondGradientColour

Returns the second gradient colour for gradient-style selections.

GetSelection

Returns the current selection.

GetSelections

Returns a list of selected items.

GetSpacing

Returns the spacing between the start and the text, in pixels.

GetStateImageList

Returns the state image list associated with TreeListMainWindow.

HasChildren

Returns whether an item has children or not.

HideItem

Hides/shows an item.

HitTest

Finds which (if any) item is under the given point, returning the item plus flags.

InsertItem

Inserts an item after the given previous.

IsBold

Returns whether the item font is bold or not.

IsDescendantOf

Checks if the given item is under another one in the tree hierarchy.

IsExpanded

Returns whether the item is expanded or not.

IsItem3State

Returns whether or not the checkbox item is a 3-state checkbox.

IsItemChecked

Returns whether an item is checked or not.

IsItemEnabled

Returns whether an item is enabled or disabled.

IsItemHyperText

Returns whether an item is hypertext or not.

IsItemVisible

Returns whether the item is visible or not.

IsSelected

Returns whether the item is selected or not.

ItemHasChildren

Returns whether the item has children or not.

PrependItem

Prepends an item as a first child of parent.

ScrollTo

Scrolls the specified item into view.

SelectAll

Selects all the item in the tree.

SelectAllChildren

Selects all the children of the given item.

SelectItem

Selects/deselects an item.

SetBackgroundImage

Sets the TreeListMainWindow background image.

SetBorderPen

Sets the pen used to draw the selected item border.

SetButtonsImageList

Sets the buttons image list for TreeListMainWindow.

SetConnectionPen

Sets the pen used to draw the connecting lines between items.

SetDisabledColour

Sets the colour for items in a disabled state.

SetDragFullScreen

Sets whether a drag operation will be performed full screen or not.

SetDragItem

Sets the specified item as member of a current drag and drop operation.

SetFirstGradientColour

Sets the first gradient colour for gradient-style selections.

SetGradientStyle

Sets the gradient style for gradient-style selections.

SetHilightFocusColour

Sets the colour used to highlight focused selected items.

SetHilightNonFocusColour

Sets the colour used to highlight unfocused selected items.

SetHyperTextFont

Sets the font used to render hypertext items.

SetHyperTextNewColour

Sets the colour used to render a non-visited hypertext item.

SetHyperTextVisitedColour

Sets the colour used to render a visited hypertext item.

SetImageList

Sets the normal image list for TreeListMainWindow.

SetImageListCheck

Sets the checkbox/radiobutton image list.

SetIndent

Currently has no effect on HyperTreeList. The indent is auto-calculated.

SetItem3State

Sets whether the item has a 3-state value checkbox assigned to it or not.

SetItem3StateValue

Sets the checkbox item to the given state.

SetItemBackgroundColour

Sets the item background colour.

SetItemBold

Sets the item font as bold/unbold.

SetItemDropHighlight

Gives the item the visual feedback for drag and drop operations.

SetItemFont

Sets the item font.

SetItemHasChildren

Forces the appearance/disappearance of the button next to the item.

SetItemHyperText

Sets whether the item is hypertext or not.

SetItemImage

Sets the item image for a particular item state.

SetItemItalic

Sets the item font as italic/non-italic.

SetItemPyData

Another name for SetPyData

SetItemText

Sets the item text label.

SetItemTextColour

Sets the item text colour or separator horizontal line colour.

SetItemType

Sets the item type.

SetItemVisited

Sets whether an hypertext item was visited.

SetItemWindow

Sets the window associated to an item.

SetItemWindowEnabled

Sets whether the window associated with an item is enabled or not.

SetMainColumn

Sets the HyperTreeList main column (i.e. the column of the tree).

SetPyData

Sets the data associated to an item.

SetSecondGradientColour

Sets the second gradient colour for gradient-style selections.

SetSpacing

Currently has no effect on HyperTreeList.

SetStateImageList

Sets the state image list for TreeListMainWindow

ShouldInheritColours

Return True to allow the window colours to be changed by InheritAttributes.

Toggle

Toggles the item state (collapsed/expanded).

ToggleItemSelection

Toggles the item selection.

UnCheckRadioParent

Used internally to handle radio node parent correctly.

Unselect

Unselects the current selection.

UnselectAll

Unselect all the items.


class_hierarchy Class Hierarchy

Inheritance diagram for class HyperTreeList:

appearance Control Appearance


wxMSW

wxMSW

wxMAC

wxMAC

wxGTK

wxGTK


super_classes Known Superclasses

wx.Control


method_summary Methods Summary

__init__

Default class constructor.

AddColumn

Appends a column to the HyperTreeList.

AddColumnInfo

Appends a column to the HyperTreeList.

CalculateAndSetHeaderHeight

Calculates the best header height and stores it.

CreateEditCtrl

Create an edit control for editing a label of an item. By default, this

delegate

DoGetBestSize

Gets the size which best suits the window: for a control, it would be the

DoHeaderLayout

Layouts the header control.

Freeze

Freeze HyperTreeList to allow rapid changes to the tree.

GetAGWWindowStyleFlag

Returns the HyperTreeList window style flag.

GetColumn

Returns an instance of TreeListColumnInfo containing column information.

GetColumnAlignment

Returns the column text alignment.

GetColumnColour

Returns the column text colour.

GetColumnFont

Returns the column text font.

GetColumnImage

Returns the image assigned to the specified column.

GetColumnText

Returns the column text label.

GetColumnWidth

Returns the column width, in pixels.

GetHeaderWindow

Returns the header window, an instance of TreeListHeaderWindow.

GetMainWindow

Returns the main window, an instance of TreeListMainWindow.

GetTextCtrlAlignmentStyle

Return the alignment style to use for the text control that is used

GetTextCtrlStyle

Return the style to use for the text control that is used to edit

HasAGWFlag

Returns whether a flag is present in the HyperTreeList style.

InsertColumn

Inserts a column to the HyperTreeList at the position specified

InsertColumnInfo

Inserts a column to the HyperTreeList at the position specified

IsColumnEditable

Returns True if the column is editable, False otherwise.

IsColumnShown

Returns True if the column is shown, False otherwise.

OnCompareItems

Returns the comparison of two items. Used for sorting.

OnGetItemText

If the TR_VIRTUAL style is set this function must be overloaded

OnHTLFocus

Handles the wx.EVT_SET_FOCUS event for HyperTreeList.

OnSize

Handles the wx.EVT_SIZE event for HyperTreeList.

Refresh

Causes this window, and all of its children recursively (except under wxGTK1

RemoveColumn

Removes a column from the HyperTreeList.

SetAGWWindowStyleFlag

Sets the window style for HyperTreeList.

SetBackgroundColour

Changes the background colour of HyperTreeList.

SetBuffered

Sets/unsets the double buffering for the header and the main window.

SetColumn

Sets a column using an instance of TreeListColumnInfo.

SetColumnAlignment

Sets the column text alignment.

SetColumnColour

Sets the column text colour.

SetColumnEditable

Sets the column as editable or non-editable.

SetColumnFont

Sets the column text font.

SetColumnImage

Sets an image on the specified column.

SetColumnShown

Sets the column as shown or hidden.

SetColumnSortIcon

Sets the sort icon to be displayed in the column header.

SetColumnText

Sets the column text label.

SetColumnWidth

Sets the column width, in pixels.

SetFocus

This sets the window to receive keyboard input.

SetFont

Sets the default font for the header window and the main window.

SetForegroundColour

Changes the foreground colour of HyperTreeList.

SetHeaderCustomRenderer

Associate a custom renderer with the header - all columns will use it

SetHeaderFont

Sets the default font for the header window..

SortChildren

Sorts the children of the given item using OnCompareItems method of HyperTreeList.

Thaw

Thaw HyperTreeList.


api Class API

class HyperTreeList(wx.Control)

HyperTreeList is a generic widget that combines the multicolumn features of a wx.ListCtrl with the hierarchical features of a 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:

These widgets can be obtained by the GetHeaderWindow and GetMainWindow methods respectively although this shouldn’t be needed in normal usage.

Please note that in addition to the defined methods of HyperTreeList many more methods are delegated to the internal TreeListMainWindow and its subclass CustomTreeCtrl. These methods can be called directly from the HyperTreeList class:

AddRoot

Adds a root item to the TreeListMainWindow.

AppendItem

Appends an item as a last child of its parent.

AssignButtonsImageList

Assigns the button image list.

AssignImageList

Assigns the normal image list.

AssignStateImageList

Assigns the state image list.

AutoCheckChild

Transverses the tree and checks/unchecks the items.

AutoCheckParent

Traverses up the tree and checks/unchecks parent items.

AutoToggleChild

Transverses the tree and toggles the items.

CheckChilds

Programmatically check/uncheck item children.

CheckItem

Actually checks/uncheks an item, sending the two related events.

CheckItem2

Used internally to avoid EVT_TREE_ITEM_CHECKED events.

CheckSameLevel

Uncheck radio items which are on the same level of the checked one.

Collapse

Collapse an item, sending the two related events.

CollapseAndReset

Collapse the given item and deletes its children.

Delete

Deletes an item.

DeleteAllItems

Delete all items in the TreeListMainWindow.

DeleteChildren

Delete all the item’s children.

DeleteItemWindow

Deletes the window in the column associated to an item (if any).

DeleteRoot

Removes the tree root item (and subsequently all the items in the tree).

EditLabel

Starts editing an item label.

EnableChildren

Enables/disables the item children.

EnableItem

Enables/disables an item.

EnableSelectionGradient

Globally enables/disables drawing of gradient selections.

EnableSelectionVista

Globally enables/disables drawing of Windows Vista selections.

EnsureVisible

Scrolls and/or expands items to ensure that the given item is visible.

Expand

Expands an item, sending the two related events.

ExpandAll

Expands all TreeListMainWindow items.

ExpandAllChildren

Expands all the items children of the input item.

FindItem

Finds the first item starting with the given prefix after the given parent.

GetBackgroundImage

Returns the TreeListMainWindow background image (if any).

GetBorderPen

Returns the pen used to draw the selected item border.

GetBoundingRect

Retrieves the rectangle bounding the item.

GetButtonsImageList

Returns the buttons image list associated with TreeListMainWindow.

GetChildrenCount

Returns the item children count.

GetColumnCount

Returns the total number of columns.

GetConnectionPen

Returns the pen used to draw the connecting lines between items.

GetCount

Returns the global number of items in the tree.

GetCurrentItem

Returns the current item. Simply calls GetSelection.

GetDisabledColour

Returns the colour for items in a disabled state.

GetDragFullScreen

Returns whether built-in drag/drop will be full screen or not.

GetEditControl

Returns a reference to the edit TreeTextCtrl if the item is being edited.

GetFirstChild

Returns the item’s first child and an integer value ‘cookie’.

GetFirstExpandedItem

Returns the first item which is in the expanded state.

GetFirstGradientColour

Returns the first gradient colour for gradient-style selections.

GetFirstVisibleItem

Returns the first visible item.

GetFocusedItem

Another name for GetSelection

GetGradientStyle

Returns the gradient style for gradient-style selections.

GetHilightFocusColour

Returns the colour used to highlight focused selected items.

GetHilightNonFocusColour

Returns the colour used to highlight unfocused selected items.

GetHyperTextFont

Returns the font used to render hypertext items.

GetHyperTextNewColour

Returns the colour used to render a non-visited hypertext item.

GetHyperTextVisitedColour

Returns the colour used to render a visited hypertext item.

GetImageList

Returns the normal image list associated with TreeListMainWindow.

GetImageListCheck

Returns the wx.ImageList used for the check/radio buttons in TreeListMainWindow.

GetIndent

Returns the item indentation, in pixels.

GetItem3StateValue

Gets the state of a 3-state checkbox item.

GetItemBackgroundColour

Returns the item background colour.

GetItemFont

Returns the item font.

GetItemImage

Returns the item image.

GetItemParent

Returns the item parent (can be None for root items).

GetItemPyData

Another name for GetPyData

GetItemText

Returns the item text label.

GetItemTextColour

Returns the item text colour or separator horizontal line colour.

GetItemType

Returns the item type.

GetItemVisited

Returns whether an hypertext item was visited.

GetItemWindow

Returns the window associated with an item.

GetItemWindowEnabled

Returns whether the window associated with an item is enabled or not.

GetLastChild

Returns the item last child.

GetNext

Returns the next item. Only for internal use right now.

GetNextChild

Returns the item’s next child.

GetNextExpanded

Returns the next expanded item after the input one.

GetNextShown

Returns the next displayed item in the tree, visible or not.

GetNextSibling

Returns the next sibling of an item.

GetNextVisible

Returns the next item that is visible to the user.

GetPrev

Returns the previous item. Only for internal use right now.

GetPrevChild

Returns the previous child of an item.

GetPrevExpanded

Returns the previous expanded item before the input one.

GetPrevShown

Returns the previous displayed item in the tree, visible or not.

GetPrevSibling

Returns the previous sibling of an item.

GetPrevVisible

Returns the previous item visible to the user.

GetPyData

Returns the data associated to an item.

GetRootItem

Returns the root item, an instance of GenericTreeItem.

GetSecondGradientColour

Returns the second gradient colour for gradient-style selections.

GetSelection

Returns the current selection.

GetSelections

Returns a list of selected items.

GetSpacing

Returns the spacing between the start and the text, in pixels.

GetStateImageList

Returns the state image list associated with TreeListMainWindow.

HasChildren

Returns whether an item has children or not.

HideItem

Hides/shows an item.

HitTest

Finds which (if any) item is under the given point, returning the item plus flags.

InsertItem

Inserts an item after the given previous.

IsBold

Returns whether the item font is bold or not.

IsDescendantOf

Checks if the given item is under another one in the tree hierarchy.

IsExpanded

Returns whether the item is expanded or not.

IsItem3State

Returns whether or not the checkbox item is a 3-state checkbox.

IsItemChecked

Returns whether an item is checked or not.

IsItemEnabled

Returns whether an item is enabled or disabled.

IsItemHyperText

Returns whether an item is hypertext or not.

IsItemVisible

Returns whether the item is visible or not.

IsSelected

Returns whether the item is selected or not.

ItemHasChildren

Returns whether the item has children or not.

PrependItem

Prepends an item as a first child of parent.

ScrollTo

Scrolls the specified item into view.

SelectAll

Selects all the item in the tree.

SelectAllChildren

Selects all the children of the given item.

SelectItem

Selects/deselects an item.

SetBackgroundImage

Sets the TreeListMainWindow background image.

SetBorderPen

Sets the pen used to draw the selected item border.

SetButtonsImageList

Sets the buttons image list for TreeListMainWindow.

SetConnectionPen

Sets the pen used to draw the connecting lines between items.

SetDisabledColour

Sets the colour for items in a disabled state.

SetDragFullScreen

Sets whether a drag operation will be performed full screen or not.

SetDragItem

Sets the specified item as member of a current drag and drop operation.

SetFirstGradientColour

Sets the first gradient colour for gradient-style selections.

SetGradientStyle

Sets the gradient style for gradient-style selections.

SetHilightFocusColour

Sets the colour used to highlight focused selected items.

SetHilightNonFocusColour

Sets the colour used to highlight unfocused selected items.

SetHyperTextFont

Sets the font used to render hypertext items.

SetHyperTextNewColour

Sets the colour used to render a non-visited hypertext item.

SetHyperTextVisitedColour

Sets the colour used to render a visited hypertext item.

SetImageList

Sets the normal image list for TreeListMainWindow.

SetImageListCheck

Sets the checkbox/radiobutton image list.

SetIndent

Currently has no effect on HyperTreeList. The indent is auto-calculated.

SetItem3State

Sets whether the item has a 3-state value checkbox assigned to it or not.

SetItem3StateValue

Sets the checkbox item to the given state.

SetItemBackgroundColour

Sets the item background colour.

SetItemBold

Sets the item font as bold/unbold.

SetItemDropHighlight

Gives the item the visual feedback for drag and drop operations.

SetItemFont

Sets the item font.

SetItemHasChildren

Forces the appearance/disappearance of the button next to the item.

SetItemHyperText

Sets whether the item is hypertext or not.

SetItemImage

Sets the item image for a particular item state.

SetItemItalic

Sets the item font as italic/non-italic.

SetItemPyData

Another name for SetPyData

SetItemText

Sets the item text label.

SetItemTextColour

Sets the item text colour or separator horizontal line colour.

SetItemType

Sets the item type.

SetItemVisited

Sets whether an hypertext item was visited.

SetItemWindow

Sets the window associated to an item.

SetItemWindowEnabled

Sets whether the window associated with an item is enabled or not.

SetMainColumn

Sets the HyperTreeList main column (i.e. the column of the tree).

SetPyData

Sets the data associated to an item.

SetSecondGradientColour

Sets the second gradient colour for gradient-style selections.

SetSpacing

Currently has no effect on HyperTreeList.

SetStateImageList

Sets the state image list for TreeListMainWindow

ShouldInheritColours

Return True to allow the window colours to be changed by InheritAttributes.

Toggle

Toggles the item state (collapsed/expanded).

ToggleItemSelection

Toggles the item selection.

UnCheckRadioParent

Used internally to handle radio node parent correctly.

Unselect

Unselects the current selection.

UnselectAll

Unselect all the items.


Methods

__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.

Parameters:
  • parent – parent window. Must not be None;

  • id – window identifier. A value of -1 indicates a default value;

  • pos – the control position. A value of (-1, -1) indicates a default position, chosen by either the windowing system or wxPython, depending on platform;

  • size – the control size. A value of (-1, -1) indicates a default size, chosen by either the windowing system or wxPython, depending on platform;

  • style – the underlying wx.Control style;

  • agwStyle – the AGW-specific HyperTreeList window style. see hypertreelist for a full list of flags.

  • validator – window validator;

  • name – window name.



AddColumn(self, text, width=_DEFAULT_COL_WIDTH, flag=wx.ALIGN_LEFT, image=-1, shown=True, colour=None, edit=False)

Appends a column to the HyperTreeList.

Parameters:
  • text – the column text label;

  • width – the column width in pixels;

  • flag – the column alignment flag, one of wx.ALIGN_LEFT, wx.ALIGN_RIGHT, wx.ALIGN_CENTER;

  • image – an index within the normal image list assigned to HyperTreeList specifying the image to use for the column;

  • shownTrue to show the column, False to hide it;

  • colour – a valid wx.Colour, representing the text foreground colour for the column;

  • editTrue to set the column as editable, False otherwise.



AddColumnInfo(self, colInfo)

Appends a column to the HyperTreeList.

Parameters:

colInfo – an instance of TreeListColumnInfo.



CalculateAndSetHeaderHeight(self)

Calculates the best header height and stores it.



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.

Parameters:
  • item – an instance of TreeListItem;

  • column – an integer specifying the column index.



delegate(self, *args, **kwargs)


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 wx.Control.



DoHeaderLayout(self)

Layouts the header control.



Freeze(self)

Freeze 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. Thaw must be called to re-enable updates. Calls to these two functions may be nested.



GetAGWWindowStyleFlag(self)

Returns the HyperTreeList window style flag.

See also

SetAGWWindowStyleFlag for a list of valid window styles.



GetColumn(self, column)

Returns an instance of TreeListColumnInfo containing column information.

Parameters:

column – an integer specifying the column index.



GetColumnAlignment(self, column)

Returns the column text alignment.

Parameters:

column – an integer specifying the column index.



GetColumnColour(self, column)

Returns the column text colour.

Parameters:

column – an integer specifying the column index.



GetColumnFont(self, column)

Returns the column text font.

Parameters:

column – an integer specifying the column index.



GetColumnImage(self, column)

Returns the image assigned to the specified column.

Parameters:

column – an integer specifying the column index.



GetColumnText(self, column)

Returns the column text label.

Parameters:

column – an integer specifying the column index.



GetColumnWidth(self, column)

Returns the column width, in pixels.

Parameters:

column – an integer specifying the column index.



GetHeaderWindow(self)

Returns the header window, an instance of TreeListHeaderWindow.



GetMainWindow(self)

Returns the main window, an instance of TreeListMainWindow.



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.

Parameters:

column – an integer specifying the column index.



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.

Parameters:

column – an integer specifying the column index.



HasAGWFlag(self, flag)

Returns whether a flag is present in the HyperTreeList style.

Parameters:

flag – one of the possible HyperTreeList window styles.

See also

SetAGWWindowStyleFlag for a list of possible window style flags.



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 HyperTreeList at the position specified by before.

Parameters:
  • before – the index at which we wish to insert the new column;

  • text – the column text label;

  • width – the column width in pixels;

  • flag – the column alignment flag, one of wx.ALIGN_LEFT, wx.ALIGN_RIGHT, wx.ALIGN_CENTER;

  • image – an index within the normal image list assigned to HyperTreeList specifying the image to use for the column;

  • shownTrue to show the column, False to hide it;

  • colour – a valid wx.Colour, representing the text foreground colour for the column;

  • editTrue to set the column as editable, False otherwise.



InsertColumnInfo(self, before, colInfo)

Inserts a column to the HyperTreeList at the position specified by before.

Parameters:
  • before – the index at which we wish to insert the new column;

  • colInfo – an instance of TreeListColumnInfo.



IsColumnEditable(self, column)

Returns True if the column is editable, False otherwise.

Parameters:

column – an integer specifying the column index.



IsColumnShown(self, column)

Returns True if the column is shown, False otherwise.

Parameters:

column – an integer specifying the column index.



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 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.

Parameters:

Note

The base class version compares items alphabetically.



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.

Parameters:
  • item – an instance of TreeListItem;

  • column – an integer specifying the column index.



OnHTLFocus(self, event)

Handles the wx.EVT_SET_FOCUS event for HyperTreeList.

Parameters:

event – a wx.SizeEvent event to be processed.



OnSize(self, event)

Handles the wx.EVT_SIZE event for HyperTreeList.

Parameters:

event – a wx.SizeEvent event to be processed.



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.

Parameters:
  • erase – If True, the background will be erased;

  • 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 wx.Control.



RemoveColumn(self, column)

Removes a column from the HyperTreeList.

Parameters:

column – an integer specifying the column index.



SetAGWWindowStyleFlag(self, agwStyle)

Sets the window style for HyperTreeList.

Parameters:

agwStyle – can be a combination of various bits. See 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.



SetBackgroundColour(self, colour)

Changes the background colour of HyperTreeList.

Parameters:

colour – the colour to be used as the background colour, pass NullColour to reset to the default colour.

Note

The background colour is usually painted by the default 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 wx.Window.ClearBackground or wx.Window.Refresh after calling this function.

Note

Overridden from wx.Control.



SetBuffered(self, buffered)

Sets/unsets the double buffering for the header and the main window.

Parameters:

bufferedTrue to use double-buffering, False otherwise.

Note

Currently we are using double-buffering only on Windows XP.



SetColumn(self, column, colInfo)

Sets a column using an instance of TreeListColumnInfo.

Parameters:
  • column – an integer specifying the column index;

  • info – an instance of TreeListColumnInfo.



SetColumnAlignment(self, column, flag)

Sets the column text alignment.

Parameters:
  • column – an integer specifying the column index;

  • flag – the alignment flag, one of wx.ALIGN_LEFT, wx.ALIGN_RIGHT, wx.ALIGN_CENTER.



SetColumnColour(self, column, colour)

Sets the column text colour.

Parameters:
  • column – an integer specifying the column index;

  • colour – a valid wx.Colour object.



SetColumnEditable(self, column, edit)

Sets the column as editable or non-editable.

Parameters:
  • column – an integer specifying the column index;

  • editTrue if the column should be editable, False otherwise.



SetColumnFont(self, column, font)

Sets the column text font.

Parameters:
  • column – an integer specifying the column index;

  • font – a valid wx.Font object.



SetColumnImage(self, column, image)

Sets an image on the specified column.

Parameters:
  • column – an integer specifying the column index.

  • image – an index within the normal image list assigned to HyperTreeList specifying the image to use for the column.



SetColumnShown(self, column, shown)

Sets the column as shown or hidden.

Parameters:
  • column – an integer specifying the column index;

  • shownTrue if the column should be shown, False if it should be hidden.



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.

Parameters:
  • column – an integer specifying the column index;

  • sortIcon – the sort icon to display, one of wx.HDR_SORT_ICON_NONE, wx.HDR_SORT_ICON_UP, wx.HDR_SORT_ICON_DOWN.

  • colour – the colour of the sort icon as a wx.Colour. Optional. Set to None to restore native colour.



SetColumnText(self, column, text)

Sets the column text label.

Parameters:
  • column – an integer specifying the column index;

  • text – the new column label.



SetColumnWidth(self, column, width)

Sets the column width, in pixels.

Parameters:
  • column – an integer specifying the column index;

  • width – the new column width, in pixels.



SetFocus(self)

This sets the window to receive keyboard input.



SetFont(self, font)

Sets the default font for the header window and the main window.

Parameters:

font – a valid wx.Font object.



SetForegroundColour(self, colour)

Changes the foreground colour of HyperTreeList.

Parameters:

colour – the colour to be used as the foreground colour, pass NullColour to reset to the default colour.

Note

Overridden from wx.Control.



SetHeaderCustomRenderer(self, renderer=None)

Associate a custom renderer with the header - all columns will use it

Parameters:

renderer – a class able to correctly render header buttons

Note

the renderer class must implement the method DrawHeaderButton



SetHeaderFont(self, font)

Sets the default font for the header window..

Parameters:

font – a valid wx.Font object.



SortChildren(self, item)

Sorts the children of the given item using OnCompareItems method of HyperTreeList. You should override that method to change the sort order (the default is ascending case-sensitive alphabetical order).

Parameters:

item – an instance of TreeListItem;



Thaw(self)

Thaw HyperTreeList.

Reenables updates to the main (tree) and header windows after a previous call to Freeze. To really thaw the control, it must be called exactly the same number of times as Freeze. When fully thawed the tree will re-calculate and update itself.

Raise:

Exception if Thaw has been called without an un-matching Freeze.