AGW Logo

agw_title TreeListHeaderWindow

A window which holds the header of HyperTreeList.

hierarchy Inheritance Diagram

Inheritance diagram for: TreeListHeaderWindow

Inheritance diagram of TreeListHeaderWindow


method_summary Methods Summary

__init__Default class constructor.
AddColumnAppends a column to the TreeListHeaderWindow.
AddColumnInfoAppends a column to the TreeListHeaderWindow.
AdjustDCShifts the wx.DC origin to match the position of the main window horizontal
DrawCurrentDraws the column resize line on a wx.ScreenDC.
GetColumnReturns a column item, an instance of TreeListItem.
GetColumnAlignmentReturns the column text alignment.
GetColumnColourReturns the column text colour.
GetColumnCountReturns the total number of columns.
GetColumnTextReturns the column text label.
GetColumnWidthReturns the column width, in pixels.
GetWidthReturns the total width of all columns.
InsertColumnInserts a column to the TreeListHeaderWindow at the position specified
InsertColumnInfoInserts a column to the TreeListHeaderWindow at the position specified
IsColumnEditableReturns True if the column is editable, False otherwise.
IsColumnShownReturns True if the column is shown, False if it is hidden.
OnMouseHandles the wx.EVT_MOUSE_EVENTS event for TreeListHeaderWindow.
OnPaintHandles the wx.EVT_PAINT event for TreeListHeaderWindow.
OnSetFocusHandles the wx.EVT_SET_FOCUS event for TreeListHeaderWindow.
RefreshColLabelRedraws the column.
RemoveColumnRemoves a column from the TreeListHeaderWindow.
SendListEventSends a wx.ListEvent for the parent window.
SetBufferedSets/unsets the double buffering for the header.
SetColumnSets a column using an instance of TreeListColumnInfo.
SetColumnAlignmentSets the column text alignment.
SetColumnColourSets the column text colour.
SetColumnTextSets the column text label.
SetColumnWidthSets the column width, in pixels.
SetCustomRendererAssociate a custom renderer with the header - all columns will use it :param renderer: a class able to correctly render header buttons ..
XToColReturns the column that corresponds to the logical input x coordinate.

API Class API

class TreeListHeaderWindow(wx.Window)[source]

A window which holds the header of HyperTreeList.



__init__(parent, id=wx.ID_ANY, owner=None, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name="wxtreelistctrlcolumntitles")[source]

Default class constructor.

Parameters:
  • parent – the window parent. Must not be None;
  • id – window identifier. A value of -1 indicates a default value;
  • owner – the window owner, in this case an instance of TreeListMainWindow;
  • 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 window style;
  • name – the window name.


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

Appends a column to the TreeListHeaderWindow.

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(colInfo)[source]

Appends a column to the TreeListHeaderWindow.

Parameters:colInfo – an instance of TreeListColumnInfo.


AdjustDC(dc)[source]

Shifts the wx.DC origin to match the position of the main window horizontal scrollbar: this allows us to always use logical coordinates.

Parameters:dc – an instance of wx.DC.



DrawCurrent()[source]

Draws the column resize line on a wx.ScreenDC.



GetColumn(column)[source]

Returns a column item, an instance of TreeListItem.

Parameters:column – an integer specifying the column index.


GetColumnAlignment(column)[source]

Returns the column text alignment.

Parameters:column – an integer specifying the column index.


GetColumnColour(column)[source]

Returns the column text colour.

Parameters:column – an integer specifying the column index.


GetColumnCount()[source]

Returns the total number of columns.



GetColumnText(column)[source]

Returns the column text label.

Parameters:column – an integer specifying the column index.


GetColumnWidth(column)[source]

Returns the column width, in pixels.

Parameters:column – an integer specifying the column index.


GetWidth()[source]

Returns the total width of all columns.



InsertColumn(before, text, width=_DEFAULT_COL_WIDTH, flag=wx.ALIGN_LEFT, image=-1, shown=True, colour=None, edit=False)[source]

Inserts a column to the TreeListHeaderWindow 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(before, colInfo)[source]

Inserts a column to the TreeListHeaderWindow 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(column)[source]

Returns True if the column is editable, False otherwise.

Parameters:column – an integer specifying the column index.


IsColumnShown(column)[source]

Returns True if the column is shown, False if it is hidden.

Parameters:column – an integer specifying the column index.


OnMouse(event)[source]

Handles the wx.EVT_MOUSE_EVENTS event for TreeListHeaderWindow.

Parameters:event – a wx.MouseEvent event to be processed.


OnPaint(event)[source]

Handles the wx.EVT_PAINT event for TreeListHeaderWindow.

Parameters:event – a wx.PaintEvent event to be processed.


OnSetFocus(event)[source]

Handles the wx.EVT_SET_FOCUS event for TreeListHeaderWindow.

Parameters:event – a wx.FocusEvent event to be processed.


RefreshColLabel(col)[source]

Redraws the column.

Parameters:col – the index of the column to redraw.


RemoveColumn(column)[source]

Removes a column from the TreeListHeaderWindow.

Parameters:column – an integer specifying the column index.


SendListEvent(evtType, pos)[source]

Sends a wx.ListEvent for the parent window.

Parameters:
  • evtType – the event type;
  • pos – an instance of wx.Point.


SetBuffered(buffered)[source]

Sets/unsets the double buffering for the header.

Parameters:bufferedTrue to use double-buffering, False otherwise.

Note

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



SetColumn(column, info)[source]

Sets a column using an instance of TreeListColumnInfo.

Parameters:
  • column – an integer specifying the column index;
  • info – an instance of TreeListColumnInfo.


SetColumnAlignment(column, flag)[source]

Sets the column text alignment.

Parameters:
  • column – an integer specifying the column index;
  • flag – the new text alignment flag.

See also

TreeListColumnInfo.SetAlignment() for a list of valid alignment flags.



SetColumnColour(column, colour)[source]

Sets the column text colour.

Parameters:
  • column – an integer specifying the column index;
  • colour – a valid wx.Colour object.



SetColumnText(column, text)[source]

Sets the column text label.

Parameters:
  • column – an integer specifying the column index;
  • text – the new column label.


SetColumnWidth(column, width)[source]

Sets the column width, in pixels.

Parameters:
  • column – an integer specifying the column index;
  • width – the new width for the column, in pixels.


SetCustomRenderer(renderer=None)[source]

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



XToCol(x)[source]

Returns the column that corresponds to the logical input x coordinate.

Parameters:x – the x position to evaluate.
Returns:The column that corresponds to the logical input x coordinate, or wx.NOT_FOUND if there is no column at the x position.
Tree

Table Of Contents

Previous topic

TreeListColumnInfo

Next topic

TreeListItem