wx.SettableHeaderColumn¶
Adds methods to set the column attributes to wx.HeaderColumn.
This class adds setters for the column attributes defined by wx.HeaderColumn. It is still an abstract base class and needs to be implemented before using it with wx.HeaderCtrl.
Class Hierarchy¶
Known Subclasses¶
wx.dataview.DataViewColumn, wx.HeaderColumnSimple
Methods Summary¶
Set or clear the given flag. |
|
Clear the specified flag for the column. |
|
Set the alignment of the column header. |
|
Set the bitmap to be displayed in the column header. |
|
Set the specified flag for the column. |
|
Set the column flags. |
|
Hide or show the column. |
|
Set the minimal column width. |
|
Allow changing the column order by dragging it. |
|
Call this to enable or disable interactive resizing of the column by the user. |
|
Sets this column as the sort key for the associated control. |
|
Allow clicking the column to sort the control contents by the field in this column. |
|
Set the text to display in the column header. |
|
Set the column width. |
|
Toggle the specified flag for the column. |
|
Inverses the sort order. |
|
Don’t use this column for sorting. |
Properties Summary¶
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
|
See |
Class API¶
- class wx.SettableHeaderColumn(HeaderColumn)¶
Adds methods to set the column attributes to HeaderColumn.
Methods¶
- ChangeFlag(self, flag, set)¶
Set or clear the given flag.
- Parameters:
- Return type:
None
See also
- ClearFlag(self, flag)¶
Clear the specified flag for the column.
- Parameters:
flag (int)
- Return type:
None
See also
- SetAlignment(self, align)¶
Set the alignment of the column header.
- Parameters:
align (Alignment) – The text alignment in horizontal direction only or
wx.ALIGN_NOT
to use the default alignment, The possible values here arewx.ALIGN_CENTRE
,wx.ALIGN_LEFT
orwx.ALIGN_RIGHT
withwx.ALIGN_CENTRE_HORIZONTAL
being also supported as synonym forwx.ALIGN_CENTRE
for consistency (but notice thatGetAlignment
never returns it).- Return type:
None
- SetBitmap(self, bitmap)¶
Set the bitmap to be displayed in the column header.
Notice that the bitmaps displayed in different columns of the same control must all be of the same size.
- Parameters:
bitmap (wx.BitmapBundle)
- Return type:
None
- SetFlag(self, flag)¶
Set the specified flag for the column.
- Parameters:
flag (int)
- Return type:
None
See also
- SetFlags(self, flags)¶
Set the column flags.
This method allows setting all flags at once, see also generic
ChangeFlag
,SetFlag
,ClearFlag
andToggleFlag
methods below as well as specificSetResizeable
,SetSortable
,SetReorderable
andSetHidden
ones.- Parameters:
flags (int) – Combination of
wx.COL_RESIZABLE
,wx.COL_SORTABLE
,wx.COL_REORDERABLE
andwx.COL_HIDDEN
bit flags.- Return type:
None
- SetHidden(self, hidden)¶
Hide or show the column.
By default all columns are shown but some of them can be completely hidden from view by calling this function.
Equivalent to ChangeFlag(wxCOL_HIDDEN, hidden).
- Parameters:
hidden (bool)
- Return type:
None
- SetMinWidth(self, minWidth)¶
Set the minimal column width.
This method can be used with resizable columns (i.e. those for which
wx.COL_RESIZABLE
flag is set inGetFlags
or, alternatively,IsResizeable
returnsTrue
) to prevent the user from making them narrower than the given width.- Parameters:
minWidth (int) – The minimal column width in pixels, may be 0 to remove any previously set restrictions.
- Return type:
None
- SetReorderable(self, reorderable)¶
Allow changing the column order by dragging it.
Equivalent to ChangeFlag(wxCOL_REORDERABLE, reorderable).
- Parameters:
reorderable (bool)
- Return type:
None
- SetResizeable(self, resizable)¶
Call this to enable or disable interactive resizing of the column by the user.
By default, the columns are resizable.
Equivalent to ChangeFlag(wxCOL_RESIZABLE, resizable).
- Parameters:
resizable (bool)
- Return type:
None
- SetSortOrder(self, ascending)¶
Sets this column as the sort key for the associated control.
This function indicates that this column is currently used for sorting the control and also sets the sorting direction. Notice that actual sorting is only done in the control associated with the header, this function doesn’t do any sorting on its own.
Don’t confuse this function with
SetSortable
which should be used to indicate that the column may be used for sorting while this one is used to indicate that it currently is used for sorting. Of course,SetSortOrder
can be only called for sortable columns.- Parameters:
ascending (bool) – If
True
, sort in ascending order, otherwise in descending order.- Return type:
None
- SetSortable(self, sortable)¶
Allow clicking the column to sort the control contents by the field in this column.
By default, the columns are not sortable so you need to explicitly call this function to allow sorting by the field corresponding to this column.
Equivalent to ChangeFlag(wxCOL_SORTABLE, sortable).
- Parameters:
sortable (bool)
- Return type:
None
- SetTitle(self, title)¶
Set the text to display in the column header.
- Parameters:
title (string)
- Return type:
None
- SetWidth(self, width)¶
Set the column width.
- Parameters:
width (int) – The column width in pixels or the special
wx.COL_WIDTH_DEFAULT
(meaning to use default width) orwx.COL_WIDTH_AUTOSIZE
(size to fit the content) value.- Return type:
None
- ToggleFlag(self, flag)¶
Toggle the specified flag for the column.
If the flag is currently set, equivalent to
ClearFlag
, otherwise – toSetFlag
.- Parameters:
flag (int)
- Return type:
None
See also
- ToggleSortOrder(self)¶
Inverses the sort order.
This function is typically called when the user clicks on a column used for sorting to change sort order from ascending to descending or vice versa.
- Return type:
None
See also
- UnsetAsSortKey(self)¶
Don’t use this column for sorting.
This is the reverse of
SetSortOrder
and is called to indicate that this column is not used for sorting any longer.- Return type:
None
Properties¶
- Alignment¶
See
GetAlignment
andSetAlignment
- MinWidth¶
See
GetMinWidth
andSetMinWidth
- Reorderable¶
See
IsReorderable
andSetReorderable
- Resizeable¶
See
IsResizeable
andSetResizeable
- Sortable¶
See
IsSortable
andSetSortable