]> git.saurik.com Git - wxWidgets.git/commitdiff
GetValue is pure virtual
authorRobin Dunn <robin@alldunn.com>
Wed, 26 Mar 2003 20:49:14 +0000 (20:49 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 26 Mar 2003 20:49:14 +0000 (20:49 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19822 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/src/grid.i
wxPython/src/helpers.h

index 8e10b08c6f50ec6c1d3acfe752be310a71046596..d78a22b050c9061054bf3557b1209860d3344427 100644 (file)
@@ -771,7 +771,6 @@ public:
     virtual void HandleReturn(wxKeyEvent& event);
     virtual void Destroy();
 
-    virtual wxString GetValue();
 };
 
 
@@ -884,7 +883,7 @@ public:
     DEC_PYCALLBACK__(StartingClick);
     DEC_PYCALLBACK__(Destroy);
     DEC_PYCALLBACK__STRING(SetParameters);
-    DEC_PYCALLBACK_STRING__const(GetValue);
+    DEC_PYCALLBACK_STRING__constpure(GetValue);
 
     PYPRIVATE;
 };
@@ -898,7 +897,7 @@ IMP_PYCALLBACK__any(wxPyGridCellEditor, wxGridCellEditor, StartingKey, wxKeyEven
 IMP_PYCALLBACK__any(wxPyGridCellEditor, wxGridCellEditor, HandleReturn, wxKeyEvent);
 IMP_PYCALLBACK__(wxPyGridCellEditor, wxGridCellEditor, StartingClick);
 IMP_PYCALLBACK__(wxPyGridCellEditor, wxGridCellEditor, Destroy);
-IMP_PYCALLBACK_STRING__const(wxPyGridCellEditor, wxGridCellEditor, GetValue);
+IMP_PYCALLBACK_STRING__constpure(wxPyGridCellEditor, wxGridCellEditor, GetValue);
 
 %}
 
@@ -920,7 +919,6 @@ public:
     void base_HandleReturn(wxKeyEvent& event);
     void base_Destroy();
     void base_SetParameters(const wxString& params);
-    wxString base_GetValue();
 };
 
 //---------------------------------------------------------------------------
@@ -931,6 +929,7 @@ class wxGridCellTextEditor : public wxGridCellEditor
 public:
     wxGridCellTextEditor();
     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
+    virtual wxString GetValue();
 };
 
 
@@ -939,6 +938,7 @@ class wxGridCellNumberEditor : public wxGridCellTextEditor
 public:
     wxGridCellNumberEditor(int min = -1, int max = -1);
     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
+    virtual wxString GetValue();
 };
 
 
@@ -947,6 +947,7 @@ class wxGridCellFloatEditor : public wxGridCellTextEditor
 public:
     wxGridCellFloatEditor();
     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
+    virtual wxString GetValue();
 };
 
 
@@ -955,6 +956,7 @@ class wxGridCellBoolEditor : public wxGridCellEditor
 public:
     wxGridCellBoolEditor();
     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
+    virtual wxString GetValue();
 };
 
 class wxGridCellChoiceEditor : public wxGridCellEditor
@@ -964,6 +966,7 @@ public:
                            const wxString* choices = NULL,
                            bool allowOthers = FALSE);
     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
+    virtual wxString GetValue();
 };
 
 
@@ -972,6 +975,7 @@ class wxGridCellEnumEditor : public wxGridCellChoiceEditor
 public:
     wxGridCellEnumEditor( const wxString& choices = wxPyEmptyString );
     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
+    virtual wxString GetValue();
 };
 
 
@@ -980,6 +984,7 @@ class wxGridCellAutoWrapStringEditor : public wxGridCellTextEditor
 public:
     wxGridCellAutoWrapStringEditor();
     %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
+    virtual wxString GetValue();
 };
 
 
index 58c81db3a7059d20474a2f519fb8447a9791cc31..4cfd02d5ba9fcb1f5884e74c9f3afbbb5dd7a078 100644 (file)
@@ -1288,6 +1288,27 @@ extern wxPyApp *wxPythonApp;
 
 //---------------------------------------------------------------------------
 
+#define DEC_PYCALLBACK_STRING__constpure(CBNAME)             \
+    wxString CBNAME() const;
+
+#define IMP_PYCALLBACK_STRING__constpure(CLASS, PCLASS, CBNAME)                 \
+    wxString CLASS::CBNAME() const {                                            \
+        wxString rval;                                                          \
+        wxPyBeginBlockThreads();                                                \
+        if (wxPyCBH_findCallback(m_myInst, #CBNAME)) {                          \
+            PyObject* ro;                                                       \
+            ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));        \
+            if (ro) {                                                           \
+                rval = Py2wxString(ro);                                         \
+                Py_DECREF(ro);                                                  \
+            }                                                                   \
+        }                                                                       \
+        wxPyEndBlockThreads();                                                  \
+        return rval;                                                            \
+    }
+
+//---------------------------------------------------------------------------
+
 #define DEC_PYCALLBACK_BOOL_TAG_pure(CBNAME)                  \
     bool CBNAME(const wxHtmlTag& a);                          \