]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/cmndlgs.i
SWIGged update for wxGTK (the last checkin was really for wxMSW...)
[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
137b5242
RD
41%{
42 // Put some wx default wxChar* values into wxStrings.
43 DECLARE_DEF_STRING(FileSelectorPromptStr);
daa3eac9
RD
44 DECLARE_DEF_STRING(DirSelectorPromptStr);
45 DECLARE_DEF_STRING(DirDialogNameStr);
137b5242
RD
46 DECLARE_DEF_STRING(FileSelectorDefaultWildcardStr);
47 DECLARE_DEF_STRING(GetTextFromUserPromptStr);
48 DECLARE_DEF_STRING(MessageBoxCaptionStr);
49 static const wxString wxPyEmptyString(wxT(""));
50
51%}
52
53//----------------------------------------------------------------------
54
9416aa89 55class wxColourData : public wxObject {
7bf85405
RD
56public:
57 wxColourData();
58 ~wxColourData();
59
60 bool GetChooseFull();
25832b3f 61 wxColour GetColour();
fb5e0af0 62 wxColour GetCustomColour(int i);
7bf85405
RD
63 void SetChooseFull(int flag);
64 void SetColour(const wxColour& colour);
65 void SetCustomColour(int i, const wxColour& colour);
66};
67
68
69class wxColourDialog : public wxDialog {
70public:
71 wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
72
0122b7e3
RD
73 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
74
7bf85405
RD
75 wxColourData& GetColourData();
76 int ShowModal();
77};
78
79
80//----------------------------------------------------------------------
81
82class wxDirDialog : public wxDialog {
83public:
84 wxDirDialog(wxWindow* parent,
daa3eac9 85 const wxString& message = wxPyDirSelectorPromptStr,
137b5242 86 const wxString& defaultPath = wxPyEmptyString,
7bf85405 87 long style = 0,
daa3eac9
RD
88 const wxPoint& pos = wxDefaultPosition,
89 const wxSize& size = wxDefaultSize,
90 const wxString& name = wxPyDirDialogNameStr);
7bf85405 91
0122b7e3
RD
92 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
93
7bf85405
RD
94 wxString GetPath();
95 wxString GetMessage();
96 long GetStyle();
97 void SetMessage(const wxString& message);
98 void SetPath(const wxString& path);
99 int ShowModal();
100};
101
68320e40 102
7bf85405
RD
103//----------------------------------------------------------------------
104
105class wxFileDialog : public wxDialog {
106public:
107 wxFileDialog(wxWindow* parent,
137b5242
RD
108 const wxString& message = wxPyFileSelectorPromptStr,
109 const wxString& defaultDir = wxPyEmptyString,
110 const wxString& defaultFile = wxPyEmptyString,
111 const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
7bf85405 112 long style = 0,
b68dc582 113 const wxPoint& pos = wxDefaultPosition);
7bf85405 114
0122b7e3
RD
115 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
116
7bf85405
RD
117 wxString GetDirectory();
118 wxString GetFilename();
119 int GetFilterIndex();
120 wxString GetMessage();
121 wxString GetPath();
122 long GetStyle();
123 wxString GetWildcard();
124 void SetDirectory(const wxString& directory);
125 void SetFilename(const wxString& setfilename);
126 void SetFilterIndex(int filterIndex);
127 void SetMessage(const wxString& message);
128 void SetPath(const wxString& path);
129 void SetStyle(long style);
130 void SetWildcard(const wxString& wildCard);
131 int ShowModal();
f6bcfd97
BP
132
133 %addmethods {
134 PyObject* GetFilenames() {
135 wxArrayString arr;
136 self->GetFilenames(arr);
b37c7e1d 137 return wxArrayString2PyList_helper(arr);
f6bcfd97
BP
138 }
139
140 PyObject* GetPaths() {
141 wxArrayString arr;
142 self->GetPaths(arr);
b37c7e1d 143 return wxArrayString2PyList_helper(arr);
f6bcfd97
BP
144 }
145 }
7bf85405
RD
146};
147
148
149//----------------------------------------------------------------------
150
293a0a86
RD
151enum { wxCHOICEDLG_STYLE };
152
153class wxMultiChoiceDialog : public wxDialog
154{
155public:
156 wxMultiChoiceDialog(wxWindow *parent,
157 const wxString& message,
158 const wxString& caption,
159 int LCOUNT, wxString *choices,
160 long style = wxCHOICEDLG_STYLE,
161 const wxPoint& pos = wxDefaultPosition);
162
163 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
164
165 void SetSelections(const wxArrayInt& selections);
166
167 // wxArrayInt GetSelections() const;
168 %addmethods {
169 PyObject* GetSelections() {
170 return wxArrayInt2PyList_helper(self->GetSelections());
171 }
172 }
173};
174
7bf85405
RD
175
176//----------------------------------------------------------------------
177
178class wxSingleChoiceDialog : public wxDialog {
179public:
180 %addmethods {
181 // TODO: ignoring clientData for now...
182 // SWIG is messing up the &/*'s for some reason.
183 wxSingleChoiceDialog(wxWindow* parent,
184 wxString* message,
185 wxString* caption,
eec92d76 186 int LCOUNT, wxString* choices,
7bf85405 187 //char** clientData = NULL,
293a0a86 188 long style = wxCHOICEDLG_STYLE,
b68dc582 189 wxPoint* pos = &wxDefaultPosition) {
7bf85405 190 return new wxSingleChoiceDialog(parent, *message, *caption,
eec92d76 191 LCOUNT, choices, NULL, style, *pos);
7bf85405 192 }
0122b7e3 193 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
7bf85405 194
09f3d4e6 195 }
9c039d08 196
7bf85405
RD
197 int GetSelection();
198 wxString GetStringSelection();
199 void SetSelection(int sel);
200 int ShowModal();
201};
202
203
204//----------------------------------------------------------------------
205
206class wxTextEntryDialog : public wxDialog {
207public:
208 wxTextEntryDialog(wxWindow* parent,
137b5242
RD
209 const wxString& message,
210 const wxString& caption = wxPyGetTextFromUserPromptStr,
211 const wxString& defaultValue = wxPyEmptyString,
7bf85405 212 long style = wxOK | wxCANCEL | wxCENTRE,
b68dc582 213 const wxPoint& pos = wxDefaultPosition);
7bf85405 214
0122b7e3
RD
215 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
216
7bf85405
RD
217 wxString GetValue();
218 void SetValue(const wxString& value);
219 int ShowModal();
220};
221
222//----------------------------------------------------------------------
223
9416aa89 224class wxFontData : public wxObject {
7bf85405
RD
225public:
226 wxFontData();
227 ~wxFontData();
228
229 void EnableEffects(bool enable);
230 bool GetAllowSymbols();
25832b3f 231 wxColour GetColour();
7bf85405
RD
232 wxFont GetChosenFont();
233 bool GetEnableEffects();
234 wxFont GetInitialFont();
235 bool GetShowHelp();
236 void SetAllowSymbols(bool allowSymbols);
237 void SetChosenFont(const wxFont& font);
238 void SetColour(const wxColour& colour);
239 void SetInitialFont(const wxFont& font);
240 void SetRange(int min, int max);
241 void SetShowHelp(bool showHelp);
242};
243
244
245class wxFontDialog : public wxDialog {
246public:
557a93b9 247 wxFontDialog(wxWindow* parent, const wxFontData& data);
0122b7e3 248 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
7bf85405
RD
249
250 wxFontData& GetFontData();
251 int ShowModal();
252};
253
254
7bf85405
RD
255//----------------------------------------------------------------------
256
257class wxMessageDialog : public wxDialog {
258public:
259 wxMessageDialog(wxWindow* parent,
137b5242
RD
260 const wxString& message,
261 const wxString& caption = wxPyMessageBoxCaptionStr,
7bf85405 262 long style = wxOK | wxCANCEL | wxCENTRE,
b68dc582 263 const wxPoint& pos = wxDefaultPosition);
0122b7e3 264 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
7bf85405
RD
265
266 int ShowModal();
267};
268
269//----------------------------------------------------------------------
270
bb0054cd
RD
271class wxProgressDialog : public wxFrame {
272public:
273 wxProgressDialog(const wxString& title,
274 const wxString& message,
275 int maximum = 100,
276 wxWindow* parent = NULL,
277 int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL );
0122b7e3 278 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
7bf85405 279
137b5242 280 bool Update(int value, const wxString& newmsg = wxPyEmptyString);
bb0054cd
RD
281 void Resume();
282}
283
284//----------------------------------------------------------------------
0122b7e3
RD
285
286enum wxFindReplaceFlags
287{
288 // downward search/replace selected (otherwise - upwards)
289 wxFR_DOWN = 1,
290
291 // whole word search/replace selected
292 wxFR_WHOLEWORD = 2,
293
294 // case sensitive search/replace selected (otherwise - case insensitive)
295 wxFR_MATCHCASE = 4
296};
297
298
299enum wxFindReplaceDialogStyles
300{
301 // replace dialog (otherwise find dialog)
302 wxFR_REPLACEDIALOG = 1,
303
304 // don't allow changing the search direction
305 wxFR_NOUPDOWN = 2,
306
307 // don't allow case sensitive searching
308 wxFR_NOMATCHCASE = 4,
309
310 // don't allow whole word searching
311 wxFR_NOWHOLEWORD = 8
312};
313
314enum {
315 wxEVT_COMMAND_FIND,
316 wxEVT_COMMAND_FIND_NEXT,
317 wxEVT_COMMAND_FIND_REPLACE,
318 wxEVT_COMMAND_FIND_REPLACE_ALL,
319 wxEVT_COMMAND_FIND_CLOSE,
320};
321
322%pragma(python) code = "
323
324def EVT_COMMAND_FIND(win, id, func):
325 win.Connect(id, -1, wxEVT_COMMAND_FIND, func)
326
327def EVT_COMMAND_FIND_NEXT(win, id, func):
328 win.Connect(id, -1, wxEVT_COMMAND_FIND_NEXT, func)
329
330def EVT_COMMAND_FIND_REPLACE(win, id, func):
331 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE, func)
332
333def EVT_COMMAND_FIND_REPLACE_ALL(win, id, func):
334 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE_ALL, func)
335
336def EVT_COMMAND_FIND_CLOSE(win, id, func):
337 win.Connect(id, -1, wxEVT_COMMAND_FIND_CLOSE, func)
338
339"
340
341class wxFindDialogEvent : public wxCommandEvent
342{
343public:
344 wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
345 int GetFlags();
346 wxString GetFindString();
347 const wxString& GetReplaceString();
348 wxFindReplaceDialog *GetDialog();
349 void SetFlags(int flags);
350 void SetFindString(const wxString& str);
351 void SetReplaceString(const wxString& str);
352};
353
354
355
356class wxFindReplaceData : public wxObject
357{
358public:
359 wxFindReplaceData(int flags=0);
360 ~wxFindReplaceData();
361
362 const wxString& GetFindString();
363 const wxString& GetReplaceString();
364 int GetFlags();
365 void SetFlags(int flags);
366 void SetFindString(const wxString& str);
367 void SetReplaceString(const wxString& str);
368};
369
370
371class wxFindReplaceDialog : public wxDialog {
372public:
373 wxFindReplaceDialog(wxWindow *parent,
374 wxFindReplaceData *data,
375 const wxString &title,
376 int style = 0);
377 %name(wxPreFindReplaceDialog)wxFindReplaceDialog();
378
379 bool Create(wxWindow *parent,
380 wxFindReplaceData *data,
381 const wxString &title,
382 int style = 0);
383
384 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 385 %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(val)"
0122b7e3
RD
386
387 const wxFindReplaceData *GetData();
388 void SetData(wxFindReplaceData *data);
389};
390
391//----------------------------------------------------------------------