X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0122b7e3fcfd78f879470053c91a60e3c66537a3..4e1c35f810f574af79e649fa37171dfa7fc775ee:/wxPython/src/cmndlgs.i diff --git a/wxPython/src/cmndlgs.i b/wxPython/src/cmndlgs.i index 8b4252a4ed..5ab14a8693 100644 --- a/wxPython/src/cmndlgs.i +++ b/wxPython/src/cmndlgs.i @@ -38,6 +38,18 @@ //---------------------------------------------------------------------- +%{ + // Put some wx default wxChar* values into wxStrings. + DECLARE_DEF_STRING(FileSelectorPromptStr); + DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr); + DECLARE_DEF_STRING(GetTextFromUserPromptStr); + DECLARE_DEF_STRING(MessageBoxCaptionStr); + static const wxString wxPyEmptyString(wxT("")); + +%} + +//---------------------------------------------------------------------- + class wxColourData : public wxObject { public: wxColourData(); @@ -68,8 +80,8 @@ public: class wxDirDialog : public wxDialog { public: wxDirDialog(wxWindow* parent, - char* message = "Choose a directory", - char* defaultPath = "", + const wxString& message = wxPyFileSelectorPromptStr, + const wxString& defaultPath = wxPyEmptyString, long style = 0, const wxPoint& pos = wxDefaultPosition); @@ -83,15 +95,16 @@ public: int ShowModal(); }; + //---------------------------------------------------------------------- class wxFileDialog : public wxDialog { public: wxFileDialog(wxWindow* parent, - char* message = "Choose a file", - char* defaultDir = "", - char* defaultFile = "", - char* wildcard = "*.*", + const wxString& message = wxPyFileSelectorPromptStr, + const wxString& defaultDir = wxPyEmptyString, + const wxString& defaultFile = wxPyEmptyString, + const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr, long style = 0, const wxPoint& pos = wxDefaultPosition); @@ -117,25 +130,13 @@ public: PyObject* GetFilenames() { wxArrayString arr; self->GetFilenames(arr); - size_t count = arr.GetCount(); - PyObject* listObj = PyList_New(0); - for(size_t x=0; xGetPaths(arr); - size_t count = arr.GetCount(); - PyObject* listObj = PyList_New(0); - for(size_t x=0; xGetSelections()); + } + } +}; + //---------------------------------------------------------------------- @@ -157,7 +181,7 @@ public: wxString* caption, int LCOUNT, wxString* choices, //char** clientData = NULL, - long style = wxOK | wxCANCEL | wxCENTRE, + long style = wxCHOICEDLG_STYLE, wxPoint* pos = &wxDefaultPosition) { return new wxSingleChoiceDialog(parent, *message, *caption, LCOUNT, choices, NULL, style, *pos); @@ -178,9 +202,9 @@ public: class wxTextEntryDialog : public wxDialog { public: wxTextEntryDialog(wxWindow* parent, - char* message, - char* caption = "Input Text", - char* defaultValue = "", + const wxString& message, + const wxString& caption = wxPyGetTextFromUserPromptStr, + const wxString& defaultValue = wxPyEmptyString, long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint& pos = wxDefaultPosition); @@ -229,8 +253,8 @@ public: class wxMessageDialog : public wxDialog { public: wxMessageDialog(wxWindow* parent, - char* message, - char* caption = "Message box", + const wxString& message, + const wxString& caption = wxPyMessageBoxCaptionStr, long style = wxOK | wxCANCEL | wxCENTRE, const wxPoint& pos = wxDefaultPosition); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" @@ -249,7 +273,7 @@ public: int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL ); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - bool Update(int value = -1, const char* newmsg = NULL); + bool Update(int value, const wxString& newmsg = wxPyEmptyString); void Resume(); } @@ -354,7 +378,7 @@ public: int style = 0); %pragma(python) addtomethod = "__init__:self._setOORInfo(self)" - %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(self)" + %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(val)" const wxFindReplaceData *GetData(); void SetData(wxFindReplaceData *data);