From: Robin Dunn Date: Wed, 26 Mar 2003 20:49:14 +0000 (+0000) Subject: GetValue is pure virtual X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2d138379016e86c0625162f9ba0286233430a183?hp=bf78c81c049827da8131c9b8d49a591443f64bbf GetValue is pure virtual git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19822 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/src/grid.i b/wxPython/src/grid.i index 8e10b08c6f..d78a22b050 100644 --- a/wxPython/src/grid.i +++ b/wxPython/src/grid.i @@ -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(); }; diff --git a/wxPython/src/helpers.h b/wxPython/src/helpers.h index 58c81db3a7..4cfd02d5ba 100644 --- a/wxPython/src/helpers.h +++ b/wxPython/src/helpers.h @@ -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); \