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