]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/cmndlgs.i
removed non appearance implementations
[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 //TODO: wxMultipleChoiceDialog
136
137 //----------------------------------------------------------------------
138
139 class wxSingleChoiceDialog : public wxDialog {
140 public:
141 %addmethods {
142 // TODO: ignoring clientData for now...
143 // SWIG is messing up the &/*'s for some reason.
144 wxSingleChoiceDialog(wxWindow* parent,
145 wxString* message,
146 wxString* caption,
147 int LCOUNT, wxString* choices,
148 //char** clientData = NULL,
149 long style = wxOK | wxCANCEL | wxCENTRE,
150 wxPoint* pos = &wxDefaultPosition) {
151 return new wxSingleChoiceDialog(parent, *message, *caption,
152 LCOUNT, choices, NULL, style, *pos);
153 }
154 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
155
156 }
157
158 int GetSelection();
159 wxString GetStringSelection();
160 void SetSelection(int sel);
161 int ShowModal();
162 };
163
164
165 //----------------------------------------------------------------------
166
167 class wxTextEntryDialog : public wxDialog {
168 public:
169 wxTextEntryDialog(wxWindow* parent,
170 char* message,
171 char* caption = "Input Text",
172 char* defaultValue = "",
173 long style = wxOK | wxCANCEL | wxCENTRE,
174 const wxPoint& pos = wxDefaultPosition);
175
176 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
177
178 wxString GetValue();
179 void SetValue(const wxString& value);
180 int ShowModal();
181 };
182
183 //----------------------------------------------------------------------
184
185 class wxFontData : public wxObject {
186 public:
187 wxFontData();
188 ~wxFontData();
189
190 void EnableEffects(bool enable);
191 bool GetAllowSymbols();
192 wxColour GetColour();
193 wxFont GetChosenFont();
194 bool GetEnableEffects();
195 wxFont GetInitialFont();
196 bool GetShowHelp();
197 void SetAllowSymbols(bool allowSymbols);
198 void SetChosenFont(const wxFont& font);
199 void SetColour(const wxColour& colour);
200 void SetInitialFont(const wxFont& font);
201 void SetRange(int min, int max);
202 void SetShowHelp(bool showHelp);
203 };
204
205
206 class wxFontDialog : public wxDialog {
207 public:
208 wxFontDialog(wxWindow* parent, wxFontData* data);
209 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
210
211 wxFontData& GetFontData();
212 int ShowModal();
213 };
214
215
216 //----------------------------------------------------------------------
217
218 class wxMessageDialog : public wxDialog {
219 public:
220 wxMessageDialog(wxWindow* parent,
221 char* message,
222 char* caption = "Message box",
223 long style = wxOK | wxCANCEL | wxCENTRE,
224 const wxPoint& pos = wxDefaultPosition);
225 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
226
227 int ShowModal();
228 };
229
230 //----------------------------------------------------------------------
231
232 class wxProgressDialog : public wxFrame {
233 public:
234 wxProgressDialog(const wxString& title,
235 const wxString& message,
236 int maximum = 100,
237 wxWindow* parent = NULL,
238 int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL );
239 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
240
241 bool Update(int value = -1, const char* newmsg = NULL);
242 void Resume();
243 }
244
245 //----------------------------------------------------------------------
246
247 enum wxFindReplaceFlags
248 {
249 // downward search/replace selected (otherwise - upwards)
250 wxFR_DOWN = 1,
251
252 // whole word search/replace selected
253 wxFR_WHOLEWORD = 2,
254
255 // case sensitive search/replace selected (otherwise - case insensitive)
256 wxFR_MATCHCASE = 4
257 };
258
259
260 enum wxFindReplaceDialogStyles
261 {
262 // replace dialog (otherwise find dialog)
263 wxFR_REPLACEDIALOG = 1,
264
265 // don't allow changing the search direction
266 wxFR_NOUPDOWN = 2,
267
268 // don't allow case sensitive searching
269 wxFR_NOMATCHCASE = 4,
270
271 // don't allow whole word searching
272 wxFR_NOWHOLEWORD = 8
273 };
274
275 enum {
276 wxEVT_COMMAND_FIND,
277 wxEVT_COMMAND_FIND_NEXT,
278 wxEVT_COMMAND_FIND_REPLACE,
279 wxEVT_COMMAND_FIND_REPLACE_ALL,
280 wxEVT_COMMAND_FIND_CLOSE,
281 };
282
283 %pragma(python) code = "
284
285 def EVT_COMMAND_FIND(win, id, func):
286 win.Connect(id, -1, wxEVT_COMMAND_FIND, func)
287
288 def EVT_COMMAND_FIND_NEXT(win, id, func):
289 win.Connect(id, -1, wxEVT_COMMAND_FIND_NEXT, func)
290
291 def EVT_COMMAND_FIND_REPLACE(win, id, func):
292 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE, func)
293
294 def EVT_COMMAND_FIND_REPLACE_ALL(win, id, func):
295 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE_ALL, func)
296
297 def EVT_COMMAND_FIND_CLOSE(win, id, func):
298 win.Connect(id, -1, wxEVT_COMMAND_FIND_CLOSE, func)
299
300 "
301
302 class wxFindDialogEvent : public wxCommandEvent
303 {
304 public:
305 wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
306 int GetFlags();
307 wxString GetFindString();
308 const wxString& GetReplaceString();
309 wxFindReplaceDialog *GetDialog();
310 void SetFlags(int flags);
311 void SetFindString(const wxString& str);
312 void SetReplaceString(const wxString& str);
313 };
314
315
316
317 class wxFindReplaceData : public wxObject
318 {
319 public:
320 wxFindReplaceData(int flags=0);
321 ~wxFindReplaceData();
322
323 const wxString& GetFindString();
324 const wxString& GetReplaceString();
325 int GetFlags();
326 void SetFlags(int flags);
327 void SetFindString(const wxString& str);
328 void SetReplaceString(const wxString& str);
329 };
330
331
332 class wxFindReplaceDialog : public wxDialog {
333 public:
334 wxFindReplaceDialog(wxWindow *parent,
335 wxFindReplaceData *data,
336 const wxString &title,
337 int style = 0);
338 %name(wxPreFindReplaceDialog)wxFindReplaceDialog();
339
340 bool Create(wxWindow *parent,
341 wxFindReplaceData *data,
342 const wxString &title,
343 int style = 0);
344
345 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
346 %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(val)"
347
348 const wxFindReplaceData *GetData();
349 void SetData(wxFindReplaceData *data);
350 };
351
352 //----------------------------------------------------------------------