Fix virtual catcher for EndEdit.

Fix ownership transfer for wxGridCellAttr.SetEditor and SetRenderer.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2014-01-14 02:34:41 +00:00
parent 24bf92a45d
commit ad00674de2
2 changed files with 14 additions and 3 deletions

View File

@@ -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<wxGrid *>(grid),sipType_wxGrid,NULL);
const_cast<wxGrid *>(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
#-----------------------------------------------------------------

View File

@@ -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):