]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/grid.h
For needs of wxPython bindings, (re)added a version of RegisterEditorClass() that...
[wxWidgets.git] / include / wx / generic / grid.h
index 7fd7dd7b1271d2abebdd2ded39eb6a9c27c50b3e..11397b37de979a4f155f86c8f214ec864b2a0431 100644 (file)
@@ -725,14 +725,13 @@ class WXDLLIMPEXP_ADV wxGridStringTable : public wxGridTableBase
 public:
     wxGridStringTable();
     wxGridStringTable( int numRows, int numCols );
-    virtual ~wxGridStringTable();
 
     // these are pure virtual in wxGridTableBase
     //
-    int GetNumberRows();
-    int GetNumberCols();
-    wxString GetValue( int row, int col );
-    void SetValue( int row, int col, const wxString& s );
+    virtual int GetNumberRows() { return m_data.size(); }
+    virtual int GetNumberCols() { return m_numCols; }
+    virtual wxString GetValue( int row, int col );
+    virtual void SetValue( int row, int col, const wxString& s );
 
     // overridden functions from wxGridTableBase
     //
@@ -752,6 +751,12 @@ public:
 private:
     wxGridStringArray m_data;
 
+    // notice that while we don't need to store the number of our rows as it's
+    // always equal to the size of m_data array, we do need to store the number
+    // of our columns as we can't retrieve it from m_data when the number of
+    // rows is 0 (see #10818)
+    int m_numCols;
+
     // These only get used if you set your own labels, otherwise the
     // GetRow/ColLabelValue functions return wxGridTableBase defaults
     //