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
This commit is contained in:
Robin Dunn
2004-07-17 22:51:01 +00:00
parent 14885f0910
commit b39c3fa09a
23 changed files with 131 additions and 12 deletions

View File

@@ -82,15 +82,18 @@ public:
class wxPyShapeEvtHandler : public wxObject { class wxPyShapeEvtHandler : public wxObject {
public: public:
%pythonAppend wxPyShapeEvtHandler "self._setOORandCallbackInfo(PyShapeEvtHandler)" %pythonAppend wxPyShapeEvtHandler "self._setOORandCallbackInfo(PyShapeEvtHandler)"
%typemap(out) wxPyShapeEvtHandler*; // turn off this typemap
wxPyShapeEvtHandler(wxPyShapeEvtHandler *prev = NULL, wxPyShapeEvtHandler(wxPyShapeEvtHandler *prev = NULL,
wxPyShape *shape = NULL); wxPyShape *shape = NULL);
%typemap(out) wxPyShapeEvtHandler* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
void _setCallbackInfo(PyObject* self, PyObject* _class); void _setCallbackInfo(PyObject* self, PyObject* _class);
%extend { %extend {
void _setOORInfo(PyObject* _self) { void _setOORInfo(PyObject* _self) {
if (!self->GetClientObject()) self->SetClientObject(new wxPyOORClientData(_self));
self->SetClientObject(new wxPyOORClientData(_self));
} }
} }
%pythoncode { %pythoncode {
@@ -147,9 +150,12 @@ public:
class wxPyShape : public wxPyShapeEvtHandler { class wxPyShape : public wxPyShapeEvtHandler {
public: public:
%pythonAppend wxPyShape "self._setOORandCallbackInfo(PyShape)" %pythonAppend wxPyShape "self._setOORandCallbackInfo(PyShape)"
%typemap(out) wxPyShape*; // turn off this typemap
wxPyShape(wxPyShapeCanvas *can = NULL); wxPyShape(wxPyShapeCanvas *can = NULL);
%typemap(out) wxPyShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
void _setCallbackInfo(PyObject* self, PyObject* _class); void _setCallbackInfo(PyObject* self, PyObject* _class);
void GetBoundingBoxMax(double *OUTPUT, double *OUTPUT); void GetBoundingBoxMax(double *OUTPUT, double *OUTPUT);

View File

@@ -104,6 +104,7 @@ MustHaveApp(wxPyShapeCanvas);
class wxPyShapeCanvas : public wxScrolledWindow { class wxPyShapeCanvas : public wxScrolledWindow {
public: public:
%pythonAppend wxPyShapeCanvas "self._setOORandCallbackInfo(PyShapeCanvas)" %pythonAppend wxPyShapeCanvas "self._setOORandCallbackInfo(PyShapeCanvas)"
%typemap(out) wxPyShapeCanvas*; // turn off this typemap
wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1, wxPyShapeCanvas(wxWindow* parent = NULL, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -111,6 +112,8 @@ public:
long style = wxBORDER, long style = wxBORDER,
const wxString& name = wxPyShapeCanvasNameStr); const wxString& name = wxPyShapeCanvasNameStr);
%typemap(out) wxPyShapeCanvas* { $result = wxPyMake_wxObject($1, $owner); }
void _setCallbackInfo(PyObject* self, PyObject* _class); void _setCallbackInfo(PyObject* self, PyObject* _class);
%pythoncode { %pythoncode {
def _setOORandCallbackInfo(self, _class): def _setOORandCallbackInfo(self, _class):

View File

@@ -538,9 +538,12 @@ public:
class wxPyDivisionShape : public wxPyCompositeShape { class wxPyDivisionShape : public wxPyCompositeShape {
public: public:
%pythonAppend wxPyDivisionShape "self._setOORandCallbackInfo(PyDivisionShape)" %pythonAppend wxPyDivisionShape "self._setOORandCallbackInfo(PyDivisionShape)"
%typemap(out) wxPyDivisionShape*; // turn off this typemap
wxPyDivisionShape(); wxPyDivisionShape();
%typemap(out) wxPyDivisionShape* { $result = wxPyMake_wxShapeEvtHandler($1, $owner); }
void _setCallbackInfo(PyObject* self, PyObject* _class); void _setCallbackInfo(PyObject* self, PyObject* _class);
void AdjustBottom(double bottom, bool test); void AdjustBottom(double bottom, bool test);

View File

@@ -50,6 +50,7 @@ public:
%pythonAppend wxPyApp %pythonAppend wxPyApp
"self._setCallbackInfo(self, PyApp) "self._setCallbackInfo(self, PyApp)
self._setOORInfo(self)"; self._setOORInfo(self)";
%typemap(out) wxPyApp*; // turn off this typemap
DocStr(wxPyApp, DocStr(wxPyApp,
"Create a new application object, starting the bootstrap process.", ""); "Create a new application object, starting the bootstrap process.", "");
@@ -62,6 +63,10 @@ public:
~wxPyApp(); ~wxPyApp();
// Turn it back on again
%typemap(out) wxPyApp* { $result = wxPyMake_wxObject($1, $owner); }
void _setCallbackInfo(PyObject* self, PyObject* _class); void _setCallbackInfo(PyObject* self, PyObject* _class);

View File

@@ -65,6 +65,7 @@ class wxButton : public wxControl
public: public:
%pythonAppend wxButton "self._setOORInfo(self)" %pythonAppend wxButton "self._setOORInfo(self)"
%pythonAppend wxButton() "" %pythonAppend wxButton() ""
%typemap(out) wxButton*; // turn off this typemap
DocCtorStr( DocCtorStr(
@@ -82,6 +83,10 @@ public:
"Precreate a Button for 2-phase creation.", "", "Precreate a Button for 2-phase creation.", "",
PreButton); PreButton);
// Turn it back on again
%typemap(out) wxButton* { $result = wxPyMake_wxObject($1, $owner); }
DocDeclStr( DocDeclStr(
bool , Create(wxWindow* parent, wxWindowID id=-1, bool , Create(wxWindow* parent, wxWindowID id=-1,
const wxString& label=wxPyEmptyString, const wxString& label=wxPyEmptyString,
@@ -154,6 +159,7 @@ class wxBitmapButton : public wxButton
public: public:
%pythonAppend wxBitmapButton "self._setOORInfo(self)" %pythonAppend wxBitmapButton "self._setOORInfo(self)"
%pythonAppend wxBitmapButton() "" %pythonAppend wxBitmapButton() ""
%typemap(out) wxBitmapButton*; // turn off this typemap
DocCtorStr( DocCtorStr(
wxBitmapButton(wxWindow* parent, wxWindowID id=-1, wxBitmapButton(wxWindow* parent, wxWindowID id=-1,
@@ -170,6 +176,10 @@ public:
"Precreate a BitmapButton for 2-phase creation.", "", "Precreate a BitmapButton for 2-phase creation.", "",
PreBitmapButton); PreBitmapButton);
// Turn it back on again
%typemap(out) wxBitmapButton* { $result = wxPyMake_wxObject($1, $owner); }
DocDeclStr( DocDeclStr(
bool , Create(wxWindow* parent, wxWindowID id=-1, bool , Create(wxWindow* parent, wxWindowID id=-1,
const wxBitmap& bitmap = wxNullBitmap, const wxBitmap& bitmap = wxNullBitmap,

View File

@@ -34,6 +34,7 @@ class wxControl : public wxWindow
public: public:
%pythonAppend wxControl "self._setOORInfo(self)" %pythonAppend wxControl "self._setOORInfo(self)"
%pythonAppend wxControl() "" %pythonAppend wxControl() ""
%typemap(out) wxControl*; // turn off this typemap
DocCtorStr( DocCtorStr(
wxControl(wxWindow *parent, 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", "", "Precreate a Control control for 2-phase creation", "",
PreControl); PreControl);
// Turn it back on again
%typemap(out) wxControl* { $result = wxPyMake_wxObject($1, $owner); }
DocDeclStr( DocDeclStr(
bool , Create(wxWindow *parent, bool , Create(wxWindow *parent,
wxWindowID id=-1, wxWindowID id=-1,

View File

@@ -19,8 +19,14 @@
// wxEvtHandler: the base class for all objects handling wxWindows events // wxEvtHandler: the base class for all objects handling wxWindows events
class wxEvtHandler : public wxObject { class wxEvtHandler : public wxObject {
public: public:
// turn off this typemap
%typemap(out) wxEvtHandler*;
wxEvtHandler(); wxEvtHandler();
// Turn it back on again
%typemap(out) wxEvtHandler* { $result = wxPyMake_wxObject($1, $owner); }
wxEvtHandler* GetNextHandler(); wxEvtHandler* GetNextHandler();
wxEvtHandler* GetPreviousHandler(); wxEvtHandler* GetPreviousHandler();
void SetNextHandler(wxEvtHandler* handler); void SetNextHandler(wxEvtHandler* handler);
@@ -69,8 +75,7 @@ public:
%extend { %extend {
void _setOORInfo(PyObject* _self) { void _setOORInfo(PyObject* _self) {
if (_self && _self != Py_None) { if (_self && _self != Py_None) {
if (!self->GetClientObject()) self->SetClientObject(new wxPyOORClientData(_self));
self->SetClientObject(new wxPyOORClientData(_self));
} }
else { else {
wxPyOORClientData* data = (wxPyOORClientData*)self->GetClientObject(); wxPyOORClientData* data = (wxPyOORClientData*)self->GetClientObject();

View File

@@ -86,6 +86,7 @@ class wxMDIChildFrame : public wxFrame {
public: public:
%pythonAppend wxMDIChildFrame "self._setOORInfo(self)" %pythonAppend wxMDIChildFrame "self._setOORInfo(self)"
%pythonAppend wxMDIChildFrame() "" %pythonAppend wxMDIChildFrame() ""
%typemap(out) wxMDIChildFrame*; // turn off this typemap
wxMDIChildFrame(wxMDIParentFrame* parent, wxMDIChildFrame(wxMDIParentFrame* parent,
const wxWindowID id=-1, const wxWindowID id=-1,
@@ -96,6 +97,9 @@ public:
const wxString& name = wxPyFrameNameStr); const wxString& name = wxPyFrameNameStr);
%name(PreMDIChildFrame)wxMDIChildFrame(); %name(PreMDIChildFrame)wxMDIChildFrame();
// Turn it back on again
%typemap(out) wxMDIChildFrame* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxMDIParentFrame* parent, bool Create(wxMDIParentFrame* parent,
const wxWindowID id=-1, const wxWindowID id=-1,
const wxString& title = wxPyEmptyString, const wxString& title = wxPyEmptyString,
@@ -119,10 +123,14 @@ class wxMDIClientWindow : public wxWindow {
public: public:
%pythonAppend wxMDIClientWindow "self._setOORInfo(self)" %pythonAppend wxMDIClientWindow "self._setOORInfo(self)"
%pythonAppend wxMDIClientWindow() "" %pythonAppend wxMDIClientWindow() ""
%typemap(out) wxMDIClientWindow*; // turn off this typemap
wxMDIClientWindow(wxMDIParentFrame* parent, long style = 0); wxMDIClientWindow(wxMDIParentFrame* parent, long style = 0);
%name(PreMDIClientWindow)wxMDIClientWindow(); %name(PreMDIClientWindow)wxMDIClientWindow();
// Turn it back on again
%typemap(out) wxMDIClientWindow* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxMDIParentFrame* parent, long style = 0); bool Create(wxMDIParentFrame* parent, long style = 0);
}; };

View File

@@ -23,8 +23,13 @@ class wxMenu : public wxEvtHandler
{ {
public: public:
%pythonAppend wxMenu "self._setOORInfo(self)" %pythonAppend wxMenu "self._setOORInfo(self)"
%typemap(out) wxMenu*; // turn off this typemap
wxMenu(const wxString& title = wxPyEmptyString, long style = 0); 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) // append any kind of item (normal/check/radio/separator)
wxMenuItem* Append(int id, wxMenuItem* Append(int id,
@@ -211,8 +216,12 @@ class wxMenuBar : public wxWindow
{ {
public: public:
%pythonAppend wxMenuBar "self._setOORInfo(self)" %pythonAppend wxMenuBar "self._setOORInfo(self)"
%typemap(out) wxMenuBar*; // turn off this typemap
wxMenuBar(long style = 0); 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 // append a menu to the end of menubar, return True if ok
virtual bool Append(wxMenu *menu, const wxString& title); virtual bool Append(wxMenu *menu, const wxString& title);

View File

@@ -168,6 +168,7 @@ class wxNotebook : public wxBookCtrl {
public: public:
%pythonAppend wxNotebook "self._setOORInfo(self)" %pythonAppend wxNotebook "self._setOORInfo(self)"
%pythonAppend wxNotebook() "" %pythonAppend wxNotebook() ""
%typemap(out) wxNotebook*; // turn off this typemap
wxNotebook(wxWindow *parent, wxNotebook(wxWindow *parent,
wxWindowID id=-1, wxWindowID id=-1,
@@ -177,6 +178,9 @@ public:
const wxString& name = wxPyNOTEBOOK_NAME); const wxString& name = wxPyNOTEBOOK_NAME);
%name(PreNotebook)wxNotebook(); %name(PreNotebook)wxNotebook();
// Turn it back on again
%typemap(out) wxNotebook* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID id=-1, wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,

View File

@@ -29,6 +29,7 @@ class wxPanel : public wxWindow
public: public:
%pythonAppend wxPanel "self._setOORInfo(self)" %pythonAppend wxPanel "self._setOORInfo(self)"
%pythonAppend wxPanel() "" %pythonAppend wxPanel() ""
%typemap(out) wxPanel*; // turn off this typemap
wxPanel(wxWindow* parent, wxPanel(wxWindow* parent,
const wxWindowID id=-1, const wxWindowID id=-1,
@@ -38,6 +39,9 @@ public:
const wxString& name = wxPyPanelNameStr); const wxString& name = wxPyPanelNameStr);
%name(PrePanel)wxPanel(); %name(PrePanel)wxPanel();
// Turn it back on again
%typemap(out) wxPanel* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxWindow* parent, bool Create(wxWindow* parent,
const wxWindowID id=-1, const wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -66,6 +70,7 @@ class wxScrolledWindow : public wxPanel
public: public:
%pythonAppend wxScrolledWindow "self._setOORInfo(self)" %pythonAppend wxScrolledWindow "self._setOORInfo(self)"
%pythonAppend wxScrolledWindow() "" %pythonAppend wxScrolledWindow() ""
%typemap(out) wxScrolledWindow*; // turn off this typemap
wxScrolledWindow(wxWindow* parent, wxScrolledWindow(wxWindow* parent,
const wxWindowID id = -1, const wxWindowID id = -1,
@@ -75,6 +80,9 @@ public:
const wxString& name = wxPyPanelNameStr); const wxString& name = wxPyPanelNameStr);
%name(PreScrolledWindow)wxScrolledWindow(); %name(PreScrolledWindow)wxScrolledWindow();
// Turn it back on again
%typemap(out) wxScrolledWindow* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxWindow* parent, bool Create(wxWindow* parent,
const wxWindowID id = -1, const wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,

View File

@@ -29,6 +29,7 @@ class wxStaticBox : public wxControl {
public: public:
%pythonAppend wxStaticBox "self._setOORInfo(self)" %pythonAppend wxStaticBox "self._setOORInfo(self)"
%pythonAppend wxStaticBox() "" %pythonAppend wxStaticBox() ""
%typemap(out) wxStaticBox*; // turn off this typemap
wxStaticBox(wxWindow* parent, wxWindowID id=-1, wxStaticBox(wxWindow* parent, wxWindowID id=-1,
const wxString& label = wxPyEmptyString, const wxString& label = wxPyEmptyString,
@@ -38,6 +39,9 @@ public:
const wxString& name = wxPyStaticBoxNameStr); const wxString& name = wxPyStaticBoxNameStr);
%name(PreStaticBox)wxStaticBox(); %name(PreStaticBox)wxStaticBox();
// Turn it back on again
%typemap(out) wxStaticBox* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxWindow* parent, wxWindowID id=-1, bool Create(wxWindow* parent, wxWindowID id=-1,
const wxString& label = wxPyEmptyString, const wxString& label = wxPyEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,

View File

@@ -30,12 +30,16 @@ class wxStatusBar : public wxWindow
public: public:
%pythonAppend wxStatusBar "self._setOORInfo(self)" %pythonAppend wxStatusBar "self._setOORInfo(self)"
%pythonAppend wxStatusBar() "" %pythonAppend wxStatusBar() ""
%typemap(out) wxStatusBar*; // turn off this typemap
wxStatusBar(wxWindow* parent, wxWindowID id = -1, wxStatusBar(wxWindow* parent, wxWindowID id = -1,
long style = wxDEFAULT_STATUSBAR_STYLE, long style = wxDEFAULT_STATUSBAR_STYLE,
const wxString& name = wxPyStatusLineNameStr); const wxString& name = wxPyStatusLineNameStr);
%name(PreStatusBar)wxStatusBar(); %name(PreStatusBar)wxStatusBar();
// Turn it back on again
%typemap(out) wxStatusBar* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxWindow* parent, wxWindowID id=-1, bool Create(wxWindow* parent, wxWindowID id=-1,
long style = wxST_SIZEGRIP, long style = wxST_SIZEGRIP,
const wxString& name = wxPyStatusLineNameStr); const wxString& name = wxPyStatusLineNameStr);

View File

@@ -165,6 +165,7 @@ class wxTextCtrl : public wxControl
public: public:
%pythonAppend wxTextCtrl "self._setOORInfo(self)" %pythonAppend wxTextCtrl "self._setOORInfo(self)"
%pythonAppend wxTextCtrl() "" %pythonAppend wxTextCtrl() ""
%typemap(out) wxTextCtrl*; // turn off this typemap
wxTextCtrl(wxWindow* parent, wxWindowID id=-1, wxTextCtrl(wxWindow* parent, wxWindowID id=-1,
const wxString& value = wxPyEmptyString, const wxString& value = wxPyEmptyString,
@@ -175,6 +176,9 @@ public:
const wxString& name = wxPyTextCtrlNameStr); const wxString& name = wxPyTextCtrlNameStr);
%name(PreTextCtrl)wxTextCtrl(); %name(PreTextCtrl)wxTextCtrl();
// Turn it back on again
%typemap(out) wxTextCtrl* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxWindow* parent, wxWindowID id=-1, bool Create(wxWindow* parent, wxWindowID id=-1,
const wxString& value = wxPyEmptyString, const wxString& value = wxPyEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,

View File

@@ -391,6 +391,7 @@ class wxToolBar : public wxToolBarBase {
public: public:
%pythonAppend wxToolBar "self._setOORInfo(self)" %pythonAppend wxToolBar "self._setOORInfo(self)"
%pythonAppend wxToolBar() "" %pythonAppend wxToolBar() ""
%typemap(out) wxToolBar*; // turn off this typemap
wxToolBar(wxWindow *parent, wxToolBar(wxWindow *parent,
wxWindowID id=-1, wxWindowID id=-1,
@@ -400,6 +401,9 @@ public:
const wxString& name = wxPyToolBarNameStr); const wxString& name = wxPyToolBarNameStr);
%name(PreToolBar)wxToolBar(); %name(PreToolBar)wxToolBar();
// Turn it back on again
%typemap(out) wxToolBar* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxWindow *parent, bool Create(wxWindow *parent,
wxWindowID id=-1, wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,

View File

@@ -151,6 +151,7 @@ class wxFrame : public wxTopLevelWindow {
public: public:
%pythonAppend wxFrame "self._setOORInfo(self)" %pythonAppend wxFrame "self._setOORInfo(self)"
%pythonAppend wxFrame() "" %pythonAppend wxFrame() ""
%typemap(out) wxFrame*; // turn off this typemap
wxFrame(wxWindow* parent, const wxWindowID id=-1, wxFrame(wxWindow* parent, const wxWindowID id=-1,
const wxString& title = wxPyEmptyString, const wxString& title = wxPyEmptyString,
@@ -160,6 +161,10 @@ public:
const wxString& name = wxPyFrameNameStr); const wxString& name = wxPyFrameNameStr);
%name(PreFrame)wxFrame(); %name(PreFrame)wxFrame();
// Turn it back on again
%typemap(out) wxFrame* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxWindow* parent, const wxWindowID id=-1, bool Create(wxWindow* parent, const wxWindowID id=-1,
const wxString& title = wxPyEmptyString, const wxString& title = wxPyEmptyString,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -265,6 +270,7 @@ class wxDialog : public wxTopLevelWindow {
public: public:
%pythonAppend wxDialog "self._setOORInfo(self)" %pythonAppend wxDialog "self._setOORInfo(self)"
%pythonAppend wxDialog() "" %pythonAppend wxDialog() ""
%typemap(out) wxDialog*; // turn off this typemap
wxDialog(wxWindow* parent, wxDialog(wxWindow* parent,
const wxWindowID id=-1, const wxWindowID id=-1,
@@ -275,6 +281,9 @@ public:
const wxString& name = wxPyDialogNameStr); const wxString& name = wxPyDialogNameStr);
%name(PreDialog)wxDialog(); %name(PreDialog)wxDialog();
// Turn it back on again
%typemap(out) wxDialog* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxWindow* parent, bool Create(wxWindow* parent,
const wxWindowID id=-1, const wxWindowID id=-1,
const wxString& title = wxPyEmptyString, const wxString& title = wxPyEmptyString,

View File

@@ -315,6 +315,7 @@ MustHaveApp(wxPyTreeCtrl);
public: public:
%pythonAppend wxPyTreeCtrl "self._setOORInfo(self);self._setCallbackInfo(self, TreeCtrl)" %pythonAppend wxPyTreeCtrl "self._setOORInfo(self);self._setCallbackInfo(self, TreeCtrl)"
%pythonAppend wxPyTreeCtrl() "" %pythonAppend wxPyTreeCtrl() ""
%typemap(out) wxPyTreeCtrl*; // turn off this typemap
wxPyTreeCtrl(wxWindow *parent, wxWindowID id = -1, wxPyTreeCtrl(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -324,6 +325,9 @@ public:
const wxString& name = wxPyTreeCtrlNameStr); const wxString& name = wxPyTreeCtrlNameStr);
%name(PreTreeCtrl)wxPyTreeCtrl(); %name(PreTreeCtrl)wxPyTreeCtrl();
// Turn it back on again
%typemap(out) wxPyTreeCtrl* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxWindow *parent, wxWindowID id = -1, bool Create(wxWindow *parent, wxWindowID id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,

View File

@@ -33,9 +33,14 @@ class wxValidator : public wxEvtHandler
{ {
public: public:
%pythonAppend wxValidator "self._setOORInfo(self)" %pythonAppend wxValidator "self._setOORInfo(self)"
%typemap(out) wxValidator*; // turn off this typemap
wxValidator(); wxValidator();
//~wxValidator(); //~wxValidator();
// Turn it back on again
%typemap(out) wxValidator* { $result = wxPyMake_wxObject($1, $owner); }
// Make a clone of this validator (or return NULL) // Make a clone of this validator (or return NULL)
wxValidator* Clone(); wxValidator* Clone();

View File

@@ -199,6 +199,7 @@ class wxWindow : public wxEvtHandler
public: public:
%pythonAppend wxWindow "self._setOORInfo(self)" %pythonAppend wxWindow "self._setOORInfo(self)"
%pythonAppend wxWindow() "" %pythonAppend wxWindow() ""
%typemap(out) wxWindow*; // turn off this typemap
DocCtorStr( DocCtorStr(
wxWindow(wxWindow* parent, const wxWindowID id=-1, wxWindow(wxWindow* parent, const wxWindowID id=-1,
@@ -213,6 +214,9 @@ public:
"Precreate a Window for 2-phase creation.", "", "Precreate a Window for 2-phase creation.", "",
PreWindow); PreWindow);
// Turn it back on again
%typemap(out) wxWindow* { $result = wxPyMake_wxObject($1, $owner); }
DocDeclStr( DocDeclStr(
bool , Create(wxWindow* parent, const wxWindowID id=-1, bool , Create(wxWindow* parent, const wxWindowID id=-1,

View File

@@ -1592,6 +1592,7 @@ class wxGrid : public wxScrolledWindow
{ {
public: public:
%pythonAppend wxGrid "self._setOORInfo(self)" %pythonAppend wxGrid "self._setOORInfo(self)"
%typemap(out) wxGrid*; // turn off this typemap
wxGrid( wxWindow *parent, wxGrid( wxWindow *parent,
wxWindowID id=-1, wxWindowID id=-1,
@@ -1603,6 +1604,10 @@ public:
%name(PreGrid) wxGrid(); %name(PreGrid) wxGrid();
// Turn it back on again
%typemap(out) wxGrid* { $result = wxPyMake_wxObject($1, $owner); }
bool Create( wxWindow *parent, bool Create( wxWindow *parent,
wxWindowID id=-1, wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,

View File

@@ -791,6 +791,7 @@ MustHaveApp(wxPyHtmlWindow);
public: public:
%pythonAppend wxPyHtmlWindow "self._setCallbackInfo(self, HtmlWindow); self._setOORInfo(self)" %pythonAppend wxPyHtmlWindow "self._setCallbackInfo(self, HtmlWindow); self._setOORInfo(self)"
%pythonAppend wxPyHtmlWindow() "" %pythonAppend wxPyHtmlWindow() ""
%typemap(out) wxPyHtmlWindow*; // turn off this typemap
wxPyHtmlWindow(wxWindow *parent, int id = -1, wxPyHtmlWindow(wxWindow *parent, int id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
@@ -799,6 +800,9 @@ public:
const wxString& name = wxPyHtmlWindowNameStr); const wxString& name = wxPyHtmlWindowNameStr);
%name(PreHtmlWindow)wxPyHtmlWindow(); %name(PreHtmlWindow)wxPyHtmlWindow();
// Turn it back on again
%typemap(out) wxPyHtmlWindow* { $result = wxPyMake_wxObject($1, $owner); }
bool Create(wxWindow *parent, int id = -1, bool Create(wxWindow *parent, int id = -1,
const wxPoint& pos = wxDefaultPosition, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, const wxSize& size = wxDefaultSize,

View File

@@ -340,6 +340,9 @@ SWIG_AsDouble(PyObject *obj)
// to the real derived type, if possible. See wxPyMake_wxObject in // to the real derived type, if possible. See wxPyMake_wxObject in
// helpers.cpp // 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) wxEvtHandler* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxMenu* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxMenu* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxValidator* { $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) wxDC* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxFSFile* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxFSFile* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxFileSystem* { $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) wxImageList* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxListItem* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxListItem* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxMenuItem* { $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) wxControl* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxFrame* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxFrame* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxGrid* { $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) wxMDIChildFrame* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxMDIClientWindow* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxMDIClientWindow* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxMenuBar* { $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) wxTextCtrl* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxToolBar* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxToolBar* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxToolBarBase* { $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) wxPyTreeCtrl* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxWindow* { $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) wxPyHtmlWindow* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxWizardPage* { $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) wxPanel* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxDialog* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxDialog* { $result = wxPyMake_wxObject($1, $owner); }
%typemap(out) wxScrolledWindow* { $result = wxPyMake_wxObject($1, $owner); } %typemap(out) wxScrolledWindow* { $result = wxPyMake_wxObject($1, $owner); }

View File

@@ -207,6 +207,7 @@ public:
%pythonAppend wxPyWizardPage "self._setCallbackInfo(self, PyWizardPage);self._setOORInfo(self)" %pythonAppend wxPyWizardPage "self._setCallbackInfo(self, PyWizardPage);self._setOORInfo(self)"
%pythonAppend wxPyWizardPage() "" %pythonAppend wxPyWizardPage() ""
%typemap(out) wxPyWizardPage*; // turn off this typemap
// ctor accepts an optional bitmap which will be used for this page instead // 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 // of the default one for this wizard (should be of the same size). Notice
@@ -225,6 +226,9 @@ public:
%name(PrePyWizardPage)wxPyWizardPage(); %name(PrePyWizardPage)wxPyWizardPage();
// Turn it back on again
%typemap(out) wxPyWizardPage* { $result = wxPyMake_wxObject($1, $owner); }
%extend { %extend {
bool Create(wxWizard *parent, bool Create(wxWizard *parent,
const wxBitmap& bitmap = wxNullBitmap, const wxBitmap& bitmap = wxNullBitmap,