provide Do[GS]etColumnsOrder() stubs for the generic wxHeaderCtrl

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57234 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-12-10 16:09:58 +00:00
parent 565804f2b9
commit 20db5469a0
2 changed files with 23 additions and 0 deletions

View File

@@ -56,6 +56,9 @@ private:
virtual void DoScrollHorz(int dx); virtual void DoScrollHorz(int dx);
virtual void DoSetColumnsOrder(const wxArrayInt& order);
virtual wxArrayInt DoGetColumnsOrder() const;
// override wxWindow methods which must be implemented by a new control // override wxWindow methods which must be implemented by a new control
virtual wxSize DoGetBestSize() const; virtual wxSize DoGetBestSize() const;
@@ -129,6 +132,10 @@ private:
// the overlay display used during the dragging operations // the overlay display used during the dragging operations
wxOverlay m_overlay; wxOverlay m_overlay;
// the indices of the column appearing at the given position on the display
// (its size is always m_numColumns)
wxArrayInt m_colIndices;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
DECLARE_NO_COPY_CLASS(wxHeaderCtrl) DECLARE_NO_COPY_CLASS(wxHeaderCtrl)

View File

@@ -91,6 +91,7 @@ wxHeaderCtrl::~wxHeaderCtrl()
void wxHeaderCtrl::DoSetCount(unsigned int count) void wxHeaderCtrl::DoSetCount(unsigned int count)
{ {
m_numColumns = count; m_numColumns = count;
m_colIndices.resize(count);
Refresh(); Refresh();
} }
@@ -320,6 +321,21 @@ void wxHeaderCtrl::EndResizing(int xPhysical)
m_colBeingResized = COL_NONE; m_colBeingResized = COL_NONE;
} }
// ----------------------------------------------------------------------------
// wxHeaderCtrl column reordering
// ----------------------------------------------------------------------------
void wxHeaderCtrl::DoSetColumnsOrder(const wxArrayInt& order)
{
m_colIndices = order;
Refresh();
}
wxArrayInt wxHeaderCtrl::DoGetColumnsOrder() const
{
return m_colIndices;
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxHeaderCtrl event handlers // wxHeaderCtrl event handlers
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------