From b39c3fa09a936e6a3f386a67c0fc7cfd84df0168 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Sat, 17 Jul 2004 22:51:01 +0000 Subject: [PATCH] Avoid using the OOR typemap in the constructors git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28291 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- wxPython/contrib/ogl/_oglbasic.i | 14 ++++++++++---- wxPython/contrib/ogl/_oglcanvas.i | 5 ++++- wxPython/contrib/ogl/_oglshapes.i | 3 +++ wxPython/src/_app.i | 5 +++++ wxPython/src/_button.i | 10 ++++++++++ wxPython/src/_control.i | 5 +++++ wxPython/src/_evthandler.i | 9 +++++++-- wxPython/src/_mdi.i | 8 ++++++++ wxPython/src/_menu.i | 9 +++++++++ wxPython/src/_notebook.i | 4 ++++ wxPython/src/_panel.i | 8 ++++++++ wxPython/src/_statctrls.i | 4 ++++ wxPython/src/_statusbar.i | 4 ++++ wxPython/src/_textctrl.i | 4 ++++ wxPython/src/_toolbar.i | 6 +++++- wxPython/src/_toplvl.i | 9 +++++++++ wxPython/src/_treectrl.i | 4 ++++ wxPython/src/_validator.i | 5 +++++ wxPython/src/_window.i | 4 ++++ wxPython/src/grid.i | 5 +++++ wxPython/src/html.i | 4 ++++ wxPython/src/my_typemaps.i | 10 ++++++---- wxPython/src/wizard.i | 4 ++++ 23 files changed, 131 insertions(+), 12 deletions(-) diff --git a/wxPython/contrib/ogl/_oglbasic.i b/wxPython/contrib/ogl/_oglbasic.i index 70c18ca92f..df8052dff6 100644 --- a/wxPython/contrib/ogl/_oglbasic.i +++ b/wxPython/contrib/ogl/_oglbasic.i @@ -82,15 +82,18 @@ public: class wxPyShapeEvtHandler : public wxObject { public: %pythonAppend wxPyShapeEvtHandler "self._setOORandCallbackInfo(PyShapeEvtHandler)" - + %typemap(out) wxPyShapeEvtHandler*; // turn off this typemap + wxPyShapeEvtHandler(wxPyShapeEvtHandler *prev = NULL, wxPyShape *shape = NULL); + %typemap(out) wxPyShapeEvtHandler* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); } + + void _setCallbackInfo(PyObject* self, PyObject* _class); %extend { void _setOORInfo(PyObject* _self) { - if (!self->GetClientObject()) - self->SetClientObject(new wxPyOORClientData(_self)); + self->SetClientObject(new wxPyOORClientData(_self)); } } %pythoncode { @@ -147,9 +150,12 @@ public: class wxPyShape : public wxPyShapeEvtHandler { public: %pythonAppend wxPyShape "self._setOORandCallbackInfo(PyShape)" - + %typemap(out) wxPyShape*; // turn off this typemap + wxPyShape(wxPyShapeCanvas *can = NULL); + %typemap(out) wxPyShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); } + void _setCallbackInfo(PyObject* self, PyObject* _class); void GetBoundingBoxMax(double *OUTPUT, double *OUTPUT); diff --git a/wxPython/contrib/ogl/_oglcanvas.i b/wxPython/contrib/ogl/_oglcanvas.i index af80f9ad97..50b7ca6f0c 100644 --- a/wxPython/contrib/ogl/_oglcanvas.i +++ b/wxPython/contrib/ogl/_oglcanvas.i @@ -104,13 +104,16 @@ MustHaveApp(wxPyShapeCanvas); class wxPyShapeCanvas : public wxScrolledWindow { public: %pythonAppend wxPyShapeCanvas "self._setOORandCallbackInfo(PyShapeCanvas)" - + %typemap(out) wxPyShapeCanvas*; // turn off this typemap + wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxBORDER, const wxString& name = wxPyShapeCanvasNameStr); + %typemap(out) wxPyShapeCanvas* { $result = wxPyMake_wxObject($1, $owner); } + void _setCallbackInfo(PyObject* self, PyObject* _class); %pythoncode { def _setOORandCallbackInfo(self, _class): diff --git a/wxPython/contrib/ogl/_oglshapes.i b/wxPython/contrib/ogl/_oglshapes.i index fb9bc95136..65aca87428 100644 --- a/wxPython/contrib/ogl/_oglshapes.i +++ b/wxPython/contrib/ogl/_oglshapes.i @@ -538,9 +538,12 @@ public: class wxPyDivisionShape : public wxPyCompositeShape { public: %pythonAppend wxPyDivisionShape "self._setOORandCallbackInfo(PyDivisionShape)" + %typemap(out) wxPyDivisionShape*; // turn off this typemap wxPyDivisionShape(); + %typemap(out) wxPyDivisionShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); } + void _setCallbackInfo(PyObject* self, PyObject* _class); void AdjustBottom(double bottom, bool test); diff --git a/wxPython/src/_app.i b/wxPython/src/_app.i index fc25d1c8c1..549ca80c44 100644 --- a/wxPython/src/_app.i +++ b/wxPython/src/_app.i @@ -50,6 +50,7 @@ public: %pythonAppend wxPyApp "self._setCallbackInfo(self, PyApp) self._setOORInfo(self)"; + %typemap(out) wxPyApp*; // turn off this typemap DocStr(wxPyApp, "Create a new application object, starting the bootstrap process.", ""); @@ -62,6 +63,10 @@ public: ~wxPyApp(); + // Turn it back on again + %typemap(out) wxPyApp* { $result = wxPyMake_wxObject($1, $owner); } + + void _setCallbackInfo(PyObject* self, PyObject* _class); diff --git a/wxPython/src/_button.i b/wxPython/src/_button.i index de03872ce9..f09a479885 100644 --- a/wxPython/src/_button.i +++ b/wxPython/src/_button.i @@ -65,6 +65,7 @@ class wxButton : public wxControl public: %pythonAppend wxButton "self._setOORInfo(self)" %pythonAppend wxButton() "" + %typemap(out) wxButton*; // turn off this typemap DocCtorStr( @@ -82,6 +83,10 @@ public: "Precreate a Button for 2-phase creation.", "", PreButton); + // Turn it back on again + %typemap(out) wxButton* { $result = wxPyMake_wxObject($1, $owner); } + + DocDeclStr( bool , Create(wxWindow* parent, wxWindowID id=-1, const wxString& label=wxPyEmptyString, @@ -154,6 +159,7 @@ class wxBitmapButton : public wxButton public: %pythonAppend wxBitmapButton "self._setOORInfo(self)" %pythonAppend wxBitmapButton() "" + %typemap(out) wxBitmapButton*; // turn off this typemap DocCtorStr( wxBitmapButton(wxWindow* parent, wxWindowID id=-1, @@ -170,6 +176,10 @@ public: "Precreate a BitmapButton for 2-phase creation.", "", PreBitmapButton); + // Turn it back on again + %typemap(out) wxBitmapButton* { $result = wxPyMake_wxObject($1, $owner); } + + DocDeclStr( bool , Create(wxWindow* parent, wxWindowID id=-1, const wxBitmap& bitmap = wxNullBitmap, diff --git a/wxPython/src/_control.i b/wxPython/src/_control.i index a957574d2a..c33e74a29c 100644 --- a/wxPython/src/_control.i +++ b/wxPython/src/_control.i @@ -34,6 +34,7 @@ class wxControl : public wxWindow public: %pythonAppend wxControl "self._setOORInfo(self)" %pythonAppend wxControl() "" + %typemap(out) wxControl*; // turn off this typemap DocCtorStr( wxControl(wxWindow *parent, @@ -51,6 +52,10 @@ __init__ as a plain old wx.Control is not very useful.", ""); "Precreate a Control control for 2-phase creation", "", PreControl); + // Turn it back on again + %typemap(out) wxControl* { $result = wxPyMake_wxObject($1, $owner); } + + DocDeclStr( bool , Create(wxWindow *parent, wxWindowID id=-1, diff --git a/wxPython/src/_evthandler.i b/wxPython/src/_evthandler.i index 164eb60d41..5cbe3734c9 100644 --- a/wxPython/src/_evthandler.i +++ b/wxPython/src/_evthandler.i @@ -19,8 +19,14 @@ // wxEvtHandler: the base class for all objects handling wxWindows events class wxEvtHandler : public wxObject { public: + // turn off this typemap + %typemap(out) wxEvtHandler*; + wxEvtHandler(); + // Turn it back on again + %typemap(out) wxEvtHandler* { $result = wxPyMake_wxObject($1, $owner); } + wxEvtHandler* GetNextHandler(); wxEvtHandler* GetPreviousHandler(); void SetNextHandler(wxEvtHandler* handler); @@ -69,8 +75,7 @@ public: %extend { void _setOORInfo(PyObject* _self) { if (_self && _self != Py_None) { - if (!self->GetClientObject()) - self->SetClientObject(new wxPyOORClientData(_self)); + self->SetClientObject(new wxPyOORClientData(_self)); } else { wxPyOORClientData* data = (wxPyOORClientData*)self->GetClientObject(); diff --git a/wxPython/src/_mdi.i b/wxPython/src/_mdi.i index dab48d326d..f5607a591c 100644 --- a/wxPython/src/_mdi.i +++ b/wxPython/src/_mdi.i @@ -86,6 +86,7 @@ class wxMDIChildFrame : public wxFrame { public: %pythonAppend wxMDIChildFrame "self._setOORInfo(self)" %pythonAppend wxMDIChildFrame() "" + %typemap(out) wxMDIChildFrame*; // turn off this typemap wxMDIChildFrame(wxMDIParentFrame* parent, const wxWindowID id=-1, @@ -96,6 +97,9 @@ public: const wxString& name = wxPyFrameNameStr); %name(PreMDIChildFrame)wxMDIChildFrame(); + // Turn it back on again + %typemap(out) wxMDIChildFrame* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxMDIParentFrame* parent, const wxWindowID id=-1, const wxString& title = wxPyEmptyString, @@ -119,10 +123,14 @@ class wxMDIClientWindow : public wxWindow { public: %pythonAppend wxMDIClientWindow "self._setOORInfo(self)" %pythonAppend wxMDIClientWindow() "" + %typemap(out) wxMDIClientWindow*; // turn off this typemap wxMDIClientWindow(wxMDIParentFrame* parent, long style = 0); %name(PreMDIClientWindow)wxMDIClientWindow(); + // Turn it back on again + %typemap(out) wxMDIClientWindow* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxMDIParentFrame* parent, long style = 0); }; diff --git a/wxPython/src/_menu.i b/wxPython/src/_menu.i index 59fb473645..f7584ed534 100644 --- a/wxPython/src/_menu.i +++ b/wxPython/src/_menu.i @@ -23,9 +23,14 @@ class wxMenu : public wxEvtHandler { public: %pythonAppend wxMenu "self._setOORInfo(self)" + %typemap(out) wxMenu*; // turn off this typemap + wxMenu(const wxString& title = wxPyEmptyString, long style = 0); + // Turn it back on again + %typemap(out) wxMenu* { $result = wxPyMake_wxObject($1, $owner); } + // append any kind of item (normal/check/radio/separator) wxMenuItem* Append(int id, const wxString& text, @@ -211,8 +216,12 @@ class wxMenuBar : public wxWindow { public: %pythonAppend wxMenuBar "self._setOORInfo(self)" + %typemap(out) wxMenuBar*; // turn off this typemap + wxMenuBar(long style = 0); + // Turn it back on again + %typemap(out) wxMenuBar* { $result = wxPyMake_wxObject($1, $owner); } // append a menu to the end of menubar, return True if ok virtual bool Append(wxMenu *menu, const wxString& title); diff --git a/wxPython/src/_notebook.i b/wxPython/src/_notebook.i index ab17747cd7..e058b6e9bf 100644 --- a/wxPython/src/_notebook.i +++ b/wxPython/src/_notebook.i @@ -168,6 +168,7 @@ class wxNotebook : public wxBookCtrl { public: %pythonAppend wxNotebook "self._setOORInfo(self)" %pythonAppend wxNotebook() "" + %typemap(out) wxNotebook*; // turn off this typemap wxNotebook(wxWindow *parent, wxWindowID id=-1, @@ -177,6 +178,9 @@ public: const wxString& name = wxPyNOTEBOOK_NAME); %name(PreNotebook)wxNotebook(); + // Turn it back on again + %typemap(out) wxNotebook* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow *parent, wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, diff --git a/wxPython/src/_panel.i b/wxPython/src/_panel.i index 180bd8c8ed..de57b04fcd 100644 --- a/wxPython/src/_panel.i +++ b/wxPython/src/_panel.i @@ -29,6 +29,7 @@ class wxPanel : public wxWindow public: %pythonAppend wxPanel "self._setOORInfo(self)" %pythonAppend wxPanel() "" + %typemap(out) wxPanel*; // turn off this typemap wxPanel(wxWindow* parent, const wxWindowID id=-1, @@ -38,6 +39,9 @@ public: const wxString& name = wxPyPanelNameStr); %name(PrePanel)wxPanel(); + // Turn it back on again + %typemap(out) wxPanel* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow* parent, const wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, @@ -66,6 +70,7 @@ class wxScrolledWindow : public wxPanel public: %pythonAppend wxScrolledWindow "self._setOORInfo(self)" %pythonAppend wxScrolledWindow() "" + %typemap(out) wxScrolledWindow*; // turn off this typemap wxScrolledWindow(wxWindow* parent, const wxWindowID id = -1, @@ -75,6 +80,9 @@ public: const wxString& name = wxPyPanelNameStr); %name(PreScrolledWindow)wxScrolledWindow(); + // Turn it back on again + %typemap(out) wxScrolledWindow* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow* parent, const wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, diff --git a/wxPython/src/_statctrls.i b/wxPython/src/_statctrls.i index 3c15670aaf..9c2df37ac9 100644 --- a/wxPython/src/_statctrls.i +++ b/wxPython/src/_statctrls.i @@ -29,6 +29,7 @@ class wxStaticBox : public wxControl { public: %pythonAppend wxStaticBox "self._setOORInfo(self)" %pythonAppend wxStaticBox() "" + %typemap(out) wxStaticBox*; // turn off this typemap wxStaticBox(wxWindow* parent, wxWindowID id=-1, const wxString& label = wxPyEmptyString, @@ -38,6 +39,9 @@ public: const wxString& name = wxPyStaticBoxNameStr); %name(PreStaticBox)wxStaticBox(); + // Turn it back on again + %typemap(out) wxStaticBox* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow* parent, wxWindowID id=-1, const wxString& label = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, diff --git a/wxPython/src/_statusbar.i b/wxPython/src/_statusbar.i index 0fc21a1f03..50013980d5 100644 --- a/wxPython/src/_statusbar.i +++ b/wxPython/src/_statusbar.i @@ -30,12 +30,16 @@ class wxStatusBar : public wxWindow public: %pythonAppend wxStatusBar "self._setOORInfo(self)" %pythonAppend wxStatusBar() "" + %typemap(out) wxStatusBar*; // turn off this typemap wxStatusBar(wxWindow* parent, wxWindowID id = -1, long style = wxDEFAULT_STATUSBAR_STYLE, const wxString& name = wxPyStatusLineNameStr); %name(PreStatusBar)wxStatusBar(); + // Turn it back on again + %typemap(out) wxStatusBar* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow* parent, wxWindowID id=-1, long style = wxST_SIZEGRIP, const wxString& name = wxPyStatusLineNameStr); diff --git a/wxPython/src/_textctrl.i b/wxPython/src/_textctrl.i index a12f5b6c6e..f1e89934f5 100644 --- a/wxPython/src/_textctrl.i +++ b/wxPython/src/_textctrl.i @@ -165,6 +165,7 @@ class wxTextCtrl : public wxControl public: %pythonAppend wxTextCtrl "self._setOORInfo(self)" %pythonAppend wxTextCtrl() "" + %typemap(out) wxTextCtrl*; // turn off this typemap wxTextCtrl(wxWindow* parent, wxWindowID id=-1, const wxString& value = wxPyEmptyString, @@ -175,6 +176,9 @@ public: const wxString& name = wxPyTextCtrlNameStr); %name(PreTextCtrl)wxTextCtrl(); + // Turn it back on again + %typemap(out) wxTextCtrl* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow* parent, wxWindowID id=-1, const wxString& value = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, diff --git a/wxPython/src/_toolbar.i b/wxPython/src/_toolbar.i index c7d22e0b2c..f3d0bb52f2 100644 --- a/wxPython/src/_toolbar.i +++ b/wxPython/src/_toolbar.i @@ -391,7 +391,8 @@ class wxToolBar : public wxToolBarBase { public: %pythonAppend wxToolBar "self._setOORInfo(self)" %pythonAppend wxToolBar() "" - + %typemap(out) wxToolBar*; // turn off this typemap + wxToolBar(wxWindow *parent, wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, @@ -400,6 +401,9 @@ public: const wxString& name = wxPyToolBarNameStr); %name(PreToolBar)wxToolBar(); + // Turn it back on again + %typemap(out) wxToolBar* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow *parent, wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, diff --git a/wxPython/src/_toplvl.i b/wxPython/src/_toplvl.i index 261d41c041..01f14c5b27 100644 --- a/wxPython/src/_toplvl.i +++ b/wxPython/src/_toplvl.i @@ -151,6 +151,7 @@ class wxFrame : public wxTopLevelWindow { public: %pythonAppend wxFrame "self._setOORInfo(self)" %pythonAppend wxFrame() "" + %typemap(out) wxFrame*; // turn off this typemap wxFrame(wxWindow* parent, const wxWindowID id=-1, const wxString& title = wxPyEmptyString, @@ -160,6 +161,10 @@ public: const wxString& name = wxPyFrameNameStr); %name(PreFrame)wxFrame(); + // Turn it back on again + %typemap(out) wxFrame* { $result = wxPyMake_wxObject($1, $owner); } + + bool Create(wxWindow* parent, const wxWindowID id=-1, const wxString& title = wxPyEmptyString, const wxPoint& pos = wxDefaultPosition, @@ -265,6 +270,7 @@ class wxDialog : public wxTopLevelWindow { public: %pythonAppend wxDialog "self._setOORInfo(self)" %pythonAppend wxDialog() "" + %typemap(out) wxDialog*; // turn off this typemap wxDialog(wxWindow* parent, const wxWindowID id=-1, @@ -275,6 +281,9 @@ public: const wxString& name = wxPyDialogNameStr); %name(PreDialog)wxDialog(); + // Turn it back on again + %typemap(out) wxDialog* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow* parent, const wxWindowID id=-1, const wxString& title = wxPyEmptyString, diff --git a/wxPython/src/_treectrl.i b/wxPython/src/_treectrl.i index d1509302d9..2e7da38712 100644 --- a/wxPython/src/_treectrl.i +++ b/wxPython/src/_treectrl.i @@ -315,6 +315,7 @@ MustHaveApp(wxPyTreeCtrl); public: %pythonAppend wxPyTreeCtrl "self._setOORInfo(self);self._setCallbackInfo(self, TreeCtrl)" %pythonAppend wxPyTreeCtrl() "" + %typemap(out) wxPyTreeCtrl*; // turn off this typemap wxPyTreeCtrl(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, @@ -324,6 +325,9 @@ public: const wxString& name = wxPyTreeCtrlNameStr); %name(PreTreeCtrl)wxPyTreeCtrl(); + // Turn it back on again + %typemap(out) wxPyTreeCtrl* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow *parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, diff --git a/wxPython/src/_validator.i b/wxPython/src/_validator.i index 2951244f36..e68789f9e9 100644 --- a/wxPython/src/_validator.i +++ b/wxPython/src/_validator.i @@ -33,10 +33,15 @@ class wxValidator : public wxEvtHandler { public: %pythonAppend wxValidator "self._setOORInfo(self)" + %typemap(out) wxValidator*; // turn off this typemap + wxValidator(); //~wxValidator(); + // Turn it back on again + %typemap(out) wxValidator* { $result = wxPyMake_wxObject($1, $owner); } + // Make a clone of this validator (or return NULL) wxValidator* Clone(); diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index 7825ecd03b..b027f9f3b9 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -199,6 +199,7 @@ class wxWindow : public wxEvtHandler public: %pythonAppend wxWindow "self._setOORInfo(self)" %pythonAppend wxWindow() "" + %typemap(out) wxWindow*; // turn off this typemap DocCtorStr( wxWindow(wxWindow* parent, const wxWindowID id=-1, @@ -213,7 +214,10 @@ public: "Precreate a Window for 2-phase creation.", "", PreWindow); + // Turn it back on again + %typemap(out) wxWindow* { $result = wxPyMake_wxObject($1, $owner); } + DocDeclStr( bool , Create(wxWindow* parent, const wxWindowID id=-1, const wxPoint& pos = wxDefaultPosition, diff --git a/wxPython/src/grid.i b/wxPython/src/grid.i index 771190095b..9a1d2909f7 100644 --- a/wxPython/src/grid.i +++ b/wxPython/src/grid.i @@ -1592,6 +1592,7 @@ class wxGrid : public wxScrolledWindow { public: %pythonAppend wxGrid "self._setOORInfo(self)" + %typemap(out) wxGrid*; // turn off this typemap wxGrid( wxWindow *parent, wxWindowID id=-1, @@ -1602,6 +1603,10 @@ public: %name(PreGrid) wxGrid(); + + // Turn it back on again + %typemap(out) wxGrid* { $result = wxPyMake_wxObject($1, $owner); } + bool Create( wxWindow *parent, wxWindowID id=-1, diff --git a/wxPython/src/html.i b/wxPython/src/html.i index 6bde2f4c97..403878e34d 100644 --- a/wxPython/src/html.i +++ b/wxPython/src/html.i @@ -791,6 +791,7 @@ MustHaveApp(wxPyHtmlWindow); public: %pythonAppend wxPyHtmlWindow "self._setCallbackInfo(self, HtmlWindow); self._setOORInfo(self)" %pythonAppend wxPyHtmlWindow() "" + %typemap(out) wxPyHtmlWindow*; // turn off this typemap wxPyHtmlWindow(wxWindow *parent, int id = -1, const wxPoint& pos = wxDefaultPosition, @@ -799,6 +800,9 @@ public: const wxString& name = wxPyHtmlWindowNameStr); %name(PreHtmlWindow)wxPyHtmlWindow(); + // Turn it back on again + %typemap(out) wxPyHtmlWindow* { $result = wxPyMake_wxObject($1, $owner); } + bool Create(wxWindow *parent, int id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, diff --git a/wxPython/src/my_typemaps.i b/wxPython/src/my_typemaps.i index cd0d21826d..d9ce9153bf 100644 --- a/wxPython/src/my_typemaps.i +++ b/wxPython/src/my_typemaps.i @@ -340,6 +340,9 @@ SWIG_AsDouble(PyObject *obj) // to the real derived type, if possible. See wxPyMake_wxObject in // helpers.cpp +// NOTE: For those classes that also call _setOORInfo these typemaps should be +// disabled for the constructor. + %typemap(out) wxEvtHandler* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxMenu* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxValidator* { $result = wxPyMake_wxObject($1, $owner); } @@ -349,7 +352,6 @@ SWIG_AsDouble(PyObject *obj) %typemap(out) wxDC* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxFSFile* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxFileSystem* { $result = wxPyMake_wxObject($1, $owner); } -%typemap(out) wxGridTableBase* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxImageList* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxListItem* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxMenuItem* { $result = wxPyMake_wxObject($1, $owner); } @@ -365,7 +367,7 @@ SWIG_AsDouble(PyObject *obj) %typemap(out) wxControl* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxFrame* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxGrid* { $result = wxPyMake_wxObject($1, $owner); } -%typemap(out) wxListCtrl* { $result = wxPyMake_wxObject($1, $owner); } +//%typemap(out) wxListCtrl* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxMDIChildFrame* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxMDIClientWindow* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxMenuBar* { $result = wxPyMake_wxObject($1, $owner); } @@ -375,12 +377,12 @@ SWIG_AsDouble(PyObject *obj) %typemap(out) wxTextCtrl* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxToolBar* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxToolBarBase* { $result = wxPyMake_wxObject($1, $owner); } -%typemap(out) wxTreeCtrl* { $result = wxPyMake_wxObject($1, $owner); } +//%typemap(out) wxTreeCtrl* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxPyTreeCtrl* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxWindow* { $result = wxPyMake_wxObject($1, $owner); } -%typemap(out) wxHtmlWindow* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxPyHtmlWindow* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxWizardPage* { $result = wxPyMake_wxObject($1, $owner); } +%typemap(out) wxPyWizardPage* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxPanel* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxDialog* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxScrolledWindow* { $result = wxPyMake_wxObject($1, $owner); } diff --git a/wxPython/src/wizard.i b/wxPython/src/wizard.i index da7624931f..df3bf2130a 100644 --- a/wxPython/src/wizard.i +++ b/wxPython/src/wizard.i @@ -207,6 +207,7 @@ public: %pythonAppend wxPyWizardPage "self._setCallbackInfo(self, PyWizardPage);self._setOORInfo(self)" %pythonAppend wxPyWizardPage() "" + %typemap(out) wxPyWizardPage*; // turn off this typemap // ctor accepts an optional bitmap which will be used for this page instead // of the default one for this wizard (should be of the same size). Notice @@ -225,6 +226,9 @@ public: %name(PrePyWizardPage)wxPyWizardPage(); + // Turn it back on again + %typemap(out) wxPyWizardPage* { $result = wxPyMake_wxObject($1, $owner); } + %extend { bool Create(wxWizard *parent, const wxBitmap& bitmap = wxNullBitmap,