]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/src/grid.i
comment out test code
[wxWidgets.git] / wxPython / src / grid.i
index 00fee52e13323b262c4aeb38543f4427df7f051d..4b63e19d071de61d5ee54bfa421444512827cc24 100644 (file)
@@ -593,6 +593,7 @@ public:
                     rval = *ptr;
                 }
                 else if (PySequence_Check(ro) && PyObject_Length(ro) == 2) {
+                    PyErr_Clear();  // Clear the exception left over from wxPyConvertSwigPtr
                     PyObject* o1 = PySequence_GetItem(ro, 0);
                     PyObject* o2 = PySequence_GetItem(ro, 1);
                     if (PyNumber_Check(o1) && PyNumber_Check(o2))
@@ -643,7 +644,7 @@ IMP_PYCALLBACK__STRING( wxPyGridCellRenderer, wxGridCellRenderer, SetParameters)
 // Let SWIG know about it so it can create the Python version
 class wxPyGridCellRenderer : public wxGridCellRenderer {
 public:
-    %pythonAppend wxPyGridCellRenderer  "self._setCallbackInfo(self, PyGridCellRenderer);self._setOORInfo(self)"
+    %pythonAppend wxPyGridCellRenderer  "self._setOORInfo(self);"  setCallbackInfo(PyGridCellRenderer);
 
     wxPyGridCellRenderer();
     void _setCallbackInfo(PyObject* self, PyObject* _class);
@@ -750,7 +751,7 @@ public:
     virtual void StartingClick();
     virtual void HandleReturn(wxKeyEvent& event);
 
-    %pythonAppend Destroy "args[0].thisown = 0"
+    %pythonPrepend Destroy "args[0].this.own(False)"
     virtual void Destroy();
 
     %property(CellAttr, GetCellAttr, SetCellAttr, doc="See `GetCellAttr` and `SetCellAttr`");
@@ -883,7 +884,7 @@ IMP_PYCALLBACK_STRING__constpure(wxPyGridCellEditor, wxGridCellEditor, GetValue)
 // Let SWIG know about it so it can create the Python version
 class wxPyGridCellEditor : public wxGridCellEditor {
 public:
-    %pythonAppend wxPyGridCellEditor  "self._setCallbackInfo(self, PyGridCellEditor);self._setOORInfo(self)"
+    %pythonAppend wxPyGridCellEditor  "self._setOORInfo(self);" setCallbackInfo(PyGridCellEditor)
 
     wxPyGridCellEditor();
     void _setCallbackInfo(PyObject* self, PyObject* _class);
@@ -939,11 +940,22 @@ public:
 };
 
 
+MAKE_CONST_WXSTRING2(OneString, _T("1"));
 class wxGridCellBoolEditor : public wxGridCellEditor
 {
 public:
     %pythonAppend wxGridCellBoolEditor  "self._setOORInfo(self)"
     wxGridCellBoolEditor();
+
+    // set the string values returned by GetValue() for the true and false
+    // states, respectively
+    static void UseStringValues(const wxString& valueTrue = wxPyOneString,
+                                const wxString& valueFalse = wxPyEmptyString);
+
+    // return true if the given string is equal to the string representation of
+    // true value which we currently use
+    static bool IsTrueValue(const wxString& value);
+
 };
 
 class wxGridCellChoiceEditor : public wxGridCellEditor
@@ -1112,7 +1124,7 @@ public:
 class wxPyGridCellAttrProvider : public wxGridCellAttrProvider
 {
 public:
-    %pythonAppend wxPyGridCellAttrProvider  "self._setCallbackInfo(self, PyGridCellAttrProvider)"
+    %pythonAppend wxPyGridCellAttrProvider  setCallbackInfo(PyGridCellAttrProvider)
     wxPyGridCellAttrProvider();
     void _setCallbackInfo(PyObject* self, PyObject* _class);
 
@@ -1341,11 +1353,11 @@ public:
 class wxPyGridTableBase : public wxGridTableBase
 {
 public:
-    %pythonAppend wxPyGridTableBase "self._setCallbackInfo(self, PyGridTableBase);self._setOORInfo(self)"
+    %pythonAppend wxPyGridTableBase  "self._setOORInfo(self);"  setCallbackInfo(PyGridTableBase)
     wxPyGridTableBase();
     void _setCallbackInfo(PyObject* self, PyObject* _class);
 
-    %pythonAppend Destroy "args[0].thisown = 0"
+    %pythonPrepend Destroy "args[0].this.own(False)"
     %extend { void Destroy() { delete self; } }
 
     wxString GetTypeName( int row, int col );