1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG definitions for the Common Dialog Classes
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
17 #include <wx/colordlg.h>
18 #include <wx/dirdlg.h>
19 #include <wx/fontdlg.h>
20 #include <wx/progdlg.h>
21 #include <wx/fdrepdlg.h>
24 //----------------------------------------------------------------------
27 %include my_typemaps.i
29 // Import some definitions of other classes, etc.
37 %pragma(python) code = "import wx"
39 //----------------------------------------------------------------------
42 // Put some wx default wxChar* values into wxStrings.
43 DECLARE_DEF_STRING(FileSelectorPromptStr);
44 DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr);
45 DECLARE_DEF_STRING(GetTextFromUserPromptStr);
46 DECLARE_DEF_STRING(MessageBoxCaptionStr);
47 static const wxString wxPyEmptyString(wxT(""));
51 //----------------------------------------------------------------------
53 class wxColourData : public wxObject {
60 wxColour GetCustomColour(int i);
61 void SetChooseFull(int flag);
62 void SetColour(const wxColour& colour);
63 void SetCustomColour(int i, const wxColour& colour);
67 class wxColourDialog : public wxDialog {
69 wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
71 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
73 wxColourData& GetColourData();
78 //----------------------------------------------------------------------
80 class wxDirDialog : public wxDialog {
82 wxDirDialog(wxWindow* parent,
83 const wxString& message = wxPyFileSelectorPromptStr,
84 const wxString& defaultPath = wxPyEmptyString,
86 const wxPoint& pos = wxDefaultPosition);
88 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
91 wxString GetMessage();
93 void SetMessage(const wxString& message);
94 void SetPath(const wxString& path);
99 //----------------------------------------------------------------------
101 class wxFileDialog : public wxDialog {
103 wxFileDialog(wxWindow* parent,
104 const wxString& message = wxPyFileSelectorPromptStr,
105 const wxString& defaultDir = wxPyEmptyString,
106 const wxString& defaultFile = wxPyEmptyString,
107 const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
109 const wxPoint& pos = wxDefaultPosition);
111 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
113 wxString GetDirectory();
114 wxString GetFilename();
115 int GetFilterIndex();
116 wxString GetMessage();
119 wxString GetWildcard();
120 void SetDirectory(const wxString& directory);
121 void SetFilename(const wxString& setfilename);
122 void SetFilterIndex(int filterIndex);
123 void SetMessage(const wxString& message);
124 void SetPath(const wxString& path);
125 void SetStyle(long style);
126 void SetWildcard(const wxString& wildCard);
130 PyObject* GetFilenames() {
132 self->GetFilenames(arr);
133 return wxArrayString2PyList_helper(arr);
136 PyObject* GetPaths() {
139 return wxArrayString2PyList_helper(arr);
145 //----------------------------------------------------------------------
147 enum { wxCHOICEDLG_STYLE };
149 class wxMultiChoiceDialog : public wxDialog
152 wxMultiChoiceDialog(wxWindow *parent,
153 const wxString& message,
154 const wxString& caption,
155 int LCOUNT, wxString *choices,
156 long style = wxCHOICEDLG_STYLE,
157 const wxPoint& pos = wxDefaultPosition);
159 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
161 void SetSelections(const wxArrayInt& selections);
163 // wxArrayInt GetSelections() const;
165 PyObject* GetSelections() {
166 return wxArrayInt2PyList_helper(self->GetSelections());
172 //----------------------------------------------------------------------
174 class wxSingleChoiceDialog : public wxDialog {
177 // TODO: ignoring clientData for now...
178 // SWIG is messing up the &/*'s for some reason.
179 wxSingleChoiceDialog(wxWindow* parent,
182 int LCOUNT, wxString* choices,
183 //char** clientData = NULL,
184 long style = wxCHOICEDLG_STYLE,
185 wxPoint* pos = &wxDefaultPosition) {
186 return new wxSingleChoiceDialog(parent, *message, *caption,
187 LCOUNT, choices, NULL, style, *pos);
189 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
194 wxString GetStringSelection();
195 void SetSelection(int sel);
200 //----------------------------------------------------------------------
202 class wxTextEntryDialog : public wxDialog {
204 wxTextEntryDialog(wxWindow* parent,
205 const wxString& message,
206 const wxString& caption = wxPyGetTextFromUserPromptStr,
207 const wxString& defaultValue = wxPyEmptyString,
208 long style = wxOK | wxCANCEL | wxCENTRE,
209 const wxPoint& pos = wxDefaultPosition);
211 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
214 void SetValue(const wxString& value);
218 //----------------------------------------------------------------------
220 class wxFontData : public wxObject {
225 void EnableEffects(bool enable);
226 bool GetAllowSymbols();
227 wxColour GetColour();
228 wxFont GetChosenFont();
229 bool GetEnableEffects();
230 wxFont GetInitialFont();
232 void SetAllowSymbols(bool allowSymbols);
233 void SetChosenFont(const wxFont& font);
234 void SetColour(const wxColour& colour);
235 void SetInitialFont(const wxFont& font);
236 void SetRange(int min, int max);
237 void SetShowHelp(bool showHelp);
241 class wxFontDialog : public wxDialog {
243 wxFontDialog(wxWindow* parent, wxFontData* data);
244 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
246 wxFontData& GetFontData();
251 //----------------------------------------------------------------------
253 class wxMessageDialog : public wxDialog {
255 wxMessageDialog(wxWindow* parent,
256 const wxString& message,
257 const wxString& caption = wxPyMessageBoxCaptionStr,
258 long style = wxOK | wxCANCEL | wxCENTRE,
259 const wxPoint& pos = wxDefaultPosition);
260 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
265 //----------------------------------------------------------------------
267 class wxProgressDialog : public wxFrame {
269 wxProgressDialog(const wxString& title,
270 const wxString& message,
272 wxWindow* parent = NULL,
273 int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL );
274 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
276 bool Update(int value, const wxString& newmsg = wxPyEmptyString);
280 //----------------------------------------------------------------------
282 enum wxFindReplaceFlags
284 // downward search/replace selected (otherwise - upwards)
287 // whole word search/replace selected
290 // case sensitive search/replace selected (otherwise - case insensitive)
295 enum wxFindReplaceDialogStyles
297 // replace dialog (otherwise find dialog)
298 wxFR_REPLACEDIALOG = 1,
300 // don't allow changing the search direction
303 // don't allow case sensitive searching
304 wxFR_NOMATCHCASE = 4,
306 // don't allow whole word searching
312 wxEVT_COMMAND_FIND_NEXT,
313 wxEVT_COMMAND_FIND_REPLACE,
314 wxEVT_COMMAND_FIND_REPLACE_ALL,
315 wxEVT_COMMAND_FIND_CLOSE,
318 %pragma(python) code = "
320 def EVT_COMMAND_FIND(win, id, func):
321 win.Connect(id, -1, wxEVT_COMMAND_FIND, func)
323 def EVT_COMMAND_FIND_NEXT(win, id, func):
324 win.Connect(id, -1, wxEVT_COMMAND_FIND_NEXT, func)
326 def EVT_COMMAND_FIND_REPLACE(win, id, func):
327 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE, func)
329 def EVT_COMMAND_FIND_REPLACE_ALL(win, id, func):
330 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE_ALL, func)
332 def EVT_COMMAND_FIND_CLOSE(win, id, func):
333 win.Connect(id, -1, wxEVT_COMMAND_FIND_CLOSE, func)
337 class wxFindDialogEvent : public wxCommandEvent
340 wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
342 wxString GetFindString();
343 const wxString& GetReplaceString();
344 wxFindReplaceDialog *GetDialog();
345 void SetFlags(int flags);
346 void SetFindString(const wxString& str);
347 void SetReplaceString(const wxString& str);
352 class wxFindReplaceData : public wxObject
355 wxFindReplaceData(int flags=0);
356 ~wxFindReplaceData();
358 const wxString& GetFindString();
359 const wxString& GetReplaceString();
361 void SetFlags(int flags);
362 void SetFindString(const wxString& str);
363 void SetReplaceString(const wxString& str);
367 class wxFindReplaceDialog : public wxDialog {
369 wxFindReplaceDialog(wxWindow *parent,
370 wxFindReplaceData *data,
371 const wxString &title,
373 %name(wxPreFindReplaceDialog)wxFindReplaceDialog();
375 bool Create(wxWindow *parent,
376 wxFindReplaceData *data,
377 const wxString &title,
380 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
381 %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(val)"
383 const wxFindReplaceData *GetData();
384 void SetData(wxFindReplaceData *data);
387 //----------------------------------------------------------------------