]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/cmndlgs.i
cleaned a bit of mess in wxX11
[wxWidgets.git] / wxPython / src / cmndlgs.i
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: cmndlgs.i
3 // Purpose: SWIG definitions for the Common Dialog Classes
4 //
5 // Author: Robin Dunn
6 //
7 // Created: 7/25/98
8 // RCS-ID: $Id$
9 // Copyright: (c) 1998 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
12
13 %module cmndlgs
14
15 %{
16 #include "helpers.h"
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>
22 %}
23
24 //----------------------------------------------------------------------
25
26 %include typemaps.i
27 %include my_typemaps.i
28
29 // Import some definitions of other classes, etc.
30 %import _defs.i
31 %import misc.i
32 %import gdi.i
33 %import windows.i
34 %import events.i
35 %import frames.i
36
37 %pragma(python) code = "import wx"
38
39 //----------------------------------------------------------------------
40
41 class wxColourData : public wxObject {
42 public:
43 wxColourData();
44 ~wxColourData();
45
46 bool GetChooseFull();
47 wxColour GetColour();
48 wxColour GetCustomColour(int i);
49 void SetChooseFull(int flag);
50 void SetColour(const wxColour& colour);
51 void SetCustomColour(int i, const wxColour& colour);
52 };
53
54
55 class wxColourDialog : public wxDialog {
56 public:
57 wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
58
59 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
60
61 wxColourData& GetColourData();
62 int ShowModal();
63 };
64
65
66 //----------------------------------------------------------------------
67
68 class wxDirDialog : public wxDialog {
69 public:
70 wxDirDialog(wxWindow* parent,
71 char* message = "Choose a directory",
72 char* defaultPath = "",
73 long style = 0,
74 const wxPoint& pos = wxDefaultPosition);
75
76 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
77
78 wxString GetPath();
79 wxString GetMessage();
80 long GetStyle();
81 void SetMessage(const wxString& message);
82 void SetPath(const wxString& path);
83 int ShowModal();
84 };
85
86
87 //----------------------------------------------------------------------
88
89 class wxFileDialog : public wxDialog {
90 public:
91 wxFileDialog(wxWindow* parent,
92 char* message = "Choose a file",
93 char* defaultDir = "",
94 char* defaultFile = "",
95 char* wildcard = "*.*",
96 long style = 0,
97 const wxPoint& pos = wxDefaultPosition);
98
99 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
100
101 wxString GetDirectory();
102 wxString GetFilename();
103 int GetFilterIndex();
104 wxString GetMessage();
105 wxString GetPath();
106 long GetStyle();
107 wxString GetWildcard();
108 void SetDirectory(const wxString& directory);
109 void SetFilename(const wxString& setfilename);
110 void SetFilterIndex(int filterIndex);
111 void SetMessage(const wxString& message);
112 void SetPath(const wxString& path);
113 void SetStyle(long style);
114 void SetWildcard(const wxString& wildCard);
115 int ShowModal();
116
117 %addmethods {
118 PyObject* GetFilenames() {
119 wxArrayString arr;
120 self->GetFilenames(arr);
121 return wxArrayString2PyList_helper(arr);
122 }
123
124 PyObject* GetPaths() {
125 wxArrayString arr;
126 self->GetPaths(arr);
127 return wxArrayString2PyList_helper(arr);
128 }
129 }
130 };
131
132
133 //----------------------------------------------------------------------
134
135 enum { wxCHOICEDLG_STYLE };
136
137 class wxMultiChoiceDialog : public wxDialog
138 {
139 public:
140 wxMultiChoiceDialog(wxWindow *parent,
141 const wxString& message,
142 const wxString& caption,
143 int LCOUNT, wxString *choices,
144 long style = wxCHOICEDLG_STYLE,
145 const wxPoint& pos = wxDefaultPosition);
146
147 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
148
149 void SetSelections(const wxArrayInt& selections);
150
151 // wxArrayInt GetSelections() const;
152 %addmethods {
153 PyObject* GetSelections() {
154 return wxArrayInt2PyList_helper(self->GetSelections());
155 }
156 }
157 };
158
159
160 //----------------------------------------------------------------------
161
162 class wxSingleChoiceDialog : public wxDialog {
163 public:
164 %addmethods {
165 // TODO: ignoring clientData for now...
166 // SWIG is messing up the &/*'s for some reason.
167 wxSingleChoiceDialog(wxWindow* parent,
168 wxString* message,
169 wxString* caption,
170 int LCOUNT, wxString* choices,
171 //char** clientData = NULL,
172 long style = wxCHOICEDLG_STYLE,
173 wxPoint* pos = &wxDefaultPosition) {
174 return new wxSingleChoiceDialog(parent, *message, *caption,
175 LCOUNT, choices, NULL, style, *pos);
176 }
177 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
178
179 }
180
181 int GetSelection();
182 wxString GetStringSelection();
183 void SetSelection(int sel);
184 int ShowModal();
185 };
186
187
188 //----------------------------------------------------------------------
189
190 class wxTextEntryDialog : public wxDialog {
191 public:
192 wxTextEntryDialog(wxWindow* parent,
193 char* message,
194 char* caption = "Input Text",
195 char* defaultValue = "",
196 long style = wxOK | wxCANCEL | wxCENTRE,
197 const wxPoint& pos = wxDefaultPosition);
198
199 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
200
201 wxString GetValue();
202 void SetValue(const wxString& value);
203 int ShowModal();
204 };
205
206 //----------------------------------------------------------------------
207
208 class wxFontData : public wxObject {
209 public:
210 wxFontData();
211 ~wxFontData();
212
213 void EnableEffects(bool enable);
214 bool GetAllowSymbols();
215 wxColour GetColour();
216 wxFont GetChosenFont();
217 bool GetEnableEffects();
218 wxFont GetInitialFont();
219 bool GetShowHelp();
220 void SetAllowSymbols(bool allowSymbols);
221 void SetChosenFont(const wxFont& font);
222 void SetColour(const wxColour& colour);
223 void SetInitialFont(const wxFont& font);
224 void SetRange(int min, int max);
225 void SetShowHelp(bool showHelp);
226 };
227
228
229 class wxFontDialog : public wxDialog {
230 public:
231 wxFontDialog(wxWindow* parent, wxFontData* data);
232 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
233
234 wxFontData& GetFontData();
235 int ShowModal();
236 };
237
238
239 //----------------------------------------------------------------------
240
241 class wxMessageDialog : public wxDialog {
242 public:
243 wxMessageDialog(wxWindow* parent,
244 char* message,
245 char* caption = "Message box",
246 long style = wxOK | wxCANCEL | wxCENTRE,
247 const wxPoint& pos = wxDefaultPosition);
248 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
249
250 int ShowModal();
251 };
252
253 //----------------------------------------------------------------------
254
255 class wxProgressDialog : public wxFrame {
256 public:
257 wxProgressDialog(const wxString& title,
258 const wxString& message,
259 int maximum = 100,
260 wxWindow* parent = NULL,
261 int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL );
262 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
263
264 bool Update(int value = -1, const char* newmsg = NULL);
265 void Resume();
266 }
267
268 //----------------------------------------------------------------------
269
270 enum wxFindReplaceFlags
271 {
272 // downward search/replace selected (otherwise - upwards)
273 wxFR_DOWN = 1,
274
275 // whole word search/replace selected
276 wxFR_WHOLEWORD = 2,
277
278 // case sensitive search/replace selected (otherwise - case insensitive)
279 wxFR_MATCHCASE = 4
280 };
281
282
283 enum wxFindReplaceDialogStyles
284 {
285 // replace dialog (otherwise find dialog)
286 wxFR_REPLACEDIALOG = 1,
287
288 // don't allow changing the search direction
289 wxFR_NOUPDOWN = 2,
290
291 // don't allow case sensitive searching
292 wxFR_NOMATCHCASE = 4,
293
294 // don't allow whole word searching
295 wxFR_NOWHOLEWORD = 8
296 };
297
298 enum {
299 wxEVT_COMMAND_FIND,
300 wxEVT_COMMAND_FIND_NEXT,
301 wxEVT_COMMAND_FIND_REPLACE,
302 wxEVT_COMMAND_FIND_REPLACE_ALL,
303 wxEVT_COMMAND_FIND_CLOSE,
304 };
305
306 %pragma(python) code = "
307
308 def EVT_COMMAND_FIND(win, id, func):
309 win.Connect(id, -1, wxEVT_COMMAND_FIND, func)
310
311 def EVT_COMMAND_FIND_NEXT(win, id, func):
312 win.Connect(id, -1, wxEVT_COMMAND_FIND_NEXT, func)
313
314 def EVT_COMMAND_FIND_REPLACE(win, id, func):
315 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE, func)
316
317 def EVT_COMMAND_FIND_REPLACE_ALL(win, id, func):
318 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE_ALL, func)
319
320 def EVT_COMMAND_FIND_CLOSE(win, id, func):
321 win.Connect(id, -1, wxEVT_COMMAND_FIND_CLOSE, func)
322
323 "
324
325 class wxFindDialogEvent : public wxCommandEvent
326 {
327 public:
328 wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
329 int GetFlags();
330 wxString GetFindString();
331 const wxString& GetReplaceString();
332 wxFindReplaceDialog *GetDialog();
333 void SetFlags(int flags);
334 void SetFindString(const wxString& str);
335 void SetReplaceString(const wxString& str);
336 };
337
338
339
340 class wxFindReplaceData : public wxObject
341 {
342 public:
343 wxFindReplaceData(int flags=0);
344 ~wxFindReplaceData();
345
346 const wxString& GetFindString();
347 const wxString& GetReplaceString();
348 int GetFlags();
349 void SetFlags(int flags);
350 void SetFindString(const wxString& str);
351 void SetReplaceString(const wxString& str);
352 };
353
354
355 class wxFindReplaceDialog : public wxDialog {
356 public:
357 wxFindReplaceDialog(wxWindow *parent,
358 wxFindReplaceData *data,
359 const wxString &title,
360 int style = 0);
361 %name(wxPreFindReplaceDialog)wxFindReplaceDialog();
362
363 bool Create(wxWindow *parent,
364 wxFindReplaceData *data,
365 const wxString &title,
366 int style = 0);
367
368 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
369 %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(val)"
370
371 const wxFindReplaceData *GetData();
372 void SetData(wxFindReplaceData *data);
373 };
374
375 //----------------------------------------------------------------------