wx.lib.agw.hypertreelist.TreeListItem¶This class holds all the information and methods for every single item in
HyperTreeList.
Note
Subclassed from GenericTreeItem.
Class Hierarchy¶
Inheritance diagram for class TreeListItem:
Known Superclasses¶wx.lib.agw.customtreectrl.GenericTreeItem
Methods Summary¶Default class constructor. |
|
Deletes the item children. |
|
Deletes the window associated to the item (if any). |
|
Returns the associated background colour |
|
Returns the current item image. |
|
Calculate text extents of this item using the given ClientDc. |
|
Returns the item image for a particular item state. |
|
Returns the item text label. |
|
Returns the x position of the item text. |
|
Returns the window associated to the item. |
|
Returns whether the window associated with an item is enabled or not. |
|
Returns a list of all associated windows. May be empty list. |
|
Returns the associated window size. |
|
Returns whether the text extents are calculated for this item. |
|
HitTest method for an item. Called from the main window HitTest. |
|
Handles the |
|
Sets the associated background colour |
|
Sets the item image for a particular item state. |
|
Sets the item text label. |
|
Sets the x position of the item text. Used internally to position |
|
Sets the window associated to the item. Internal use only. |
|
Sets whether the window associated with an item is enabled or not. |
Class API¶This class holds all the information and methods for every single item in
HyperTreeList.
Note
Subclassed from GenericTreeItem.
Default class constructor. For internal use: do not call it in your code!
mainWin – the main HyperTreeList window, in this case an instance
of TreeListMainWindow;
parent – the tree item parent (may be None for root items);
text – the tree item text;
ct_type – the tree item kind. May be one of the following integers:
ct_type Value |
Description |
|---|---|
0 |
A normal item |
1 |
A checkbox-like item |
2 |
A radiobutton-type item |
wnd – if not None, a non-toplevel window to be displayed next to
the item;
image – an index within the normal image list specifying the image to use for the item in unselected state;
selImage – an index within the normal image list specifying the image to use for the item in selected state; if image > -1 and selImage is -1, the same image is used for both selected and unselected items;
data – associate the given Python object data with the item.
Note
Regarding radiobutton-type items (with ct_type = 2), the following approach is used:
All peer-nodes that are radiobuttons will be mutually exclusive. In other words, only one of a set of radiobuttons that share a common parent can be checked at once. If a radiobutton node becomes checked, then all of its peer radiobuttons must be unchecked.
If a radiobutton node becomes unchecked, then all of its child nodes will become inactive.
Deletes the item children.
tree – the main TreeListMainWindow instance.
Deletes the window associated to the item (if any).
column – if not None, an integer specifying the column index.
If it is None, the main column index is used.
Returns the associated background colour
:param column an integer specifying the column index.
Returns the current item image.
column – if not None, an integer specifying the column index.
If it is None, the main column index is used.
Calculate text extents of this item using the given ClientDc.
dc – an instance of wx.DC to use to calculate
text extent if it has not been cached yet. The proper font
should have been already set in the device context.
column – The column to get extents for. If it is None,
return the width of the main column and maximum height of all
the columns (dc is required in this case).
A 2-tuple of (width, height). If dc was not provided could return None.
Returns the item image for a particular item state.
which – can be one of the following bits:
Item State |
Description |
|---|---|
|
To get the normal item image |
|
To get the selected item image (i.e. the image which is shown when the item is currently selected) |
|
To get the expanded image (this only makes sense for items which have children - then this image is shown when the item is expanded and the normal image is shown when it is collapsed) |
|
To get the selected expanded image (which is shown when an expanded item is currently selected) |
column – if not None, an integer specifying the column index.
If it is None, the main column index is used.
An integer index that can be used to retrieve the item
image inside a wx.ImageList.
Returns the item text label.
column – if not None, an integer specifying the column index.
If it is None, the main column index is used.
Returns the x position of the item text.
Returns the window associated to the item.
column – if not None, an integer specifying the column index.
If it is None, the main column index is used.
Returns whether the window associated with an item is enabled or not.
column – if not None, an integer specifying the column index.
If it is None, the main column index is used.
Returns a list of all associated windows. May be empty list.
Returns the associated window size.
column – if not None, an integer specifying the column index.
If it is None, the main column index is used.
Returns whether the text extents are calculated for this item.
column – The column to check for extents. If it is None,
check that all columns have extents.
True if extents are calculated, False otherwise.
HitTest method for an item. Called from the main window HitTest.
point – the point to test for the hit (an instance of wx.Point);
theCtrl – the main TreeListMainWindow tree;
flags – a bitlist of hit locations;
column – an integer specifying the column index;
level – the item’s level inside the tree hierarchy.
See also
TreeListMainWindow.HitTest() method for the flags explanation.
A 3-tuple of (item, flags, column). The item may be None.
Handles the wx.EVT_SET_FOCUS event for a window associated to an item.
event – a FocusEvent event to be processed.
Sets the associated background colour
colour – a valid wx.Colour instance.
:param integer column
Sets the item image for a particular item state.
column – if not None, an integer specifying the column index.
If it is None, the main column index is used;
image – an index within the normal image list specifying the image to use;
which – The item state for which this image applies. One of wx.TreeItemIcon_Xxx. Only valid for the main column.
See also
GetImage for a list of valid item states.
Note
Call SetItemImage instead to refresh the tree properly.
Sets the item text label.
column – if not None, an integer specifying the column index.
If it is None, the main column index is used;
text – a string specifying the new item label.
Note
Call SetItemText instead to refresh the tree properly.
Sets the x position of the item text. Used internally to position text according to column alignment.
text_x – the x position of the item text.
Sets the window associated to the item. Internal use only.
wnd – a non-toplevel window to be displayed next to the item;
column – if not None, an integer specifying the column index.
If it is None, the main column index is used.
Note
Always use SetItemWindow instead to update the tree properly.
Sets whether the window associated with an item is enabled or not.
enable – True to enable the associated window, False to disable it;
column – if not None, an integer specifying the column index.
If it is None, the main column index is used.