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:
TreeListHeaderWindow
displays the column headers.
TreeListMainWindow
is the main tree list based off CustomTreeCtrl
.
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:
Adds a root item to the |
|
Appends an item as a last child of its parent. |
|
Assigns the button image list. |
|
Assigns the normal image list. |
|
Assigns the state image list. |
|
Transverses the tree and checks/unchecks the items. |
|
Traverses up the tree and checks/unchecks parent items. |
|
Transverses the tree and toggles the items. |
|
Programmatically check/uncheck item children. |
|
Actually checks/uncheks an item, sending the two related events. |
|
Used internally to avoid |
|
Uncheck radio items which are on the same level of the checked one. |
|
Collapse an item, sending the two related events. |
|
Collapse the given item and deletes its children. |
|
Deletes an item. |
|
Delete all items in the |
|
Delete all the item’s children. |
|
Deletes the window in the column associated to an item (if any). |
|
Removes the tree root item (and subsequently all the items in the tree). |
|
Starts editing an item label. |
|
Enables/disables the item children. |
|
Enables/disables an item. |
|
Globally enables/disables drawing of gradient selections. |
|
Globally enables/disables drawing of Windows Vista selections. |
|
Scrolls and/or expands items to ensure that the given item is visible. |
|
Expands an item, sending the two related events. |
|
Expands all |
|
Expands all the items children of the input item. |
|
Finds the first item starting with the given prefix after the given parent. |
|
Returns the |
|
Returns the pen used to draw the selected item border. |
|
Retrieves the rectangle bounding the item. |
|
Returns the buttons image list associated with |
|
Returns the item children count. |
|
Returns the total number of columns. |
|
Returns the pen used to draw the connecting lines between items. |
|
Returns the global number of items in the tree. |
|
Returns the current item. Simply calls |
|
Returns the colour for items in a disabled state. |
|
Returns whether built-in drag/drop will be full screen or not. |
|
Returns a reference to the edit |
|
Returns the item’s first child and an integer value ‘cookie’. |
|
Returns the first item which is in the expanded state. |
|
Returns the first gradient colour for gradient-style selections. |
|
Returns the first visible item. |
|
GetFocusedItem |
Another name for |
Returns the gradient style for gradient-style selections. |
|
Returns the colour used to highlight focused selected items. |
|
Returns the colour used to highlight unfocused selected items. |
|
Returns the font used to render hypertext items. |
|
Returns the colour used to render a non-visited hypertext item. |
|
Returns the colour used to render a visited hypertext item. |
|
Returns the normal image list associated with |
|
Returns the |
|
Returns the item indentation, in pixels. |
|
Gets the state of a 3-state checkbox item. |
|
Returns the item background colour. |
|
Returns the item font. |
|
Returns the item image. |
|
Returns the item parent (can be |
|
GetItemPyData |
Another name for |
Returns the item text label. |
|
Returns the item text colour or separator horizontal line colour. |
|
Returns the item type. |
|
Returns whether an hypertext item was visited. |
|
Returns the window associated with an item. |
|
Returns whether the window associated with an item is enabled or not. |
|
Returns the item last child. |
|
Returns the next item. Only for internal use right now. |
|
Returns the item’s next child. |
|
Returns the next expanded item after the input one. |
|
Returns the next displayed item in the tree, visible or not. |
|
Returns the next sibling of an item. |
|
Returns the next item that is visible to the user. |
|
Returns the previous item. Only for internal use right now. |
|
Returns the previous child of an item. |
|
Returns the previous expanded item before the input one. |
|
Returns the previous displayed item in the tree, visible or not. |
|
Returns the previous sibling of an item. |
|
Returns the previous item visible to the user. |
|
Returns the data associated to an item. |
|
Returns the root item, an instance of |
|
Returns the second gradient colour for gradient-style selections. |
|
Returns the current selection. |
|
Returns a list of selected items. |
|
Returns the spacing between the start and the text, in pixels. |
|
Returns the state image list associated with |
|
Returns whether an item has children or not. |
|
Hides/shows an item. |
|
Finds which (if any) item is under the given point, returning the item plus flags. |
|
Inserts an item after the given previous. |
|
Returns whether the item font is bold or not. |
|
Checks if the given item is under another one in the tree hierarchy. |
|
Returns whether the item is expanded or not. |
|
Returns whether or not the checkbox item is a 3-state checkbox. |
|
Returns whether an item is checked or not. |
|
Returns whether an item is enabled or disabled. |
|
Returns whether an item is hypertext or not. |
|
Returns whether the item is visible or not. |
|
Returns whether the item is selected or not. |
|
Returns whether the item has children or not. |
|
Prepends an item as a first child of parent. |
|
Scrolls the specified item into view. |
|
Selects all the item in the tree. |
|
Selects all the children of the given item. |
|
Selects/deselects an item. |
|
Sets the |
|
Sets the pen used to draw the selected item border. |
|
Sets the buttons image list for |
|
Sets the pen used to draw the connecting lines between items. |
|
Sets the colour for items in a disabled state. |
|
Sets whether a drag operation will be performed full screen or not. |
|
Sets the specified item as member of a current drag and drop operation. |
|
Sets the first gradient colour for gradient-style selections. |
|
Sets the gradient style for gradient-style selections. |
|
Sets the colour used to highlight focused selected items. |
|
Sets the colour used to highlight unfocused selected items. |
|
Sets the font used to render hypertext items. |
|
Sets the colour used to render a non-visited hypertext item. |
|
Sets the colour used to render a visited hypertext item. |
|
Sets the normal image list for |
|
Sets the checkbox/radiobutton image list. |
|
Currently has no effect on |
|
Sets whether the item has a 3-state value checkbox assigned to it or not. |
|
Sets the checkbox item to the given state. |
|
Sets the item background colour. |
|
Sets the item font as bold/unbold. |
|
Gives the item the visual feedback for drag and drop operations. |
|
Sets the item font. |
|
Forces the appearance/disappearance of the button next to the item. |
|
Sets whether the item is hypertext or not. |
|
Sets the item image for a particular item state. |
|
Sets the item font as italic/non-italic. |
|
SetItemPyData |
Another name for |
Sets the item text label. |
|
Sets the item text colour or separator horizontal line colour. |
|
Sets the item type. |
|
Sets whether an hypertext item was visited. |
|
Sets the window associated to an item. |
|
Sets whether the window associated with an item is enabled or not. |
|
Sets the |
|
Sets the data associated to an item. |
|
Sets the second gradient colour for gradient-style selections. |
|
Currently has no effect on |
|
Sets the state image list for |
|
Return |
|
Toggles the item state (collapsed/expanded). |
|
Toggles the item selection. |
|
Used internally to handle radio node parent correctly. |
|
Unselects the current selection. |
|
Unselect all the items. |
Default class constructor. |
|
Appends a column to the |
|
Appends a column to the |
|
Calculates the best header height and stores it. |
|
Create an edit control for editing a label of an item. By default, this |
|
Gets the size which best suits the window: for a control, it would be the |
|
Layouts the header control. |
|
Freeze |
|
Returns the |
|
Returns an instance of |
|
Returns the column text alignment. |
|
Returns the column text colour. |
|
Returns the column text font. |
|
Returns the image assigned to the specified column. |
|
Returns the column text label. |
|
Returns the column width, in pixels. |
|
Returns the header window, an instance of |
|
Returns the main window, an instance of |
|
Return the alignment style to use for the text control that is used |
|
Return the style to use for the text control that is used to edit |
|
Returns whether a flag is present in the |
|
Inserts a column to the |
|
Inserts a column to the |
|
Returns |
|
Returns |
|
Returns the comparison of two items. Used for sorting. |
|
If the |
|
Handles the |
|
Handles the |
|
Causes this window, and all of its children recursively (except under wxGTK1 |
|
Removes a column from the |
|
Sets the window style for |
|
Changes the background colour of |
|
Sets/unsets the double buffering for the header and the main window. |
|
Sets a column using an instance of |
|
Sets the column text alignment. |
|
Sets the column text colour. |
|
Sets the column as editable or non-editable. |
|
Sets the column text font. |
|
Sets an image on the specified column. |
|
Sets the column as shown or hidden. |
|
Sets the sort icon to be displayed in the column header. |
|
Sets the column text label. |
|
Sets the column width, in pixels. |
|
This sets the window to receive keyboard input. |
|
Sets the default font for the header window and the main window. |
|
Changes the foreground colour of |
|
Associate a custom renderer with the header - all columns will use it |
|
Sets the default font for the header window.. |
|
Sorts the children of the given item using |
|
Thaw |
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:
TreeListHeaderWindow
displays the column headers.
TreeListMainWindow
is the main tree list based off CustomTreeCtrl
.
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:
Adds a root item to the |
|
Appends an item as a last child of its parent. |
|
Assigns the button image list. |
|
Assigns the normal image list. |
|
Assigns the state image list. |
|
Transverses the tree and checks/unchecks the items. |
|
Traverses up the tree and checks/unchecks parent items. |
|
Transverses the tree and toggles the items. |
|
Programmatically check/uncheck item children. |
|
Actually checks/uncheks an item, sending the two related events. |
|
Used internally to avoid |
|
Uncheck radio items which are on the same level of the checked one. |
|
Collapse an item, sending the two related events. |
|
Collapse the given item and deletes its children. |
|
Deletes an item. |
|
Delete all items in the |
|
Delete all the item’s children. |
|
Deletes the window in the column associated to an item (if any). |
|
Removes the tree root item (and subsequently all the items in the tree). |
|
Starts editing an item label. |
|
Enables/disables the item children. |
|
Enables/disables an item. |
|
Globally enables/disables drawing of gradient selections. |
|
Globally enables/disables drawing of Windows Vista selections. |
|
Scrolls and/or expands items to ensure that the given item is visible. |
|
Expands an item, sending the two related events. |
|
Expands all |
|
Expands all the items children of the input item. |
|
Finds the first item starting with the given prefix after the given parent. |
|
Returns the |
|
Returns the pen used to draw the selected item border. |
|
Retrieves the rectangle bounding the item. |
|
Returns the buttons image list associated with |
|
Returns the item children count. |
|
Returns the total number of columns. |
|
Returns the pen used to draw the connecting lines between items. |
|
Returns the global number of items in the tree. |
|
Returns the current item. Simply calls |
|
Returns the colour for items in a disabled state. |
|
Returns whether built-in drag/drop will be full screen or not. |
|
Returns a reference to the edit |
|
Returns the item’s first child and an integer value ‘cookie’. |
|
Returns the first item which is in the expanded state. |
|
Returns the first gradient colour for gradient-style selections. |
|
Returns the first visible item. |
|
GetFocusedItem |
Another name for |
Returns the gradient style for gradient-style selections. |
|
Returns the colour used to highlight focused selected items. |
|
Returns the colour used to highlight unfocused selected items. |
|
Returns the font used to render hypertext items. |
|
Returns the colour used to render a non-visited hypertext item. |
|
Returns the colour used to render a visited hypertext item. |
|
Returns the normal image list associated with |
|
Returns the |
|
Returns the item indentation, in pixels. |
|
Gets the state of a 3-state checkbox item. |
|
Returns the item background colour. |
|
Returns the item font. |
|
Returns the item image. |
|
Returns the item parent (can be |
|
GetItemPyData |
Another name for |
Returns the item text label. |
|
Returns the item text colour or separator horizontal line colour. |
|
Returns the item type. |
|
Returns whether an hypertext item was visited. |
|
Returns the window associated with an item. |
|
Returns whether the window associated with an item is enabled or not. |
|
Returns the item last child. |
|
Returns the next item. Only for internal use right now. |
|
Returns the item’s next child. |
|
Returns the next expanded item after the input one. |
|
Returns the next displayed item in the tree, visible or not. |
|
Returns the next sibling of an item. |
|
Returns the next item that is visible to the user. |
|
Returns the previous item. Only for internal use right now. |
|
Returns the previous child of an item. |
|
Returns the previous expanded item before the input one. |
|
Returns the previous displayed item in the tree, visible or not. |
|
Returns the previous sibling of an item. |
|
Returns the previous item visible to the user. |
|
Returns the data associated to an item. |
|
Returns the root item, an instance of |
|
Returns the second gradient colour for gradient-style selections. |
|
Returns the current selection. |
|
Returns a list of selected items. |
|
Returns the spacing between the start and the text, in pixels. |
|
Returns the state image list associated with |
|
Returns whether an item has children or not. |
|
Hides/shows an item. |
|
Finds which (if any) item is under the given point, returning the item plus flags. |
|
Inserts an item after the given previous. |
|
Returns whether the item font is bold or not. |
|
Checks if the given item is under another one in the tree hierarchy. |
|
Returns whether the item is expanded or not. |
|
Returns whether or not the checkbox item is a 3-state checkbox. |
|
Returns whether an item is checked or not. |
|
Returns whether an item is enabled or disabled. |
|
Returns whether an item is hypertext or not. |
|
Returns whether the item is visible or not. |
|
Returns whether the item is selected or not. |
|
Returns whether the item has children or not. |
|
Prepends an item as a first child of parent. |
|
Scrolls the specified item into view. |
|
Selects all the item in the tree. |
|
Selects all the children of the given item. |
|
Selects/deselects an item. |
|
Sets the |
|
Sets the pen used to draw the selected item border. |
|
Sets the buttons image list for |
|
Sets the pen used to draw the connecting lines between items. |
|
Sets the colour for items in a disabled state. |
|
Sets whether a drag operation will be performed full screen or not. |
|
Sets the specified item as member of a current drag and drop operation. |
|
Sets the first gradient colour for gradient-style selections. |
|
Sets the gradient style for gradient-style selections. |
|
Sets the colour used to highlight focused selected items. |
|
Sets the colour used to highlight unfocused selected items. |
|
Sets the font used to render hypertext items. |
|
Sets the colour used to render a non-visited hypertext item. |
|
Sets the colour used to render a visited hypertext item. |
|
Sets the normal image list for |
|
Sets the checkbox/radiobutton image list. |
|
Currently has no effect on |
|
Sets whether the item has a 3-state value checkbox assigned to it or not. |
|
Sets the checkbox item to the given state. |
|
Sets the item background colour. |
|
Sets the item font as bold/unbold. |
|
Gives the item the visual feedback for drag and drop operations. |
|
Sets the item font. |
|
Forces the appearance/disappearance of the button next to the item. |
|
Sets whether the item is hypertext or not. |
|
Sets the item image for a particular item state. |
|
Sets the item font as italic/non-italic. |
|
SetItemPyData |
Another name for |
Sets the item text label. |
|
Sets the item text colour or separator horizontal line colour. |
|
Sets the item type. |
|
Sets whether an hypertext item was visited. |
|
Sets the window associated to an item. |
|
Sets whether the window associated with an item is enabled or not. |
|
Sets the |
|
Sets the data associated to an item. |
|
Sets the second gradient colour for gradient-style selections. |
|
Currently has no effect on |
|
Sets the state image list for |
|
Return |
|
Toggles the item state (collapsed/expanded). |
|
Toggles the item selection. |
|
Used internally to handle radio node parent correctly. |
|
Unselects the current selection. |
|
Unselect all the items. |
__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.
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
.
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;
shown – True
to show the column, False
to hide it;
colour – a valid wx.Colour
, representing the text foreground colour
for the column;
edit – True
to set the column as editable, False
otherwise.
AddColumnInfo
(self, colInfo)¶Appends a column to the HyperTreeList
.
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.
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.
column – an integer specifying the column index.
GetColumnAlignment
(self, column)¶Returns the column text alignment.
column – an integer specifying the column index.
GetColumnColour
(self, column)¶Returns the column text colour.
column – an integer specifying the column index.
GetColumnFont
(self, column)¶Returns the column text font.
column – an integer specifying the column index.
GetColumnImage
(self, column)¶Returns the image assigned to the specified column.
column – an integer specifying the column index.
GetColumnText
(self, column)¶Returns the column text label.
column – an integer specifying the column index.
GetColumnWidth
(self, column)¶Returns the column width, in pixels.
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.
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
.
column – an integer specifying the column index.
HasAGWFlag
(self, flag)¶Returns whether a flag is present in the HyperTreeList
style.
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.
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;
shown – True
to show the column, False
to hide it;
colour – a valid wx.Colour
, representing the text foreground colour
for the column;
edit – True
to set the column as editable, False
otherwise.
InsertColumnInfo
(self, before, colInfo)¶Inserts a column to the HyperTreeList
at the position specified
by before.
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.
column – an integer specifying the column index.
IsColumnShown
(self, column)¶Returns True
if the column is shown, False
otherwise.
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.
item1 – an instance of TreeListItem
;
item2 – another instance of TreeListItem
.
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.
item – an instance of TreeListItem
;
column – an integer specifying the column index.
OnHTLFocus
(self, event)¶Handles the wx.EVT_SET_FOCUS
event for HyperTreeList
.
event – a wx.SizeEvent
event to be processed.
OnSize
(self, event)¶Handles the wx.EVT_SIZE
event for HyperTreeList
.
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.
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
.
column – an integer specifying the column index.
SetAGWWindowStyleFlag
(self, agwStyle)¶Sets the window style for HyperTreeList
.
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
.
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.
buffered – True
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
.
column – an integer specifying the column index;
info – an instance of TreeListColumnInfo
.
SetColumnAlignment
(self, column, flag)¶Sets the column text alignment.
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.
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.
column – an integer specifying the column index;
edit – True
if the column should be editable, False
otherwise.
SetColumnFont
(self, column, font)¶Sets the column text font.
column – an integer specifying the column index;
font – a valid wx.Font
object.
SetColumnImage
(self, column, image)¶Sets an image on the specified column.
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.
column – an integer specifying the column index;
shown – True
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.
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.
column – an integer specifying the column index;
text – the new column label.
SetColumnWidth
(self, column, width)¶Sets the column width, in pixels.
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.
font – a valid wx.Font
object.
SetForegroundColour
(self, colour)¶Changes the foreground colour of HyperTreeList
.
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
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..
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).
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.