.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. _wx.HeaderCtrlSimple: ========================================================================================================================================== |phoenix_title| **wx.HeaderCtrlSimple** ========================================================================================================================================== :ref:`wx.HeaderCtrlSimple` is a concrete header control which can be used directly, without inheriting from it as you need to do when using :ref:`wx.HeaderCtrl` itself. When using it, you need to use simple :meth:`~wx.HeaderCtrlSimple.AppendColumn`, :meth:`~wx.HeaderCtrlSimple.InsertColumn` and :meth:`~wx.HeaderCtrlSimple.DeleteColumn` methods instead of setting the number of columns with :meth:`~wx.HeaderCtrl.SetColumnCount` and returning the information about them from the overridden :meth:`~wx.HeaderCtrl.GetColumn` .. seealso:: :ref:`wx.HeaderCtrl` | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class HeaderCtrlSimple:
| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.HeaderCtrlSimple.__init__` Default constructor not creating the underlying window. :meth:`~wx.HeaderCtrlSimple.AppendColumn` Append the column to the end of the control. :meth:`~wx.HeaderCtrlSimple.DeleteColumn` Delete the column at the given position. :meth:`~wx.HeaderCtrlSimple.GetBestFittingWidth` This function can be overridden in the classes deriving from this control instead of overriding :meth:`~HeaderCtrlSimple.UpdateColumnWidthToFit` . :meth:`~wx.HeaderCtrlSimple.GetClassDefaultAttributes` :meth:`~wx.HeaderCtrlSimple.HideColumn` Hide the column with the given index. :meth:`~wx.HeaderCtrlSimple.InsertColumn` Insert the column at the given position. :meth:`~wx.HeaderCtrlSimple.RemoveSortIndicator` Remove the sort indicator from the column being used as sort key. :meth:`~wx.HeaderCtrlSimple.ShowColumn` Show or hide the column. :meth:`~wx.HeaderCtrlSimple.ShowSortIndicator` Update the column sort indicator. ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.HeaderCtrlSimple(HeaderCtrl) **Possible constructors**:: HeaderCtrlSimple() HeaderCtrlSimple(parent, winid=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=HD_DEFAULT_STYLE, name=HeaderCtrlNameStr) HeaderCtrlSimple is a concrete header control which can be used directly, without inheriting from it as you need to do when using HeaderCtrl itself. .. method:: __init__(self, *args, **kw) |overload| Overloaded Implementations: :html:`

` **__init__** `(self)` Default constructor not creating the underlying window. You must use :meth:`~wx.HeaderCtrl.Create` after creating the object using this constructor. :html:`

` **__init__** `(self, parent, winid=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=HD_DEFAULT_STYLE, name=HeaderCtrlNameStr)` Constructor creating the window. Please see the base class :meth:`wx.HeaderCtrl.Create` method for the parameters description. :param `parent`: :type `parent`: wx.Window :param `winid`: :type `winid`: wx.WindowID :param `pos`: :type `pos`: wx.Point :param `size`: :type `size`: wx.Size :param `style`: :type `style`: long :param `name`: :type `name`: string :html:`

` .. method:: AppendColumn(self, col) Append the column to the end of the control. :param `col`: :type `col`: wx.HeaderColumnSimple .. seealso:: :meth:`InsertColumn` .. method:: DeleteColumn(self, idx) Delete the column at the given position. :param `idx`: :type `idx`: int .. seealso:: :meth:`InsertColumn` , :meth:`AppendColumn` .. method:: GetBestFittingWidth(self, idx) This function can be overridden in the classes deriving from this control instead of overriding :meth:`~wx.HeaderCtrl.UpdateColumnWidthToFit` . To implement automatic column resizing to fit its contents width when the column divider is double clicked, you need to simply return the fitting width for the given column `idx` from this method, the control will automatically use the biggest value between the one returned from here and the one needed for the display of the column title itself. The base class version returns -1 indicating that this function is not implemented. :param `idx`: :type `idx`: int :rtype: `int` .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) :param `variant`: :type `variant`: wx.WindowVariant :rtype: :ref:`wx.VisualAttributes` .. method:: HideColumn(self, idx) Hide the column with the given index. This is the same as calling:: self.ShowColumn(idx, False) :param `idx`: The index of the column to show or hide, from 0 to :meth:`~wx.HeaderCtrl.GetColumnCount` . :type `idx`: int .. method:: InsertColumn(self, col, idx) Insert the column at the given position. :param `col`: The column to insert. Notice that because of the existence of implicit conversion from `String` to :ref:`wx.HeaderColumn` a string can be passed directly here. :type `col`: wx.HeaderColumnSimple :param `idx`: The position of the new column, from 0 to :meth:`~wx.HeaderCtrl.GetColumnCount` . Using :meth:`~wx.HeaderCtrl.GetColumnCount` means to append the column to the end. :type `idx`: int .. seealso:: :meth:`AppendColumn` .. method:: RemoveSortIndicator(self) Remove the sort indicator from the column being used as sort key. .. seealso:: :meth:`ShowSortIndicator` .. method:: ShowColumn(self, idx, show=True) Show or hide the column. Initially the column is shown by default or hidden if it was added with ``wx.COL_HIDDEN`` flag set. When a column is hidden, it doesn't appear at all on the screen but its index is still taken into account when working with other columns. E.g. if there are three columns 0, 1 and 2 and the column 1 is hidden you still need to use index 2 to refer to the last visible column. :param `idx`: The index of the column to show or hide, from 0 to :meth:`~wx.HeaderCtrl.GetColumnCount` . :type `idx`: int :param `show`: Indicates whether the column should be shown (default) or hidden. :type `show`: bool .. method:: ShowSortIndicator(self, idx, sortOrder=True) Update the column sort indicator. The sort indicator, if shown, is typically an arrow pointing upwards or downwards depending on whether the control contents is sorted in ascending or descending order. :param `idx`: The column to set the sort indicator for. If ``-1`` is given, then the currently shown sort indicator will be removed. :type `idx`: int :param `sortOrder`: If ``True`` or ``False`` show the sort indicator corresponding to ascending or descending sort order respectively. :type `sortOrder`: bool