]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/grid.cpp
close the handle returned by OpenProcessToken() (fixes #10129)
[wxWidgets.git] / src / generic / grid.cpp
index 7257f41aa048f09c740e071e8c8c48d0b12b48f2..1b1ed6c60440501cf60210d6814030b51479323e 100644 (file)
@@ -224,12 +224,13 @@ public:
                        wxID_ANY,
                        wxDefaultPosition,
                        wxDefaultSize,
-                       owner->CanDragColMove() ? wxHD_DRAGDROP : 0)
+                       wxHD_ALLOW_HIDE |
+                       (owner->CanDragColMove() ? wxHD_ALLOW_REORDER : 0))
     {
     }
 
 protected:
-    virtual wxHeaderColumn& GetColumn(unsigned int idx)
+    virtual const wxHeaderColumn& GetColumn(unsigned int idx) const
     {
         return m_columns[idx];
     }
@@ -267,6 +268,23 @@ private:
         return true;
     }
 
+    // overridden to react to the actions using the columns popup menu
+    virtual void UpdateColumnVisibility(unsigned int idx, bool show)
+    {
+        GetOwner()->SetColSize(idx, show ? wxGRID_AUTOSIZE : 0);
+
+        // as this is done by the user we should notify the main program about
+        // it
+        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)
@@ -6874,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