]> git.saurik.com Git - wxWidgets.git/commitdiff
provide Do[GS]etColumnsOrder() stubs for the generic wxHeaderCtrl
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 10 Dec 2008 16:09:58 +0000 (16:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 10 Dec 2008 16:09:58 +0000 (16:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57234 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/headerctrlg.h
src/generic/headerctrlg.cpp

index 127f798c407a54d5e1fe2d3a828290c060ff3385..dd943a8deb36a24f98c189b940ff5134e5a1b6a6 100644 (file)
@@ -56,6 +56,9 @@ private:
 
     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
     virtual wxSize DoGetBestSize() const;
 
@@ -129,6 +132,10 @@ private:
     // the overlay display used during the dragging operations
     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_NO_COPY_CLASS(wxHeaderCtrl)
index 9c4aaeb89a7c23a1482b9acc050ecb940e63adad..6b9c1a399b409890946e72aac47bcf826b5a5983 100644 (file)
@@ -91,6 +91,7 @@ wxHeaderCtrl::~wxHeaderCtrl()
 void wxHeaderCtrl::DoSetCount(unsigned int count)
 {
     m_numColumns = count;
+    m_colIndices.resize(count);
 
     Refresh();
 }
@@ -320,6 +321,21 @@ void wxHeaderCtrl::EndResizing(int xPhysical)
     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
 // ----------------------------------------------------------------------------