#include <wx/headercol.h>
Adds methods to set the column attributes to wxHeaderColumn.
This class adds setters for the column attributes defined by wxHeaderColumn. It is still an abstract base class and needs to be implemented before using it with wxHeaderCtrl.
Public Member Functions | |
virtual void | SetTitle (const wxString &title)=0 |
Set the text to display in the column header. | |
virtual void | SetBitmap (const wxBitmap &bitmap)=0 |
Set the bitmap to be displayed in the column header. | |
virtual void | SetWidth (int width)=0 |
Set the column width. | |
virtual void | SetMinWidth (int minWidth)=0 |
Set the minimal column width. | |
virtual void | SetAlignment (wxAlignment align)=0 |
Set the alignment of the column header. | |
virtual void | SetFlags (int flags)=0 |
Set the column flags. | |
void | ChangeFlag (int flag, bool set) |
Set or clear the given flag. | |
void | SetFlag (int flag) |
Set the specified flag for the column. | |
void | ClearFlag (int flag) |
Clear the specified flag for the column. | |
void | ToggleFlag (int flag) |
Toggle the specified flag for the column. | |
virtual void | SetResizeable (bool resizeable) |
Call this to enable or disable interactive resizing of the column by the user. | |
virtual void | SetSortable (bool sortable) |
Allow clicking the column to sort the control contents by the field in this column. | |
virtual void | SetReorderable (bool reorderable) |
Allow changing the column order by dragging it. | |
virtual void | SetHidden (bool hidden) |
Hide or show the column. | |
virtual void | SetAsSortKey (bool sort=true)=0 |
Sets this column as the sort key for the associated control. | |
void | UnsetAsSortKey () |
Don't use this column for sorting. | |
virtual void | SetSortOrder (bool ascending)=0 |
Sets the sort order for this column. | |
void | ToggleSortOrder () |
Inverses the sort order. |
void wxSettableHeaderColumn::ChangeFlag | ( | int | flag, | |
bool | set | |||
) |
Set or clear the given flag.
flag | The flag to set or clear. | |
set | If true, set the flag, i.e. equivalent to calling SetFlag(), otherwise clear it, as ClearFlag(). |
void wxSettableHeaderColumn::ClearFlag | ( | int | flag | ) |
Clear the specified flag for the column.
virtual void wxSettableHeaderColumn::SetAlignment | ( | wxAlignment | align | ) | [pure virtual] |
Set the alignment of the column header.
align | The text alignment in horizontal direction only or wxALIGN_NOT to use the default alignment, The possible values here are wxALIGN_CENTRE, wxALIGN_LEFT or wxALIGN_RIGHT with wxALIGN_CENTRE_HORIZONTAL being also supported as synonym for wxALIGN_CENTRE for consistency (but notice that GetAlignment() never returns it). |
virtual void wxSettableHeaderColumn::SetAsSortKey | ( | bool | sort = true |
) | [pure virtual] |
Sets this column as the sort key for the associated control.
Calling this function with true argument means that this column is currently used for sorting the control contents and so should typically display an arrow indicating it (the direction of the arrow depends on IsSortOrderAscending() return value).
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, SetAsSortKey() can be only called for sortable columns.
sort | Sort (default) or don't sort the control contents by this column. |
virtual void wxSettableHeaderColumn::SetBitmap | ( | const wxBitmap & | bitmap | ) | [pure virtual] |
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.
void wxSettableHeaderColumn::SetFlag | ( | int | flag | ) |
Set the specified flag for the column.
virtual void wxSettableHeaderColumn::SetFlags | ( | int | flags | ) | [pure virtual] |
Set the column flags.
This method allows to set all flags at once, see also generic ChangeFlag(), SetFlag(), ClearFlag() and ToggleFlag() methods below as well as specific SetResizeable(), SetSortable(), SetReorderable() and SetHidden() ones.
flags | Combination of wxCOL_RESIZABLE, wxCOL_SORTABLE, wxCOL_REORDERABLE and wxCOL_HIDDEN bit flags. |
virtual void wxSettableHeaderColumn::SetHidden | ( | bool | hidden | ) | [virtual] |
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).
virtual void wxSettableHeaderColumn::SetMinWidth | ( | int | minWidth | ) | [pure virtual] |
Set the minimal column width.
This method can be used with resizeable columns (i.e. those for which wxCOL_RESIZABLE flag is set in GetFlags() or, alternatively, IsResizeable() returns true) to prevent the user from making them narrower than the given width.
minWidth | The minimal column width in pixels, may be 0 to remove any previously set restrictions. |
virtual void wxSettableHeaderColumn::SetReorderable | ( | bool | reorderable | ) | [virtual] |
Allow changing the column order by dragging it.
Equivalent to ChangeFlag(wxCOL_REORDERABLE, reorderable).
virtual void wxSettableHeaderColumn::SetResizeable | ( | bool | resizeable | ) | [virtual] |
Call this to enable or disable interactive resizing of the column by the user.
By default, the columns are resizeable.
Equivalent to ChangeFlag(wxCOL_RESIZABLE, resizeable).
virtual void wxSettableHeaderColumn::SetSortable | ( | bool | sortable | ) | [virtual] |
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).
virtual void wxSettableHeaderColumn::SetSortOrder | ( | bool | ascending | ) | [pure virtual] |
Sets the sort order for this column.
This only makes sense for sortable columns which are currently used as sort key, i.e. for which IsSortKey() returns true and is only taken into account by the control in which this column is inserted, this function just stores the sort order in the wxHeaderColumn object.
ascending | If true, sort in ascending order, otherwise in descending order. |
virtual void wxSettableHeaderColumn::SetTitle | ( | const wxString & | title | ) | [pure virtual] |
Set the text to display in the column header.
virtual void wxSettableHeaderColumn::SetWidth | ( | int | width | ) | [pure virtual] |
Set the column width.
width | The column width in pixels or the special wxCOL_WIDTH_DEFAULT value meaning to use default width. |
void wxSettableHeaderColumn::ToggleFlag | ( | int | flag | ) |
Toggle the specified flag for the column.
If the flag is currently set, equivalent to ClearFlag(), otherwise -- to SetFlag().
void wxSettableHeaderColumn::ToggleSortOrder | ( | ) |
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.
void wxSettableHeaderColumn::UnsetAsSortKey | ( | ) |
Don't use this column for sorting.
This is equivalent to calling SetAsSortKey() with false argument.
![]() |
[ top ] |