X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/85260f24dea6546ecfff376bac1d8838237ec2fe..94bc8b14d4f74c5bb831b0eca20a45c751fbb5fe:/wxPython/src/wizard.i diff --git a/wxPython/src/wizard.i b/wxPython/src/wizard.i index b53e3d313c..f3a4bed4ac 100644 --- a/wxPython/src/wizard.i +++ b/wxPython/src/wizard.i @@ -30,6 +30,11 @@ %import controls.i +//---------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + static const wxString wxPyEmptyString(wxT("")); +%} //---------------------------------------------------------------------- enum { @@ -97,12 +102,17 @@ public: // const char* resource = NULL); // %name(wxPreWizardPage)wxWizardPage(); - bool Create(wxWizard *parent, - const wxBitmap& bitmap = wxNullBitmap, - const char* resource = NULL); + %addmethods { + bool Create(wxWizard *parent, + const wxBitmap& bitmap = wxNullBitmap, + const wxString& resource = wxPyEmptyString) { + wxChar* res = NULL; + if (resource.Length()) + res = (wxChar*)resource.c_str(); + return self->Create(parent, bitmap, res); + } + } - // common part of ctors: - void Init(); // these functions are used by the wizard to show another page when the // user chooses "Back" or "Next" button @@ -200,14 +210,29 @@ public: // of the default one for this wizard (should be of the same size). Notice // that no other parameters are needed because the wizard will resize and // reposition the page anyhow - wxPyWizardPage(wxWizard *parent, - const wxBitmap& bitmap = wxNullBitmap, - const char* resource = NULL); + %addmethods { + wxPyWizardPage(wxWizard *parent, + const wxBitmap* bitmap = &wxNullBitmap, + const wxString* resource = &wxPyEmptyString) { + wxChar* res = NULL; + if (resource->Length()) + res = (wxChar*)resource->c_str(); + return new wxPyWizardPage(parent, *bitmap, res); + } + } + %name(wxPrePyWizardPage)wxPyWizardPage(); - bool Create(wxWizard *parent, - const wxBitmap& bitmap = wxNullBitmap, - const char* resource = NULL); + %addmethods { + bool Create(wxWizard *parent, + const wxBitmap& bitmap = wxNullBitmap, + const wxString& resource = wxPyEmptyString) { + wxChar* res = NULL; + if (resource.Length()) + res = (wxChar*)resource.c_str(); + return self->Create(parent, bitmap, res); + } + } void _setCallbackInfo(PyObject* self, PyObject* _class); %pragma(python) addtomethod = "__init__:self._setCallbackInfo(self, wxPyWizardPage)" @@ -270,9 +295,6 @@ public: %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" %pragma(python) addtomethod = "wxPreWizardPageSimple:val._setOORInfo(val)" - // common part of ctors: - void Init(); - // the pointers may be also set later - but before starting the wizard void SetPrev(wxWizardPage *prev); void SetNext(wxWizardPage *next);