Represents a column header in controls displaying tabular data such as wx.dataview.DataViewCtrl or wx.grid.Grid.
Notice that this is an abstract base class which is implemented (usually using the information stored in the associated control) by the different controls using wx.HeaderCtrl. As the control only needs to retrieve the information about the column, this class defines only the methods for accessing the various column properties but not for changing them as the setters might not be needed at all, e.g. if the column attributes can only be changed via the methods of the main associated control (this is the case for wx.grid.Grid for example). If you do want to allow changing them directly using the column itself, you should inherit from wx.SettableHeaderColumn instead of this class.
Finally, if you don’t already store the column information at all anywhere, you should use the concrete wx.HeaderColumnSimple class and wx.HeaderCtrlSimple.
Returns the current column alignment. |
|
This function exists only for backwards compatibility, it’s recommended to override |
|
Returns the bitmap in the header of the column, if any. |
|
Get the column flags. |
|
Return the minimal column width. |
|
Get the text shown in the column header. |
|
Returns the current width of the column. |
|
Return |
|
Returns |
|
Returns |
|
Return |
|
Returns |
|
Returns |
|
Returns |
|
Returns |
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
wx.
HeaderColumn
(object)¶Represents a column header in controls displaying tabular data such as DataViewCtrl or Grid.
GetAlignment
(self)¶Returns the current column alignment.
One of wx.ALIGN_CENTRE
, wx.ALIGN_LEFT
or wx.ALIGN_RIGHT
.
GetBitmap
(self)¶This function exists only for backwards compatibility, it’s recommended to override GetBitmapBundle
in the new code and override this one to do nothing, as it will never be called if GetBitmapBundle
is overridden.
GetBitmapBundle
(self)¶Returns the bitmap in the header of the column, if any.
If the column has no associated bitmap, empty wx.BitmapBundle should be returned.
Override this function to return the bundle containing the bitmap to show in the column header. By default delegates to GetBitmap
but should be overridden if the bitmaps are used.
New in version 4.1/wxWidgets-3.1.6.
GetFlags
(self)¶Get the column flags.
This method retrieves all the flags at once, you can also use HasFlag
to test for any individual flag or IsResizeable
, IsSortable
, IsReorderable
and IsHidden
to test for particular flags.
int
GetMinWidth
(self)¶Return the minimal column width.
int
The minimal width such that the user can’t resize the column to lesser size (notice that it is still possible to set the column width to smaller value from the program code). Return 0 from here to allow resizing the column to arbitrarily small size.
GetTitle
(self)¶Get the text shown in the column header.
string
GetWidth
(self)¶Returns the current width of the column.
int
Width of the column in pixels, never wx.COL_WIDTH_DEFAULT
or wx.COL_WIDTH_AUTOSIZE
.
HasFlag
(self, flag)¶Return True
if the specified flag is currently set for this column.
flag (int) –
bool
IsHidden
(self)¶Returns True
if the column is currently hidden.
This corresponds to wx.COL_HIDDEN
flag which is off by default.
bool
IsReorderable
(self)¶Returns True
if the column can be dragged by user to change its order.
This corresponds to wx.COL_REORDERABLE
flag which is on by default.
bool
IsResizeable
(self)¶Return True
if the column can be resized by the user.
Equivalent to HasFlag(wxCOL_RESIZABLE).
bool
IsShown
(self)¶Returns True
if the column is currently shown.
This corresponds to the absence of wx.COL_HIDDEN
flag.
bool
IsSortKey
(self)¶Returns True
if the column is currently used for sorting.
bool
IsSortOrderAscending
(self)¶Returns True
, if the sort order is ascending.
Notice that it only makes sense to call this function if the column is used for sorting at all, i.e. if IsSortKey
returns True
.
bool
IsSortable
(self)¶Returns True
if the column can be clicked by user to sort the control contents by the field in this column.
This corresponds to wx.COL_SORTABLE
flag which is off by default.
bool
Alignment
¶See GetAlignment
BitmapBundle
¶See GetBitmapBundle
MinWidth
¶See GetMinWidth
Reorderable
¶See IsReorderable
Resizeable
¶See IsResizeable
SortOrderAscending
¶Sortable
¶See IsSortable