]> git.saurik.com Git - wxWidgets.git/blame - wxPython/src/cmndlgs.i
fixed compile bug for when threads are turned off
[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
293a0a86
RD
135enum { wxCHOICEDLG_STYLE };
136
137class wxMultiChoiceDialog : public wxDialog
138{
139public:
140 wxMultiChoiceDialog(wxWindow *parent,
141 const wxString& message,
142 const wxString& caption,
143 int LCOUNT, wxString *choices,
144 long style = wxCHOICEDLG_STYLE,
145 const wxPoint& pos = wxDefaultPosition);
146
147 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
148
149 void SetSelections(const wxArrayInt& selections);
150
151 // wxArrayInt GetSelections() const;
152 %addmethods {
153 PyObject* GetSelections() {
154 return wxArrayInt2PyList_helper(self->GetSelections());
155 }
156 }
157};
158
7bf85405
RD
159
160//----------------------------------------------------------------------
161
162class wxSingleChoiceDialog : public wxDialog {
163public:
164 %addmethods {
165 // TODO: ignoring clientData for now...
166 // SWIG is messing up the &/*'s for some reason.
167 wxSingleChoiceDialog(wxWindow* parent,
168 wxString* message,
169 wxString* caption,
eec92d76 170 int LCOUNT, wxString* choices,
7bf85405 171 //char** clientData = NULL,
293a0a86 172 long style = wxCHOICEDLG_STYLE,
b68dc582 173 wxPoint* pos = &wxDefaultPosition) {
7bf85405 174 return new wxSingleChoiceDialog(parent, *message, *caption,
eec92d76 175 LCOUNT, choices, NULL, style, *pos);
7bf85405 176 }
0122b7e3 177 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
7bf85405 178
09f3d4e6 179 }
9c039d08 180
7bf85405
RD
181 int GetSelection();
182 wxString GetStringSelection();
183 void SetSelection(int sel);
184 int ShowModal();
185};
186
187
188//----------------------------------------------------------------------
189
190class wxTextEntryDialog : public wxDialog {
191public:
192 wxTextEntryDialog(wxWindow* parent,
193 char* message,
194 char* caption = "Input Text",
195 char* defaultValue = "",
196 long style = wxOK | wxCANCEL | wxCENTRE,
b68dc582 197 const wxPoint& pos = wxDefaultPosition);
7bf85405 198
0122b7e3
RD
199 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
200
7bf85405
RD
201 wxString GetValue();
202 void SetValue(const wxString& value);
203 int ShowModal();
204};
205
206//----------------------------------------------------------------------
207
9416aa89 208class wxFontData : public wxObject {
7bf85405
RD
209public:
210 wxFontData();
211 ~wxFontData();
212
213 void EnableEffects(bool enable);
214 bool GetAllowSymbols();
25832b3f 215 wxColour GetColour();
7bf85405
RD
216 wxFont GetChosenFont();
217 bool GetEnableEffects();
218 wxFont GetInitialFont();
219 bool GetShowHelp();
220 void SetAllowSymbols(bool allowSymbols);
221 void SetChosenFont(const wxFont& font);
222 void SetColour(const wxColour& colour);
223 void SetInitialFont(const wxFont& font);
224 void SetRange(int min, int max);
225 void SetShowHelp(bool showHelp);
226};
227
228
229class wxFontDialog : public wxDialog {
230public:
0c3d4bfd 231 wxFontDialog(wxWindow* parent, wxFontData* data);
0122b7e3 232 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
7bf85405
RD
233
234 wxFontData& GetFontData();
235 int ShowModal();
236};
237
238
7bf85405
RD
239//----------------------------------------------------------------------
240
241class wxMessageDialog : public wxDialog {
242public:
243 wxMessageDialog(wxWindow* parent,
244 char* message,
245 char* caption = "Message box",
246 long style = wxOK | wxCANCEL | wxCENTRE,
b68dc582 247 const wxPoint& pos = wxDefaultPosition);
0122b7e3 248 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
7bf85405
RD
249
250 int ShowModal();
251};
252
253//----------------------------------------------------------------------
254
bb0054cd
RD
255class wxProgressDialog : public wxFrame {
256public:
257 wxProgressDialog(const wxString& title,
258 const wxString& message,
259 int maximum = 100,
260 wxWindow* parent = NULL,
261 int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL );
0122b7e3 262 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
7bf85405 263
bb0054cd
RD
264 bool Update(int value = -1, const char* newmsg = NULL);
265 void Resume();
266}
267
268//----------------------------------------------------------------------
0122b7e3
RD
269
270enum wxFindReplaceFlags
271{
272 // downward search/replace selected (otherwise - upwards)
273 wxFR_DOWN = 1,
274
275 // whole word search/replace selected
276 wxFR_WHOLEWORD = 2,
277
278 // case sensitive search/replace selected (otherwise - case insensitive)
279 wxFR_MATCHCASE = 4
280};
281
282
283enum wxFindReplaceDialogStyles
284{
285 // replace dialog (otherwise find dialog)
286 wxFR_REPLACEDIALOG = 1,
287
288 // don't allow changing the search direction
289 wxFR_NOUPDOWN = 2,
290
291 // don't allow case sensitive searching
292 wxFR_NOMATCHCASE = 4,
293
294 // don't allow whole word searching
295 wxFR_NOWHOLEWORD = 8
296};
297
298enum {
299 wxEVT_COMMAND_FIND,
300 wxEVT_COMMAND_FIND_NEXT,
301 wxEVT_COMMAND_FIND_REPLACE,
302 wxEVT_COMMAND_FIND_REPLACE_ALL,
303 wxEVT_COMMAND_FIND_CLOSE,
304};
305
306%pragma(python) code = "
307
308def EVT_COMMAND_FIND(win, id, func):
309 win.Connect(id, -1, wxEVT_COMMAND_FIND, func)
310
311def EVT_COMMAND_FIND_NEXT(win, id, func):
312 win.Connect(id, -1, wxEVT_COMMAND_FIND_NEXT, func)
313
314def EVT_COMMAND_FIND_REPLACE(win, id, func):
315 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE, func)
316
317def EVT_COMMAND_FIND_REPLACE_ALL(win, id, func):
318 win.Connect(id, -1, wxEVT_COMMAND_FIND_REPLACE_ALL, func)
319
320def EVT_COMMAND_FIND_CLOSE(win, id, func):
321 win.Connect(id, -1, wxEVT_COMMAND_FIND_CLOSE, func)
322
323"
324
325class wxFindDialogEvent : public wxCommandEvent
326{
327public:
328 wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
329 int GetFlags();
330 wxString GetFindString();
331 const wxString& GetReplaceString();
332 wxFindReplaceDialog *GetDialog();
333 void SetFlags(int flags);
334 void SetFindString(const wxString& str);
335 void SetReplaceString(const wxString& str);
336};
337
338
339
340class wxFindReplaceData : public wxObject
341{
342public:
343 wxFindReplaceData(int flags=0);
344 ~wxFindReplaceData();
345
346 const wxString& GetFindString();
347 const wxString& GetReplaceString();
348 int GetFlags();
349 void SetFlags(int flags);
350 void SetFindString(const wxString& str);
351 void SetReplaceString(const wxString& str);
352};
353
354
355class wxFindReplaceDialog : public wxDialog {
356public:
357 wxFindReplaceDialog(wxWindow *parent,
358 wxFindReplaceData *data,
359 const wxString &title,
360 int style = 0);
361 %name(wxPreFindReplaceDialog)wxFindReplaceDialog();
362
363 bool Create(wxWindow *parent,
364 wxFindReplaceData *data,
365 const wxString &title,
366 int style = 0);
367
368 %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
17c0e08c 369 %pragma(python) addtomethod = "wxPreFindReplaceDialog:val._setOORInfo(val)"
0122b7e3
RD
370
371 const wxFindReplaceData *GetData();
372 void SetData(wxFindReplaceData *data);
373};
374
375//----------------------------------------------------------------------