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