]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
Fixes #10288: wxDataViewCtrl missing selection change event
[wxWidgets.git] / src / generic / grid.cpp
index 316bd1d2c3ee3d79bb9656b7b3f133668de4de61..1b1ed6c60440501cf60210d6814030b51479323e 100644 (file)
@@ -230,7 +230,7 @@ public:
     }
 
 protected:
-    virtual wxHeaderColumn& GetColumn(unsigned int idx)
+    virtual const wxHeaderColumn& GetColumn(unsigned int idx) const
     {
         return m_columns[idx];
     }
@@ -278,6 +278,13 @@ private:
         GetOwner()->SendEvent(wxEVT_GRID_COL_SIZE, -1, idx);
     }
 
+    // overridden to react to the columns order changes in the customization
+    // dialog
+    virtual void UpdateColumnsOrder(const wxArrayInt& order)
+    {
+        GetOwner()->SetColumnsOrder(order);
+    }
+
 
     // event handlers forwarding wxHeaderCtrl events to wxGrid
     void OnClick(wxHeaderCtrlEvent& event)
@@ -6885,6 +6892,13 @@ void wxGrid::RefreshAfterColPosChange()
     m_gridWin->Refresh();
 }
 
+void wxGrid::SetColumnsOrder(const wxArrayInt& order)
+{
+    m_colAt = order;
+
+    RefreshAfterColPosChange();
+}
+
 void wxGrid::SetColPos(int idx, int pos)
 {
     // we're going to need m_colAt now, initialize it if needed