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