]> git.saurik.com Git - wxWidgets.git/commitdiff
take old (wx 2.2? older?) wxGrid compatibility functions inside WXWIN_COMPATIBILITY_2...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 15 Sep 2008 12:18:07 +0000 (12:18 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 15 Sep 2008 12:18:07 +0000 (12:18 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55641 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/generic/grid.h

index 94e375567ae63d9eb4be597ded003e7f118f3b52..4565fb8f4d6e6f9a32b8ef54a76c13af776eb12b 100644 (file)
@@ -1090,34 +1090,52 @@ WX_DECLARE_OBJARRAY_WITH_DECL(wxGridCellCoords, wxGridCellCoordsArray,
 class WXDLLIMPEXP_ADV wxGrid : public wxScrolledWindow
 {
 public:
+    // possible selection modes
+    enum wxGridSelectionModes
+    {
+        wxGridSelectCells         = 0,  // allow selecting anything
+        wxGridSelectRows          = 1,  // allow selecting only entire rows
+        wxGridSelectColumns       = 2,  // allow selecting only entire columns
+        wxGridSelectRowsOrColumns = wxGridSelectRows | wxGridSelectColumns
+    };
+
+    // creation and destruction
+    // ------------------------
+
+    // ctor and Create() create the grid window, as with the other controls
     wxGrid();
 
-    wxGrid( wxWindow *parent,
+    wxGrid(wxWindow *parent,
             wxWindowID id,
             const wxPoint& pos = wxDefaultPosition,
             const wxSize& size = wxDefaultSize,
             long style = wxWANTS_CHARS,
-            const wxString& name = wxGridNameStr );
+            const wxString& name = wxGridNameStr);
 
-    bool Create( wxWindow *parent,
-            wxWindowID id,
-            const wxPoint& pos = wxDefaultPosition,
-            const wxSize& size = wxDefaultSize,
-            long style = wxWANTS_CHARS,
-            const wxString& name = wxGridNameStr );
+    bool Create(wxWindow *parent,
+                wxWindowID id,
+                const wxPoint& pos = wxDefaultPosition,
+                const wxSize& size = wxDefaultSize,
+                long style = wxWANTS_CHARS,
+                const wxString& name = wxGridNameStr);
 
     virtual ~wxGrid();
 
-    enum wxGridSelectionModes
-    {
-        wxGridSelectCells,
-        wxGridSelectRows,
-        wxGridSelectColumns
-    };
+    // however to initialize grid data either CreateGrid() or SetTable() must
+    // be also called
 
+    // this is basically equivalent to
+    //
+    //   SetTable(new wxGridStringTable(numRows, numCols), true, selmode)
+    //
     bool CreateGrid( int numRows, int numCols,
                      wxGridSelectionModes selmode = wxGridSelectCells );
 
+    bool SetTable( wxGridTableBase *table,
+                   bool takeOwnership = false,
+                   wxGridSelectionModes selmode = wxGridSelectCells );
+
+
     void SetSelectionMode(wxGridSelectionModes selmode);
     wxGridSelectionModes GetSelectionMode() const;
 
@@ -1148,8 +1166,6 @@ public:
     void DoEndDragMoveCol();
 
     wxGridTableBase * GetTable() const { return m_table; }
-    bool SetTable( wxGridTableBase *table, bool takeOwnership = false,
-                   wxGridSelectionModes selmode = wxGridSelectCells );
 
     void ClearGrid();
     bool InsertRows( int pos = 0, int numRows = 1, bool updateLabels = true );
@@ -1624,16 +1640,13 @@ public:
     }
 
 
-    // override some base class functions
-    virtual bool Enable(bool enable = true);
-    virtual wxWindow *GetMainWindowOfCompositeControl()
-        { return (wxWindow*)m_gridWin; }
-
     // ------- drag and drop
 #if wxUSE_DRAG_AND_DROP
     virtual void SetDropTarget(wxDropTarget *dropTarget);
 #endif // wxUSE_DRAG_AND_DROP
 
+
+#ifdef WXWIN_COMPATIBILITY_2_8
     // ------ For compatibility with previous wxGrid only...
     //
     //  ************************************************
@@ -1795,8 +1808,13 @@ public:
            wxGRID_CHECKBOX,
            wxGRID_CHOICE,
            wxGRID_COMBOBOX };
+#endif // WXWIN_COMPATIBILITY_2_8
+
 
-    // overridden wxWindow methods
+    // override some base class functions
+    virtual bool Enable(bool enable = true);
+    virtual wxWindow *GetMainWindowOfCompositeControl()
+        { return (wxWindow*)m_gridWin; }
     virtual void Fit();
 
     // implementation only
@@ -1845,7 +1863,7 @@ protected:
     int        m_minAcceptableColWidth;
     wxArrayInt m_colWidths;
     wxArrayInt m_colRights;
-    
+
     bool m_nativeColumnLabels;
 
     // get the col/row coords