HyperTreeList is a class that mimics the behaviour of wx.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.
HyperTreeList is a class that mimics the behaviour of wx.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. |
---|
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 wx.PyControl.
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, wx.Button.GetClassDefaultAttributes() will typically return the values appropriate for a button which will be normally different from those returned by, say, wx.ListCtrl.GetClassDefaultAttributes().
Note
The wx.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. wx.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 wx.EVT_SIZE event for HyperTreeList.
Parameters: | event – a wx.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 wx.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 wx.NullColour to reset to the default colour. |
---|
Note
The background colour is usually painted by the default wx.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.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: |
|
---|
Sets the default font for the header window and the main window.
Parameters: | font – a valid wx.Font object. |
---|
Changes the foreground colour of HyperTreeList.
Parameters: | colour – the colour to be used as the foreground colour, pass wx.NullColour to reset to the default colour. |
---|
Note
Overridden from wx.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 wx.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; |
---|