Some unicode fixes for the wxWisard wrappers

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2002-08-28 01:38:29 +00:00
parent 3efe95494d
commit dd4a4b90f5
2 changed files with 101 additions and 21 deletions

View File

@@ -30,6 +30,11 @@
%import controls.i
//----------------------------------------------------------------------
%{
// Put some wx default wxChar* values into wxStrings.
static const wxString wxPyEmptyString(wxT(""));
%}
//----------------------------------------------------------------------
enum {
@@ -97,9 +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);
}
}
// these functions are used by the wizard to show another page when the
// user chooses "Back" or "Next" button
@@ -197,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)"