// Created: 2008-12-01
// RCS-ID: $Id$
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
@c wxHD_ALLOW_REORDER.
@endStyleTable
- @beginEventTable{wxHeaderCtrlEvent}
+ @beginEventEmissionTable{wxHeaderCtrlEvent}
@event{EVT_HEADER_CLICK(id, func)}
A column heading was clicked.
@event{EVT_HEADER_RIGHT_CLICK(id, func)}
@see wxGrid, wxListCtrl, wxDataViewCtrl
*/
-class wxHeaderCtrl
+class wxHeaderCtrl : public wxControl
{
public:
/**
*/
bool ShowCustomizeDialog();
+ /**
+ Returns width needed for given column's title.
+
+ @since 2.9.4
+ */
+ int GetColumnTitleWidth(const wxHeaderColumn& col);
+
protected:
/**
Method to be implemented by the derived classes to return the
The column index, between 0 and the value last passed to
SetColumnCount().
*/
- virtual const wxHeaderColumnBase& GetColumn(unsigned int idx) const = 0;
+ virtual const wxHeaderColumn& GetColumn(unsigned int idx) const = 0;
/**
Method called when the column visibility is changed by the user.
to fit its width on header double click you need to implement this
method using logic similar to this example:
@code
- class MyHeaderCtrl : public wxHeaderColumnBase
+ class MyHeaderColumn : public wxHeaderColumn
{
public:
...
{
public:
protected:
- virtual wxHeaderColumnBase& GetColumn(unsigned int idx) const
+ virtual wxHeaderColumn& GetColumn(unsigned int idx) const
{
return m_cols[idx];
}
@param idx
The column to set the sort indicator for.
+ If @c -1 is given, then the currently shown sort indicator
+ will be removed.
@param sortOrder
If @true or @false show the sort indicator corresponding to
- ascending or descending sort order respectively, if @c -1 remove
- the currently shown sort indicator.
+ ascending or descending sort order respectively.
*/
- void ShowSortIndicator(unsigned int idx, bool ascending = true);
+ void ShowSortIndicator(unsigned int idx, bool sortOrder = true);
/**
- Remove the sort indicator from the given column.
+ Remove the sort indicator from the column being used as sort key.
- This is the same as calling ShowSortIndicator() with @c -1 argument.
-
- @param idx
- The column to remove sort indicator for.
+ @see ShowSortIndicator
*/
void RemoveSortIndicator();
Event class representing the events generated by wxHeaderCtrl.
@library{wxcore}
- @category{ctrl}
+ @category{events}
@see wxHeaderCtrl
*/