Since the wxPyMake_wxObject typemap is also used for constructors we

need to allow it to use the $owner value to specify if the thisown
attribute shoudl be set to true.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28110 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2004-06-30 20:12:14 +00:00
parent 488256e0a1
commit 6d450e1a20
11 changed files with 111 additions and 115 deletions

View File

@@ -285,7 +285,7 @@ public:
bool found;
bool blocked = wxPyBeginBlockThreads();
if ((found = wxPyCBH_findCallback(m_myInst, "DrawItem"))) {
PyObject* dcobj = wxPyMake_wxObject(&dc);
PyObject* dcobj = wxPyMake_wxObject(&dc,false);
PyObject* idobj = wxPyConstructObject((void*)&id, wxT("wxTreeItemId"), False);
PyObject* recobj= wxPyConstructObject((void*)&rect, wxT("wxRect"), False);
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", dcobj, idobj, recobj));
@@ -951,7 +951,7 @@ public:
wxTreeItemId FindItem (const wxTreeItemId& item, const wxString& str, int flags = 0);
wxWindow* GetHeaderWindow() const;
wxWindow* GetMainWindow() const;
wxScrolledWindow* GetMainWindow() const;
};

View File

@@ -16,15 +16,15 @@
// OOR Support
%typemap(out) wxPyShape* { $result = wxPyMake_wxShapeEvtHandler($1); }
%typemap(out) wxPyShapeEvtHandler* { $result = wxPyMake_wxShapeEvtHandler($1); }
%typemap(out) wxPyDivisionShape* { $result = wxPyMake_wxShapeEvtHandler($1); }
%typemap(out) wxPyShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
%typemap(out) wxPyShapeEvtHandler* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
%typemap(out) wxPyDivisionShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
%typemap(out) wxPyShapeCanvas* { $result = wxPyMake_wxObject($1); }
%typemap(out) wxDiagram* { $result = wxPyMake_wxObject($1); }
%typemap(out) wxOGLConstraint* { $result = wxPyMake_wxObject($1); }
%typemap(out) wxPseudoMetaFile* { $result = wxPyMake_wxObject($1); }
%typemap(out) wxArrowHead* { $result = wxPyMake_wxObject($1); }
%typemap(out) wxPyShapeCanvas* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxDiagram* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxOGLConstraint* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxPseudoMetaFile* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxArrowHead* { $result = wxPyMake_wxObject($1, $owner); }

View File

@@ -245,7 +245,7 @@ wxList* wxPy_wxRealPoint_ListHelper(PyObject* pyList) {
//---------------------------------------------------------------------------
PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) {
PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source, bool setThisOwn) {
PyObject* target = NULL;
if (source && wxIsKindOf(source, wxShapeEvtHandler)) {
@@ -260,7 +260,7 @@ PyObject* wxPyMake_wxShapeEvtHandler(wxShapeEvtHandler* source) {
}
}
if (! target) {
target = wxPyMake_wxObject2(source, FALSE);
target = wxPyMake_wxObject2(source, setThisOwn, false);
if (target != Py_None)
((wxShapeEvtHandler*)source)->SetClientObject(new wxPyOORClientData(target));
}
@@ -301,7 +301,7 @@ PyObject* wxPy_ConvertShapeList(wxListBase* listbase) {
pyList = PyList_New(0);
while (node) {
wxObj = node->GetData();
pyObj = wxPyMake_wxShapeEvtHandler((wxShapeEvtHandler*)wxObj);
pyObj = wxPyMake_wxShapeEvtHandler((wxShapeEvtHandler*)wxObj, false);
PyList_Append(pyList, pyObj);
node = node->GetNext();
}