]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/src/cmndlgs.i
Changed the import semantics from "from wxPython import *" to "from
[wxWidgets.git] / utils / 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/printdlg.h>
21 %}
22
23 //----------------------------------------------------------------------
24
25 %include typemaps.i
26 %include my_typemaps.i
27
28 // Import some definitions of other classes, etc.
29 %import _defs.i
30 %import misc.i
31 %import gdi.i
32 %import windows.i
33
34 %pragma(python) code = "import wx"
35
36 //----------------------------------------------------------------------
37
38 class wxColourData {
39 public:
40 wxColourData();
41 ~wxColourData();
42
43 bool GetChooseFull();
44 wxColour& GetColour();
45 wxColour GetCustomColour(int i);
46 void SetChooseFull(int flag);
47 void SetColour(const wxColour& colour);
48 void SetCustomColour(int i, const wxColour& colour);
49 };
50
51
52 class wxColourDialog : public wxDialog {
53 public:
54 wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
55
56 %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
57
58 #ifdef __WXMSW__
59 wxColourData& GetColourData();
60 #else
61 wxColourData GetColourData();
62 #endif
63 int ShowModal();
64 };
65
66
67 //----------------------------------------------------------------------
68
69 #ifdef __WXMSW__
70 class wxDirDialog : public wxDialog {
71 public:
72 wxDirDialog(wxWindow* parent,
73 char* message = "Choose a directory",
74 char* defaultPath = "",
75 long style = 0,
76 const wxPoint& pos = wxPyDefaultPosition);
77
78 %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
79
80 wxString GetPath();
81 wxString GetMessage();
82 long GetStyle();
83 void SetMessage(const wxString& message);
84 void SetPath(const wxString& path);
85 int ShowModal();
86 };
87 #endif
88
89 //----------------------------------------------------------------------
90
91 class wxFileDialog : public wxDialog {
92 public:
93 wxFileDialog(wxWindow* parent,
94 char* message = "Choose a file",
95 char* defaultDir = "",
96 char* defaultFile = "",
97 char* wildcard = "*.*",
98 long style = 0,
99 const wxPoint& pos = wxPyDefaultPosition);
100
101 %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
102
103 wxString GetDirectory();
104 wxString GetFilename();
105 int GetFilterIndex();
106 wxString GetMessage();
107 wxString GetPath();
108 long GetStyle();
109 wxString GetWildcard();
110 void SetDirectory(const wxString& directory);
111 void SetFilename(const wxString& setfilename);
112 void SetFilterIndex(int filterIndex);
113 void SetMessage(const wxString& message);
114 void SetPath(const wxString& path);
115 void SetStyle(long style);
116 void SetWildcard(const wxString& wildCard);
117 int ShowModal();
118 };
119
120
121 //----------------------------------------------------------------------
122
123 //TODO: wxMultipleChoiceDialog
124
125 //----------------------------------------------------------------------
126
127 class wxSingleChoiceDialog : public wxDialog {
128 public:
129 %addmethods {
130 // TODO: ignoring clientData for now...
131 // SWIG is messing up the &/*'s for some reason.
132 wxSingleChoiceDialog(wxWindow* parent,
133 wxString* message,
134 wxString* caption,
135 int LCOUNT, wxString* LIST,
136 //char** clientData = NULL,
137 long style = wxOK | wxCANCEL | wxCENTRE,
138 wxPoint* pos = &wxPyDefaultPosition) {
139 return new wxSingleChoiceDialog(parent, *message, *caption,
140 LCOUNT, LIST, NULL, style, *pos);
141 }
142 }
143
144 %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
145
146 int GetSelection();
147 wxString GetStringSelection();
148 void SetSelection(int sel);
149 int ShowModal();
150 };
151
152
153 //----------------------------------------------------------------------
154
155 class wxTextEntryDialog : public wxDialog {
156 public:
157 wxTextEntryDialog(wxWindow* parent,
158 char* message,
159 char* caption = "Input Text",
160 char* defaultValue = "",
161 long style = wxOK | wxCANCEL | wxCENTRE,
162 const wxPoint& pos = wxPyDefaultPosition);
163
164 %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
165
166 wxString GetValue();
167 void SetValue(const wxString& value);
168 int ShowModal();
169 };
170
171 //----------------------------------------------------------------------
172
173 class wxFontData {
174 public:
175 wxFontData();
176 ~wxFontData();
177
178 void EnableEffects(bool enable);
179 bool GetAllowSymbols();
180 wxColour& GetColour();
181 wxFont GetChosenFont();
182 bool GetEnableEffects();
183 wxFont GetInitialFont();
184 bool GetShowHelp();
185 void SetAllowSymbols(bool allowSymbols);
186 void SetChosenFont(const wxFont& font);
187 void SetColour(const wxColour& colour);
188 void SetInitialFont(const wxFont& font);
189 void SetRange(int min, int max);
190 void SetShowHelp(bool showHelp);
191 };
192
193
194 class wxFontDialog : public wxDialog {
195 public:
196 wxFontDialog(wxWindow* parent, wxFontData* data = NULL);
197
198 %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
199
200 wxFontData& GetFontData();
201 int ShowModal();
202 };
203
204
205 //----------------------------------------------------------------------
206
207 class wxPageSetupData {
208 public:
209 wxPageSetupData();
210 ~wxPageSetupData();
211
212 void EnableHelp(bool flag);
213 void EnableMargins(bool flag);
214 void EnableOrientation(bool flag);
215 void EnablePaper(bool flag);
216 void EnablePrinter(bool flag);
217 wxPoint GetPaperSize();
218 wxPoint GetMarginTopLeft();
219 wxPoint GetMarginBottomRight();
220 wxPoint GetMinMarginTopLeft();
221 wxPoint GetMinMarginBottomRight();
222 int GetOrientation();
223 bool GetDefaultMinMargins();
224 bool GetEnableMargins();
225 bool GetEnableOrientation();
226 bool GetEnablePaper();
227 bool GetEnablePrinter();
228 bool GetEnableHelp();
229 bool GetDefaultInfo();
230 void SetPaperSize(const wxPoint& size);
231 void SetMarginTopLeft(const wxPoint& pt);
232 void SetMarginBottomRight(const wxPoint& pt);
233 void SetMinMarginTopLeft(const wxPoint& pt);
234 void SetMinMarginBottomRight(const wxPoint& pt);
235 void SetOrientation(int orientation);
236 void SetDefaultMinMargins(bool flag);
237 void SetDefaultInfo(bool flag);
238 };
239
240
241 class wxPageSetupDialog : public wxDialog {
242 public:
243 wxPageSetupDialog(wxWindow* parent, wxPageSetupData* data = NULL);
244
245 %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
246
247 wxPageSetupData& GetPageSetupData();
248 int ShowModal();
249 };
250
251 //----------------------------------------------------------------------
252
253 class wxPrintData {
254 public:
255 wxPrintData();
256 ~wxPrintData();
257
258 void EnableHelp(bool flag);
259 void EnablePageNumbers(bool flag);
260 void EnablePrintToFile(bool flag);
261 void EnableSelection(bool flag);
262 bool GetAllPages();
263 bool GetCollate();
264 int GetFromPage();
265 int GetMaxPage();
266 int GetMinPage();
267 int GetNoCopies();
268 int GetOrientation();
269 int GetToPage();
270 void SetCollate(bool flag);
271 void SetFromPage(int page);
272 void SetMaxPage(int page);
273 void SetMinPage(int page);
274 void SetOrientation(int orientation);
275 void SetNoCopies(int n);
276 void SetPrintToFile(bool flag);
277 void SetSetupDialog(bool flag);
278 void SetToPage(int page);
279 };
280
281
282 class wxPrintDialog : public wxDialog {
283 public:
284 wxPrintDialog(wxWindow* parent, wxPrintData* data = NULL);
285
286 %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
287
288 wxPrintData& GetPrintData();
289 %new wxDC* GetPrintDC();
290 int ShowModal();
291 };
292
293 //----------------------------------------------------------------------
294
295 class wxMessageDialog : public wxDialog {
296 public:
297 wxMessageDialog(wxWindow* parent,
298 char* message,
299 char* caption = "Message box",
300 long style = wxOK | wxCANCEL | wxCENTRE,
301 const wxPoint& pos = wxPyDefaultPosition);
302
303 %pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
304
305 int ShowModal();
306 };
307
308 //----------------------------------------------------------------------
309
310
311 /////////////////////////////////////////////////////////////////////////////
312 //
313 // $Log$
314 // Revision 1.7 1998/12/15 20:41:14 RD
315 // Changed the import semantics from "from wxPython import *" to "from
316 // wxPython.wx import *" This is for people who are worried about
317 // namespace pollution, they can use "from wxPython import wx" and then
318 // prefix all the wxPython identifiers with "wx."
319 //
320 // Added wxTaskbarIcon for wxMSW.
321 //
322 // Made the events work for wxGrid.
323 //
324 // Added wxConfig.
325 //
326 // Added wxMiniFrame for wxGTK, (untested.)
327 //
328 // Changed many of the args and return values that were pointers to gdi
329 // objects to references to reflect changes in the wxWindows API.
330 //
331 // Other assorted fixes and additions.
332 //
333 // Revision 1.6 1998/11/25 08:45:22 RD
334 //
335 // Added wxPalette, wxRegion, wxRegionIterator, wxTaskbarIcon
336 // Added events for wxGrid
337 // Other various fixes and additions
338 //
339 // Revision 1.5 1998/11/15 23:03:43 RD
340 // Removing some ifdef's for wxGTK
341 //
342 // Revision 1.4 1998/10/02 06:40:34 RD
343 //
344 // Version 0.4 of wxPython for MSW.
345 //
346 // Revision 1.3 1998/08/18 19:48:13 RD
347 // more wxGTK compatibility things.
348 //
349 // It builds now but there are serious runtime problems...
350 //
351 // Revision 1.2 1998/08/15 07:36:25 RD
352 // - Moved the header in the .i files out of the code that gets put into
353 // the .cpp files. It caused CVS conflicts because of the RCS ID being
354 // different each time.
355 //
356 // - A few minor fixes.
357 //
358 // Revision 1.1 1998/08/09 08:25:49 RD
359 // Initial version
360 //
361 //
362