.. wxPython Phoenix documentation
This file was generated by Phoenix's sphinx generator and associated
tools, do not edit by hand.
Copyright: (c) 2011-2017 by Total Control Software
License: wxWindows License
.. include:: headings.inc
.. currentmodule:: wx.lib.agw.hypertreelist
.. highlight:: python
.. _wx.lib.agw.hypertreelist.TreeListHeaderWindow:
==========================================================================================================================================
|phoenix_title| **wx.lib.agw.hypertreelist.TreeListHeaderWindow**
==========================================================================================================================================
A window which holds the header of :class:`HyperTreeList`.
|
|class_hierarchy| Class Hierarchy
=================================
.. raw:: html
Inheritance diagram for class
TreeListHeaderWindow:
|
|super_classes| Known Superclasses
==================================
:class:`wx.Window`
|
|method_summary| Methods Summary
================================
================================================================================ ================================================================================
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.__init__` Default class constructor.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.AddColumn` Appends a column to the :class:`TreeListHeaderWindow`.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.AddColumnInfo` Appends a column to the :class:`TreeListHeaderWindow`.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.AdjustDC` Shifts the :class:`wx.DC` origin to match the position of the main window horizontal
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.DrawCurrent` Draws the column resize line on a :class:`ScreenDC`.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.GetColumn` Returns a column item, an instance of :class:`TreeListItem`.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.GetColumnAlignment` Returns the column text alignment.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.GetColumnColour` Returns the column text colour.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.GetColumnCount` Returns the total number of columns.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.GetColumnText` Returns the column text label.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.GetColumnWidth` Returns the column width, in pixels.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.GetWidth` Returns the total width of all columns.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.InsertColumn` Inserts a column to the :class:`TreeListHeaderWindow` at the position specified
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.InsertColumnInfo` Inserts a column to the :class:`TreeListHeaderWindow` at the position specified
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.IsColumnEditable` Returns ``True`` if the column is editable, ``False`` otherwise.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.IsColumnShown` Returns ``True`` if the column is shown, ``False`` if it is hidden.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.OnMouse` Handles the ``wx.EVT_MOUSE_EVENTS`` event for :class:`TreeListHeaderWindow`.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.OnPaint` Handles the ``wx.EVT_PAINT`` event for :class:`TreeListHeaderWindow`.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.OnSetFocus` Handles the ``wx.EVT_SET_FOCUS`` event for :class:`TreeListHeaderWindow`.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.RefreshColLabel` Redraws the column.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.RemoveColumn` Removes a column from the :class:`TreeListHeaderWindow`.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.SendListEvent` Sends a :class:`ListEvent` for the parent window.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.SetBuffered` Sets/unsets the double buffering for the header.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.SetColumn` Sets a column using an instance of :class:`TreeListColumnInfo`.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.SetColumnAlignment` Sets the column text alignment.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.SetColumnColour` Sets the column text colour.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.SetColumnText` Sets the column text label.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.SetColumnWidth` Sets the column width, in pixels.
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.SetCustomRenderer` Associate a custom renderer with the header - all columns will use it
:meth:`~wx.lib.agw.hypertreelist.TreeListHeaderWindow.XToCol` Returns the column that corresponds to the logical input `x` coordinate.
================================================================================ ================================================================================
|
|api| Class API
===============
.. class:: TreeListHeaderWindow(wx.Window)
A window which holds the header of :class:`HyperTreeList`.
.. method:: __init__(self, parent, id=wx.ID_ANY, owner=None, pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, name="wxtreelistctrlcolumntitles")
Default class constructor.
:param `parent`: the window parent. Must not be ``None``;
:param `id`: window identifier. A value of -1 indicates a default value;
:param `owner`: the window owner, in this case an instance of :class:`TreeListMainWindow`;
:param `pos`: the control position. A value of (-1, -1) indicates a default position,
chosen by either the windowing system or wxPython, depending on platform;
:param `size`: the control size. A value of (-1, -1) indicates a default size,
chosen by either the windowing system or wxPython, depending on platform;
:param `style`: the window style;
:param `name`: the window name.
.. method:: AddColumn(self, text, width=_DEFAULT_COL_WIDTH, flag=wx.ALIGN_LEFT, image=-1, shown=True, colour=None, edit=False)
Appends a column to the :class:`TreeListHeaderWindow`.
:param `text`: the column text label;
:param `width`: the column width in pixels;
:param `flag`: the column alignment flag, one of ``wx.ALIGN_LEFT``,
``wx.ALIGN_RIGHT``, ``wx.ALIGN_CENTER``;
:param `image`: an index within the normal image list assigned to
:class:`HyperTreeList` specifying the image to use for the column;
:param `shown`: ``True`` to show the column, ``False`` to hide it;
:param `colour`: a valid :class:`wx.Colour`, representing the text foreground colour
for the column;
:param `edit`: ``True`` to set the column as editable, ``False`` otherwise.
.. method:: AddColumnInfo(self, colInfo)
Appends a column to the :class:`TreeListHeaderWindow`.
:param `colInfo`: an instance of :class:`TreeListColumnInfo`.
.. method:: AdjustDC(self, dc)
Shifts the :class:`wx.DC` origin to match the position of the main window horizontal
scrollbar: this allows us to always use logical coordinates.
:param `dc`: an instance of :class:`wx.DC`.
.. method:: DrawCurrent(self)
Draws the column resize line on a :class:`ScreenDC`.
.. method:: GetColumn(self, column)
Returns a column item, an instance of :class:`TreeListItem`.
:param `column`: an integer specifying the column index.
.. method:: GetColumnAlignment(self, column)
Returns the column text alignment.
:param `column`: an integer specifying the column index.
.. method:: GetColumnColour(self, column)
Returns the column text colour.
:param `column`: an integer specifying the column index.
.. method:: GetColumnCount(self)
Returns the total number of columns.
.. method:: GetColumnText(self, column)
Returns the column text label.
:param `column`: an integer specifying the column index.
.. method:: GetColumnWidth(self, column)
Returns the column width, in pixels.
:param `column`: an integer specifying the column index.
.. method:: GetWidth(self)
Returns the total width of all columns.
.. method:: 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 :class:`TreeListHeaderWindow` at the position specified
by `before`.
:param `before`: the index at which we wish to insert the new column;
:param `text`: the column text label;
:param `width`: the column width in pixels;
:param `flag`: the column alignment flag, one of ``wx.ALIGN_LEFT``,
``wx.ALIGN_RIGHT``, ``wx.ALIGN_CENTER``;
:param `image`: an index within the normal image list assigned to
:class:`HyperTreeList` specifying the image to use for the column;
:param `shown`: ``True`` to show the column, ``False`` to hide it;
:param `colour`: a valid :class:`wx.Colour`, representing the text foreground colour
for the column;
:param `edit`: ``True`` to set the column as editable, ``False`` otherwise.
.. method:: InsertColumnInfo(self, before, colInfo)
Inserts a column to the :class:`TreeListHeaderWindow` at the position specified
by `before`.
:param `before`: the index at which we wish to insert the new column;
:param `colInfo`: an instance of :class:`TreeListColumnInfo`.
.. method:: IsColumnEditable(self, column)
Returns ``True`` if the column is editable, ``False`` otherwise.
:param `column`: an integer specifying the column index.
.. method:: IsColumnShown(self, column)
Returns ``True`` if the column is shown, ``False`` if it is hidden.
:param `column`: an integer specifying the column index.
.. method:: OnMouse(self, event)
Handles the ``wx.EVT_MOUSE_EVENTS`` event for :class:`TreeListHeaderWindow`.
:param `event`: a :class:`MouseEvent` event to be processed.
.. method:: OnPaint(self, event)
Handles the ``wx.EVT_PAINT`` event for :class:`TreeListHeaderWindow`.
:param `event`: a :class:`PaintEvent` event to be processed.
.. method:: OnSetFocus(self, event)
Handles the ``wx.EVT_SET_FOCUS`` event for :class:`TreeListHeaderWindow`.
:param `event`: a :class:`FocusEvent` event to be processed.
.. method:: RefreshColLabel(self, col)
Redraws the column.
:param `col`: the index of the column to redraw.
.. method:: RemoveColumn(self, column)
Removes a column from the :class:`TreeListHeaderWindow`.
:param `column`: an integer specifying the column index.
.. method:: SendListEvent(self, evtType, pos)
Sends a :class:`ListEvent` for the parent window.
:param `evtType`: the event type;
:param `pos`: an instance of :class:`wx.Point`.
.. method:: SetBuffered(self, buffered)
Sets/unsets the double buffering for the header.
:param `buffered`: ``True`` to use double-buffering, ``False`` otherwise.
.. note:: Currently we are using double-buffering only on Windows XP.
.. method:: SetColumn(self, column, info)
Sets a column using an instance of :class:`TreeListColumnInfo`.
:param `column`: an integer specifying the column index;
:param `info`: an instance of :class:`TreeListColumnInfo`.
.. method:: SetColumnAlignment(self, column, flag)
Sets the column text alignment.
:param `column`: an integer specifying the column index;
:param `flag`: the new text alignment flag.
.. seealso:: :meth:`TreeListColumnInfo.SetAlignment() ` for a list of valid alignment
flags.
.. method:: SetColumnColour(self, column, colour)
Sets the column text colour.
:param `column`: an integer specifying the column index;
:param `colour`: a valid :class:`wx.Colour` object.
.. method:: SetColumnText(self, column, text)
Sets the column text label.
:param `column`: an integer specifying the column index;
:param `text`: the new column label.
.. method:: SetColumnWidth(self, column, width)
Sets the column width, in pixels.
:param `column`: an integer specifying the column index;
:param `width`: the new width for the column, in pixels.
.. method:: SetCustomRenderer(self, renderer=None)
Associate a custom renderer with the header - all columns will use it
:param `renderer`: a class able to correctly render header buttons
.. note:: the renderer class **must** implement the method `DrawHeaderButton`
.. method:: XToCol(self, x)
Returns the column that corresponds to the logical input `x` coordinate.
:param `x`: the `x` position to evaluate.
:return: The column that corresponds to the logical input `x` coordinate,
or ``wx.NOT_FOUND`` if there is no column at the `x` position.