HyperTreeList is a class that mimics the behaviour of gizmos.TreeListCtrl, with almost the same base functionalities plus some more enhancements. This class does not rely on the native control, as it is a full owner-drawn tree-list control.
__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. |
GetAGWWindowStyleFlag | Returns the HyperTreeList window style flag. |
GetClassDefaultAttributes | Returns the default font and colours which are used by the control. This is |
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 whether 2 items have the same text. |
OnGetItemText | This function must be overloaded in the derived class for a control |
OnSize | Handles the 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. |
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. |
HyperTreeList is a class that mimics the behaviour of gizmos.TreeListCtrl, with almost the same base functionalities plus some more enhancements. This class does not rely on the native control, as it is a full owner-drawn tree-list control.
Default class constructor.
Parameters: |
|
---|
Appends a column to the HyperTreeList.
Parameters: |
|
---|
Appends a column to the HyperTreeList.
Parameters: | colInfo – an instance of TreeListColumnInfo. |
---|
Calculates the best header height and stores it.
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: |
|
---|
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 PyControl.
Layouts the header control.
Returns the HyperTreeList window style flag.
See also
SetAGWWindowStyleFlag for a list of valid window styles.
Returns the default font and colours which are used by the control. This is useful if you want to use the same font or colour in your own control as in a standard control – which is a much better idea than hard coding specific colours or fonts which might look completely out of place on the users system, especially if it uses themes.
This static method is “overridden’’ in many derived classes and so calling, for example, Button.GetClassDefaultAttributes () will typically return the values appropriate for a button which will be normally different from those returned by, say, ListCtrl.GetClassDefaultAttributes ().
Note
The VisualAttributes structure has at least the fields font, colFg and colBg. All of them may be invalid if it was not possible to determine the default control appearance or, especially for the background colour, if the field doesn’t make sense as is the case for colBg for the controls with themed background.
Returns an instance of TreeListColumnInfo containing column information.
Parameters: | column – an integer specifying the column index. |
---|
Returns the column text alignment.
Parameters: | column – an integer specifying the column index. |
---|
Returns the column text colour.
Parameters: | column – an integer specifying the column index. |
---|
Returns the column text font.
Parameters: | column – an integer specifying the column index. |
---|
Returns the image assigned to the specified column.
Parameters: | column – an integer specifying the column index. |
---|
Returns the column text label.
Parameters: | column – an integer specifying the column index. |
---|
Returns the column width, in pixels.
Parameters: | column – an integer specifying the column index. |
---|
Returns the header window, an instance of TreeListHeaderWindow.
Returns the main window, an instance of TreeListMainWindow.
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. |
---|
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. TE_MULTILINE .
Parameters: | column – an integer specifying the column index. |
---|
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.
Inserts a column to the HyperTreeList at the position specified by before.
Parameters: |
|
---|
Inserts a column to the HyperTreeList at the position specified by before.
Parameters: |
|
---|
Returns True if the column is editable, False otherwise.
Parameters: | column – an integer specifying the column index. |
---|
Returns True if the column is shown, False otherwise.
Parameters: | column – an integer specifying the column index. |
---|
Returns whether 2 items have the same text.
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.
This function must be overloaded in the derived class for a control with TR_VIRTUAL style. It should return the string containing the text of the given column for the specified item.
Parameters: |
|
---|
Handles the EVT_SIZE event for HyperTreeList.
Parameters: | event – a SizeEvent event to be processed. |
---|
Causes this window, and all of its children recursively (except under wxGTK1 where this is not implemented), to be repainted.
Parameters: |
|
---|
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 PyControl.
Removes a column from the HyperTreeList.
Parameters: | column – an integer specifying the column index. |
---|
Sets the window style for HyperTreeList.
Parameters: | agwStyle – can be a combination of the following bits:
|
---|
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.
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 Window.ClearBackground or Window.Refresh after calling this function.
Note
Overridden from PyControl.
Sets/unsets the double buffering for the header and the main window.
Parameters: | buffered – True to use double-buffering, False otherwise. |
---|
Note
Currently we are using double-buffering only on Windows XP.
Sets a column using an instance of TreeListColumnInfo.
Parameters: |
|
---|
Sets the column text alignment.
Parameters: |
|
---|
Sets the column text colour.
Parameters: |
|
---|
Sets the column as editable or non-editable.
Parameters: |
|
---|
Sets the column text font.
Parameters: |
|
---|
Sets an image on the specified column.
Parameters: |
|
---|
Sets the column as shown or hidden.
Parameters: |
|
---|
Sets the column text label.
Parameters: |
|
---|
Sets the column width, in pixels.
Parameters: |
|
---|
This sets the window to receive keyboard input.
Sets the default font for the header window and the main window.
Parameters: | font – a valid Font object. |
---|
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 PyControl.
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
Sets the default font for the header window..
Parameters: | font – a valid Font object. |
---|
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; |
---|