diff --git a/etg/grid.py b/etg/grid.py index 4138affb..01553b45 100644 --- a/etg/grid.py +++ b/etg/grid.py @@ -182,6 +182,10 @@ def run(): klass.find('EndEdit').ignore() pureVirtual = True + # The Python version of EndEdit has a different signature than the + # C++ version, so we need to take care of mapping between them so the + # C++ compiler still recognizes this as a match for the virtual + # method in the base class. klass.addCppMethod('PyObject*', 'EndEdit', '(int row, int col, const wxGrid* grid, const wxString& oldval)', cppSignature='bool (int row, int col, const wxGrid* grid, const wxString& oldval, wxString* newval)', pyArgsString='(row, col, grid, oldval)', @@ -223,7 +227,8 @@ def run(): // VirtualCatcherCode for wx.grid.GridCellEditor.EndEdit PyObject *result; result = sipCallMethod(0, sipMethod, "iiDN", row, col, - const_cast(grid),sipType_wxGrid,NULL); + const_cast(grid),sipType_wxGrid,NULL, + new wxString(oldval),sipType_wxString,NULL); if (result == Py_None) { sipRes = false; } @@ -259,6 +264,8 @@ def run(): c.find('GetNonDefaultAlignment.hAlign').out = True c.find('GetNonDefaultAlignment.vAlign').out = True + c.find('SetEditor.editor').transfer = True + c.find('SetRenderer.renderer').transfer = True #----------------------------------------------------------------- diff --git a/unittests/test_grid.py b/unittests/test_grid.py index 45ba189f..d79f12ca 100644 --- a/unittests/test_grid.py +++ b/unittests/test_grid.py @@ -89,8 +89,12 @@ class grid_Tests(wtc.WidgetTestCase): def GetValue(self): return "" e = MyEditor() - - + return e + + def test_grid17a(self): + e = self.test_grid17() + e.GetControl + e.SetControl def test_grid18(self):