]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/cmndlgs.i
added missing header.
[wxWidgets.git] / wxPython / src / cmndlgs.i
CommitLineData
7bf85405
RD
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
03e9bead 13%module cmndlgs
7bf85405 14
03e9bead 15%{
7bf85405
RD
16#include "helpers.h"
17#include <wx/colordlg.h>
18#include <wx/dirdlg.h>
19#include <wx/fontdlg.h>
bb0054cd 20#include <wx/progdlg.h>
0122b7e3 21#include <wx/fdrepdlg.h>
7bf85405
RD
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
0122b7e3 34%import events.i
bb0054cd 35%import frames.i
7bf85405 36
b8b8dda7 37%pragma(python) code = "import wx"
7bf85405
RD
38
39//----------------------------------------------------------------------
40
9416aa89 41class wxColourData : public wxObject {
7bf85405
RD
42public:
43 wxColourData();
44 ~wxColourData();
45
46 bool GetChooseFull();
25832b3f 47 wxColour GetColour();
fb5e0af0 48 wxColour GetCustomColour(int i);
7bf85405
RD
49 void SetChooseFull(int flag);
50 void SetColour(const wxColour& colour);
51 void SetCustomColour(int i, const wxColour& colour);
52};
53
54
55class wxColourDialog : public wxDialog {
56public:
57 wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
58
0122b7e3
RD
59 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
60
7bf85405
RD
61 wxColourData& GetColourData();
62 int ShowModal();
63};
64
65
66//----------------------------------------------------------------------
67
68class wxDirDialog : public wxDialog {
69public:
70 wxDirDialog(wxWindow* parent,
71 char* message = "Choose a directory",
72 char* defaultPath = "",
73 long style = 0,
b68dc582 74 const wxPoint& pos = wxDefaultPosition);
7bf85405 75
0122b7e3
RD
76 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
77
7bf85405
RD
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
68320e40 86
7bf85405
RD
87//----------------------------------------------------------------------
88
89class wxFileDialog : public wxDialog {
90public:
91 wxFileDialog(wxWindow* parent,
92 char* message = "Choose a file",
93 char* defaultDir = "",
94 char* defaultFile = "",
95 char* wildcard = "*.*",
96 long style = 0,
b68dc582 97 const wxPoint& pos = wxDefaultPosition);
7bf85405 98
0122b7e3
RD
99 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
100
7bf85405
RD
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();
f6bcfd97
BP
116
117 %addmethods {
118 PyObject* GetFilenames() {
119 wxArrayString arr;
120 self->GetFilenames(arr);
b37c7e1d 121 return wxArrayString2PyList_helper(arr);
f6bcfd97
BP
122 }
123
124 PyObject* GetPaths() {
125 wxArrayString arr;
126 self->GetPaths(arr);
b37c7e1d 127 return wxArrayString2PyList_helper(arr);
f6bcfd97
BP
128 }
129 }
7bf85405
RD
130};
131
132
133//----------------------------------------------------------------------
134
135//TODO: wxMultipleChoiceDialog
136
137//----------------------------------------------------------------------
138
139class wxSingleChoiceDialog : public wxDialog {
140public:
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,
eec92d76 147 int LCOUNT, wxString* choices,
7bf85405
RD
148 //char** clientData = NULL,
149 long style = wxOK | wxCANCEL | wxCENTRE,
b68dc582 150 wxPoint* pos = &wxDefaultPosition) {
7bf85405 151 return new wxSingleChoiceDialog(parent, *message, *caption,
eec92d76 152 LCOUNT, choices, NULL, style, *pos);
7bf85405 153 }
0122b7e3 154 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
7bf85405 155
09f3d4e6 156 }
9c039d08 157
7bf85405
RD
158 int GetSelection();
159 wxString GetStringSelection();
160 void SetSelection(int sel);
161 int ShowModal();
162};
163
164
165//----------------------------------------------------------------------
166
167class wxTextEntryDialog : public wxDialog {
168public:
169 wxTextEntryDialog(wxWindow* parent,
170 char* message,
171 char* caption = "Input Text",
172 char* defaultValue = "",
173 long style = wxOK | wxCANCEL | wxCENTRE,
b68dc582 174 const wxPoint& pos = wxDefaultPosition);
7bf85405 175
0122b7e3
RD
176 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
177
7bf85405
RD
178 wxString GetValue();
179 void SetValue(const wxString& value);
180 int ShowModal();
181};
182
183//----------------------------------------------------------------------
184
9416aa89 185class wxFontData : public wxObject {
7bf85405
RD
186public:
187 wxFontData();
188 ~wxFontData();
189
190 void EnableEffects(bool enable);
191 bool GetAllowSymbols();
25832b3f 192 wxColour GetColour();
7bf85405
RD
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
206class wxFontDialog : public wxDialog {
207public:
0c3d4bfd 208 wxFontDialog(wxWindow* parent, wxFontData* data);
0122b7e3 209 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
7bf85405
RD
210
211 wxFontData& GetFontData();
212 int ShowModal();
213};
214
215
7bf85405
RD
216//----------------------------------------------------------------------
217
218class wxMessageDialog : public wxDialog {
219public:
220 wxMessageDialog(wxWindow* parent,
221 char* message,
222 char* caption = "Message box",
223 long style = wxOK | wxCANCEL | wxCENTRE,
b68dc582 224 const wxPoint& pos = wxDefaultPosition);
0122b7e3 225 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
7bf85405
RD
226
227 int ShowModal();
228};
229
230//----------------------------------------------------------------------
231
bb0054cd
RD
232class wxProgressDialog : public wxFrame {
233public:
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 );
0122b7e3 239 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
7bf85405 240
bb0054cd
RD
241 bool Update(int value = -1, const char* newmsg = NULL);
242 void Resume();
243}
244
245//----------------------------------------------------------------------
0122b7e3
RD
246
247enum 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
260enum 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
275enum {
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
285def EVT_COMMAND_FIND(win, id, func):
286 win.Connect(id, -1, wxEVT_COMMAND_FIND, func)
287
288def EVT_COMMAND_FIND_NEXT(win, id, func):
289 win.Connect(id, -1, wxEVT_COMMAND_FIND_NEXT, func)
290
291def EVT_COMMAND_FIND_REPLACE(win, id, func):
292 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE, func)
293
294def EVT_COMMAND_FIND_REPLACE_ALL(win, id, func):
295 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE_ALL, func)
296
297def EVT_COMMAND_FIND_CLOSE(win, id, func):
298 win.Connect(id, -1, wxEVT_COMMAND_FIND_CLOSE, func)
299
300"
301
302class wxFindDialogEvent : public wxCommandEvent
303{
304public:
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
317class wxFindReplaceData : public wxObject
318{
319public:
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
332class wxFindReplaceDialog : public wxDialog {
333public:
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)"
17c0e08c 346 %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(val)"
0122b7e3
RD
347
348 const wxFindReplaceData *GetData();
349 void SetData(wxFindReplaceData *data);
350};
351
352//----------------------------------------------------------------------