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 //----------------------------------------------------------------------
41 class wxColourData : public wxObject {
48 wxColour GetCustomColour(int i);
49 void SetChooseFull(int flag);
50 void SetColour(const wxColour& colour);
51 void SetCustomColour(int i, const wxColour& colour);
55 class wxColourDialog : public wxDialog {
57 wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
59 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
61 wxColourData& GetColourData();
66 //----------------------------------------------------------------------
68 class wxDirDialog : public wxDialog {
70 wxDirDialog(wxWindow* parent,
71 char* message = "Choose a directory",
72 char* defaultPath = "",
74 const wxPoint& pos = wxDefaultPosition);
76 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
79 wxString GetMessage();
81 void SetMessage(const wxString& message);
82 void SetPath(const wxString& path);
86 //----------------------------------------------------------------------
88 class wxFileDialog : public wxDialog {
90 wxFileDialog(wxWindow* parent,
91 char* message = "Choose a file",
92 char* defaultDir = "",
93 char* defaultFile = "",
94 char* wildcard = "*.*",
96 const wxPoint& pos = wxDefaultPosition);
98 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
100 wxString GetDirectory();
101 wxString GetFilename();
102 int GetFilterIndex();
103 wxString GetMessage();
106 wxString GetWildcard();
107 void SetDirectory(const wxString& directory);
108 void SetFilename(const wxString& setfilename);
109 void SetFilterIndex(int filterIndex);
110 void SetMessage(const wxString& message);
111 void SetPath(const wxString& path);
112 void SetStyle(long style);
113 void SetWildcard(const wxString& wildCard);
117 PyObject* GetFilenames() {
119 self->GetFilenames(arr);
120 return wxArrayString2PyList_helper(arr);
123 PyObject* GetPaths() {
126 return wxArrayString2PyList_helper(arr);
132 //----------------------------------------------------------------------
134 //TODO: wxMultipleChoiceDialog
136 //----------------------------------------------------------------------
138 class wxSingleChoiceDialog : public wxDialog {
141 // TODO: ignoring clientData for now...
142 // SWIG is messing up the &/*'s for some reason.
143 wxSingleChoiceDialog(wxWindow* parent,
146 int LCOUNT, wxString* choices,
147 //char** clientData = NULL,
148 long style = wxOK | wxCANCEL | wxCENTRE,
149 wxPoint* pos = &wxDefaultPosition) {
150 return new wxSingleChoiceDialog(parent, *message, *caption,
151 LCOUNT, choices, NULL, style, *pos);
153 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
158 wxString GetStringSelection();
159 void SetSelection(int sel);
164 //----------------------------------------------------------------------
166 class wxTextEntryDialog : public wxDialog {
168 wxTextEntryDialog(wxWindow* parent,
170 char* caption = "Input Text",
171 char* defaultValue = "",
172 long style = wxOK | wxCANCEL | wxCENTRE,
173 const wxPoint& pos = wxDefaultPosition);
175 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
178 void SetValue(const wxString& value);
182 //----------------------------------------------------------------------
184 class wxFontData : public wxObject {
189 void EnableEffects(bool enable);
190 bool GetAllowSymbols();
191 wxColour GetColour();
192 wxFont GetChosenFont();
193 bool GetEnableEffects();
194 wxFont GetInitialFont();
196 void SetAllowSymbols(bool allowSymbols);
197 void SetChosenFont(const wxFont& font);
198 void SetColour(const wxColour& colour);
199 void SetInitialFont(const wxFont& font);
200 void SetRange(int min, int max);
201 void SetShowHelp(bool showHelp);
205 class wxFontDialog : public wxDialog {
207 wxFontDialog(wxWindow* parent, wxFontData* data);
208 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
210 wxFontData& GetFontData();
215 //----------------------------------------------------------------------
217 class wxMessageDialog : public wxDialog {
219 wxMessageDialog(wxWindow* parent,
221 char* caption = "Message box",
222 long style = wxOK | wxCANCEL | wxCENTRE,
223 const wxPoint& pos = wxDefaultPosition);
224 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
229 //----------------------------------------------------------------------
231 class wxProgressDialog : public wxFrame {
233 wxProgressDialog(const wxString& title,
234 const wxString& message,
236 wxWindow* parent = NULL,
237 int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL );
238 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
240 bool Update(int value = -1, const char* newmsg = NULL);
244 //----------------------------------------------------------------------
246 enum wxFindReplaceFlags
248 // downward search/replace selected (otherwise - upwards)
251 // whole word search/replace selected
254 // case sensitive search/replace selected (otherwise - case insensitive)
259 enum wxFindReplaceDialogStyles
261 // replace dialog (otherwise find dialog)
262 wxFR_REPLACEDIALOG = 1,
264 // don't allow changing the search direction
267 // don't allow case sensitive searching
268 wxFR_NOMATCHCASE = 4,
270 // don't allow whole word searching
276 wxEVT_COMMAND_FIND_NEXT,
277 wxEVT_COMMAND_FIND_REPLACE,
278 wxEVT_COMMAND_FIND_REPLACE_ALL,
279 wxEVT_COMMAND_FIND_CLOSE,
282 %pragma(python) code = "
284 def EVT_COMMAND_FIND(win, id, func):
285 win.Connect(id, -1, wxEVT_COMMAND_FIND, func)
287 def EVT_COMMAND_FIND_NEXT(win, id, func):
288 win.Connect(id, -1, wxEVT_COMMAND_FIND_NEXT, func)
290 def EVT_COMMAND_FIND_REPLACE(win, id, func):
291 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE, func)
293 def EVT_COMMAND_FIND_REPLACE_ALL(win, id, func):
294 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE_ALL, func)
296 def EVT_COMMAND_FIND_CLOSE(win, id, func):
297 win.Connect(id, -1, wxEVT_COMMAND_FIND_CLOSE, func)
301 class wxFindDialogEvent : public wxCommandEvent
304 wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
306 wxString GetFindString();
307 const wxString& GetReplaceString();
308 wxFindReplaceDialog *GetDialog();
309 void SetFlags(int flags);
310 void SetFindString(const wxString& str);
311 void SetReplaceString(const wxString& str);
316 class wxFindReplaceData : public wxObject
319 wxFindReplaceData(int flags=0);
320 ~wxFindReplaceData();
322 const wxString& GetFindString();
323 const wxString& GetReplaceString();
325 void SetFlags(int flags);
326 void SetFindString(const wxString& str);
327 void SetReplaceString(const wxString& str);
331 class wxFindReplaceDialog : public wxDialog {
333 wxFindReplaceDialog(wxWindow *parent,
334 wxFindReplaceData *data,
335 const wxString &title,
337 %name(wxPreFindReplaceDialog)wxFindReplaceDialog();
339 bool Create(wxWindow *parent,
340 wxFindReplaceData *data,
341 const wxString &title,
344 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
345 %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(val)"
347 const wxFindReplaceData *GetData();
348 void SetData(wxFindReplaceData *data);
351 //----------------------------------------------------------------------