]>
Commit | Line | Data |
---|---|---|
7bf85405 | 1 | ///////////////////////////////////////////////////////////////////////////// |
d14a1e28 RD |
2 | // Name: _cmndlgs.i |
3 | // Purpose: SWIG interface for the "Common Dialog" classes | |
7bf85405 RD |
4 | // |
5 | // Author: Robin Dunn | |
6 | // | |
d14a1e28 | 7 | // Created: 25-July-1998 |
7bf85405 | 8 | // RCS-ID: $Id$ |
d14a1e28 | 9 | // Copyright: (c) 2003 by Total Control Software |
7bf85405 RD |
10 | // Licence: wxWindows license |
11 | ///////////////////////////////////////////////////////////////////////////// | |
12 | ||
d14a1e28 | 13 | // Not a %module |
7bf85405 | 14 | |
7bf85405 | 15 | |
d14a1e28 RD |
16 | //--------------------------------------------------------------------------- |
17 | %newgroup | |
7bf85405 | 18 | |
b2dc1044 RD |
19 | MAKE_CONST_WXSTRING(FileSelectorPromptStr); |
20 | MAKE_CONST_WXSTRING(DirSelectorPromptStr); | |
21 | MAKE_CONST_WXSTRING(DirDialogNameStr); | |
22 | MAKE_CONST_WXSTRING(FileSelectorDefaultWildcardStr); | |
23 | MAKE_CONST_WXSTRING(GetTextFromUserPromptStr); | |
24 | MAKE_CONST_WXSTRING(MessageBoxCaptionStr); | |
137b5242 | 25 | |
d14a1e28 RD |
26 | //--------------------------------------------------------------------------- |
27 | ||
137b5242 | 28 | |
fcafa8a9 | 29 | DocStr(wxColourData, |
dce2bd22 RD |
30 | "This class holds a variety of information related to the colour |
31 | chooser dialog, used to transfer settings and results to and from the | |
d07d2bc9 | 32 | `wx.ColourDialog`.", ""); |
fcafa8a9 | 33 | |
9416aa89 | 34 | class wxColourData : public wxObject { |
7bf85405 | 35 | public: |
fcafa8a9 RD |
36 | DocCtorStr( |
37 | wxColourData(), | |
d07d2bc9 | 38 | "Constructor, sets default values.", ""); |
fcafa8a9 | 39 | |
7bf85405 RD |
40 | ~wxColourData(); |
41 | ||
fcafa8a9 RD |
42 | |
43 | DocDeclStr( | |
44 | bool , GetChooseFull(), | |
dce2bd22 RD |
45 | "Under Windows, determines whether the Windows colour dialog will |
46 | display the full dialog with custom colour selection controls. Has no | |
d07d2bc9 | 47 | meaning under other platforms. The default value is true.", ""); |
fcafa8a9 RD |
48 | |
49 | DocDeclStr( | |
50 | wxColour , GetColour(), | |
d07d2bc9 | 51 | "Gets the colour (pre)selected by the dialog.", ""); |
fcafa8a9 RD |
52 | |
53 | DocDeclStr( | |
54 | wxColour , GetCustomColour(int i), | |
dce2bd22 RD |
55 | "Gets the i'th custom colour associated with the colour dialog. i |
56 | should be an integer between 0 and 15. The default custom colours are | |
d07d2bc9 | 57 | all white.", ""); |
fcafa8a9 RD |
58 | |
59 | DocDeclStr( | |
60 | void , SetChooseFull(int flag), | |
dce2bd22 RD |
61 | "Under Windows, tells the Windows colour dialog to display the full |
62 | dialog with custom colour selection controls. Under other platforms, | |
d07d2bc9 | 63 | has no effect. The default value is true.", ""); |
fcafa8a9 RD |
64 | |
65 | DocDeclStr( | |
66 | void , SetColour(const wxColour& colour), | |
dce2bd22 | 67 | "Sets the default colour for the colour dialog. The default colour is |
d07d2bc9 | 68 | black.", ""); |
fcafa8a9 RD |
69 | |
70 | DocDeclStr( | |
71 | void , SetCustomColour(int i, const wxColour& colour), | |
dce2bd22 | 72 | "Sets the i'th custom colour for the colour dialog. i should be an |
d07d2bc9 | 73 | integer between 0 and 15. The default custom colours are all white.", ""); |
fcafa8a9 | 74 | |
7bf85405 RD |
75 | }; |
76 | ||
77 | ||
dce2bd22 RD |
78 | |
79 | ||
fcafa8a9 | 80 | DocStr(wxColourDialog, |
d07d2bc9 | 81 | "This class represents the colour chooser dialog.", ""); |
fcafa8a9 | 82 | |
7bf85405 RD |
83 | class wxColourDialog : public wxDialog { |
84 | public: | |
2b9048c5 | 85 | %pythonAppend wxColourDialog "self._setOORInfo(self)" |
7bf85405 | 86 | |
fcafa8a9 RD |
87 | DocCtorStr( |
88 | wxColourDialog(wxWindow* parent, wxColourData* data = NULL), | |
dce2bd22 RD |
89 | "Constructor. Pass a parent window, and optionally a `wx.ColourData`, |
90 | which will be copied to the colour dialog's internal ColourData | |
d07d2bc9 | 91 | instance.", ""); |
0122b7e3 | 92 | |
fcafa8a9 RD |
93 | DocDeclStr( |
94 | wxColourData& , GetColourData(), | |
d07d2bc9 | 95 | "Returns a reference to the `wx.ColourData` used by the dialog.", ""); |
7bf85405 RD |
96 | }; |
97 | ||
98 | ||
d14a1e28 | 99 | //-------------------------------------------------------------------------------- |
7bf85405 | 100 | |
fcafa8a9 RD |
101 | |
102 | DocStr(wxDirDialog, | |
dce2bd22 | 103 | "wx.DirDialog allows the user to select a directory by browising the |
d07d2bc9 | 104 | file system.", " |
dce2bd22 RD |
105 | |
106 | Window Styles | |
107 | -------------- | |
108 | ==================== ========================================== | |
109 | wx.DD_NEW_DIR_BUTTON Add 'Create new directory' button and allow | |
110 | directory names to be editable. On Windows | |
111 | the new directory button is only available | |
112 | with recent versions of the common dialogs. | |
113 | ==================== ========================================== | |
114 | "); | |
fcafa8a9 | 115 | |
7bf85405 RD |
116 | class wxDirDialog : public wxDialog { |
117 | public: | |
2b9048c5 | 118 | %pythonAppend wxDirDialog "self._setOORInfo(self)" |
d14a1e28 | 119 | |
fcafa8a9 RD |
120 | DocCtorStr( |
121 | wxDirDialog(wxWindow* parent, | |
122 | const wxString& message = wxPyDirSelectorPromptStr, | |
123 | const wxString& defaultPath = wxPyEmptyString, | |
124 | long style = 0, | |
125 | const wxPoint& pos = wxDefaultPosition, | |
126 | const wxSize& size = wxDefaultSize, | |
127 | const wxString& name = wxPyDirDialogNameStr), | |
d07d2bc9 | 128 | "Constructor. Use ShowModal method to show the dialog.", ""); |
fcafa8a9 RD |
129 | |
130 | ||
131 | DocDeclStr( | |
132 | wxString , GetPath(), | |
d07d2bc9 | 133 | "Returns the default or user-selected path.", ""); |
fcafa8a9 RD |
134 | |
135 | DocDeclStr( | |
136 | wxString , GetMessage(), | |
d07d2bc9 | 137 | "Returns the message that will be displayed on the dialog.", ""); |
fcafa8a9 RD |
138 | |
139 | DocDeclStr( | |
140 | long , GetStyle(), | |
d07d2bc9 | 141 | "Returns the dialog style.", ""); |
fcafa8a9 RD |
142 | |
143 | DocDeclStr( | |
144 | void , SetMessage(const wxString& message), | |
d07d2bc9 | 145 | "Sets the message that will be displayed on the dialog.", ""); |
fcafa8a9 RD |
146 | |
147 | DocDeclStr( | |
148 | void , SetPath(const wxString& path), | |
d07d2bc9 | 149 | "Sets the default path.", ""); |
fcafa8a9 | 150 | |
7bf85405 RD |
151 | }; |
152 | ||
68320e40 | 153 | |
d14a1e28 | 154 | //--------------------------------------------------------------------------- |
7bf85405 | 155 | |
fcafa8a9 | 156 | DocStr(wxFileDialog, |
dce2bd22 | 157 | "wx.FileDialog allows the user to select one or more files from the |
d07d2bc9 | 158 | filesystem.", " |
dce2bd22 RD |
159 | |
160 | In Windows, this is the common file selector dialog. On X based | |
161 | platforms a generic alternative is used. The path and filename are | |
162 | distinct elements of a full file pathname. If path is \"\", the | |
163 | current directory will be used. If filename is \"\", no default | |
164 | filename will be supplied. The wildcard determines what files are | |
165 | displayed in the file selector, and file extension supplies a type | |
166 | extension for the required filename. | |
167 | ||
168 | Both the X and Windows versions implement a wildcard filter. Typing a | |
d07d2bc9 | 169 | filename containing wildcards (\*, ?) in the filename text item, and |
dce2bd22 RD |
170 | clicking on Ok, will result in only those files matching the pattern |
171 | being displayed. The wildcard may be a specification for multiple | |
172 | types of file with a description for each, such as:: | |
fcafa8a9 RD |
173 | |
174 | \"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif\" | |
175 | ||
dce2bd22 RD |
176 | |
177 | Window Styles | |
178 | -------------- | |
d07d2bc9 RD |
179 | =================== ========================================== |
180 | wx.OPEN This is an open dialog. | |
fcafa8a9 | 181 | |
d07d2bc9 | 182 | wx.SAVE This is a save dialog. |
fcafa8a9 | 183 | |
d07d2bc9 RD |
184 | wx.HIDE_READONLY For open dialog only: hide the checkbox |
185 | allowing to open the file in read-only mode. | |
fcafa8a9 | 186 | |
d07d2bc9 RD |
187 | wx.OVERWRITE_PROMPT For save dialog only: prompt for a confirmation |
188 | if a file will be overwritten. | |
fcafa8a9 | 189 | |
d07d2bc9 RD |
190 | wx.MULTIPLE For open dialog only: allows selecting multiple |
191 | files. | |
fcafa8a9 | 192 | |
d07d2bc9 RD |
193 | wx.CHANGE_DIR Change the current working directory to the |
194 | directory where the file(s) chosen by the user | |
195 | are. | |
196 | =================== ========================================== | |
fcafa8a9 RD |
197 | "); |
198 | ||
199 | ||
200 | ||
7bf85405 RD |
201 | class wxFileDialog : public wxDialog { |
202 | public: | |
2b9048c5 | 203 | %pythonAppend wxFileDialog "self._setOORInfo(self)" |
fcafa8a9 RD |
204 | |
205 | DocCtorStr( | |
206 | wxFileDialog(wxWindow* parent, | |
207 | const wxString& message = wxPyFileSelectorPromptStr, | |
208 | const wxString& defaultDir = wxPyEmptyString, | |
209 | const wxString& defaultFile = wxPyEmptyString, | |
210 | const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr, | |
211 | long style = 0, | |
212 | const wxPoint& pos = wxDefaultPosition), | |
d07d2bc9 | 213 | "Constructor. Use ShowModal method to show the dialog.", ""); |
fcafa8a9 RD |
214 | |
215 | ||
216 | DocDeclStr( | |
217 | void , SetMessage(const wxString& message), | |
d07d2bc9 | 218 | "Sets the message that will be displayed on the dialog.", ""); |
fcafa8a9 RD |
219 | |
220 | DocDeclStr( | |
221 | void , SetPath(const wxString& path), | |
dce2bd22 | 222 | "Sets the path (the combined directory and filename that will be |
d07d2bc9 | 223 | returned when the dialog is dismissed).", ""); |
fcafa8a9 RD |
224 | |
225 | DocDeclStr( | |
226 | void , SetDirectory(const wxString& dir), | |
d07d2bc9 | 227 | "Sets the default directory.", ""); |
fcafa8a9 RD |
228 | |
229 | DocDeclStr( | |
230 | void , SetFilename(const wxString& name), | |
d07d2bc9 | 231 | "Sets the default filename.", ""); |
fcafa8a9 RD |
232 | |
233 | DocDeclStr( | |
234 | void , SetWildcard(const wxString& wildCard), | |
dce2bd22 RD |
235 | "Sets the wildcard, which can contain multiple file types, for |
236 | example:: | |
237 | ||
238 | \"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif\" | |
d07d2bc9 | 239 | ", ""); |
d14a1e28 | 240 | |
fcafa8a9 RD |
241 | DocDeclStr( |
242 | void , SetStyle(long style), | |
d07d2bc9 | 243 | "Sets the dialog style.", ""); |
fcafa8a9 RD |
244 | |
245 | DocDeclStr( | |
246 | void , SetFilterIndex(int filterIndex), | |
d07d2bc9 | 247 | "Sets the default filter index, starting from zero.", ""); |
fcafa8a9 RD |
248 | |
249 | ||
250 | DocDeclStr( | |
251 | wxString , GetMessage() const, | |
d07d2bc9 | 252 | "Returns the message that will be displayed on the dialog.", ""); |
fcafa8a9 RD |
253 | |
254 | DocDeclStr( | |
255 | wxString , GetPath() const, | |
d07d2bc9 | 256 | "Returns the full path (directory and filename) of the selected file.", ""); |
fcafa8a9 RD |
257 | |
258 | DocDeclStr( | |
259 | wxString , GetDirectory() const, | |
d07d2bc9 | 260 | "Returns the default directory.", ""); |
fcafa8a9 RD |
261 | |
262 | DocDeclStr( | |
263 | wxString , GetFilename() const, | |
d07d2bc9 | 264 | "Returns the default filename.", ""); |
fcafa8a9 RD |
265 | |
266 | DocDeclStr( | |
267 | wxString , GetWildcard() const, | |
d07d2bc9 | 268 | "Returns the file dialog wildcard.", ""); |
fcafa8a9 RD |
269 | |
270 | DocDeclStr( | |
271 | long , GetStyle() const, | |
d07d2bc9 | 272 | "Returns the dialog style.", ""); |
fcafa8a9 RD |
273 | |
274 | DocDeclStr( | |
275 | int , GetFilterIndex() const, | |
dce2bd22 RD |
276 | "Returns the index into the list of filters supplied, optionally, in |
277 | the wildcard parameter. Before the dialog is shown, this is the index | |
278 | which will be used when the dialog is first displayed. After the | |
d07d2bc9 | 279 | dialog is shown, this is the index selected by the user.", ""); |
f6bcfd97 | 280 | |
fcafa8a9 RD |
281 | |
282 | DocStr(GetFilenames, | |
dce2bd22 RD |
283 | "Returns a list of filenames chosen in the dialog. This function |
284 | should only be used with the dialogs which have wx.MULTIPLE style, use | |
d07d2bc9 | 285 | GetFilename for the others.", ""); |
fcafa8a9 RD |
286 | |
287 | DocStr(GetPaths, | |
dce2bd22 RD |
288 | "Fills the array paths with the full paths of the files chosen. This |
289 | function should only be used with the dialogs which have wx.MULTIPLE | |
d07d2bc9 | 290 | style, use GetPath for the others.", ""); |
fcafa8a9 | 291 | |
d14a1e28 | 292 | %extend { |
f6bcfd97 BP |
293 | PyObject* GetFilenames() { |
294 | wxArrayString arr; | |
295 | self->GetFilenames(arr); | |
b37c7e1d | 296 | return wxArrayString2PyList_helper(arr); |
f6bcfd97 BP |
297 | } |
298 | ||
299 | PyObject* GetPaths() { | |
300 | wxArrayString arr; | |
301 | self->GetPaths(arr); | |
b37c7e1d | 302 | return wxArrayString2PyList_helper(arr); |
f6bcfd97 BP |
303 | } |
304 | } | |
3ef86e32 RD |
305 | |
306 | // TODO | |
307 | // // Utility functions | |
308 | ||
309 | // // Parses the wildCard, returning the number of filters. | |
310 | // // Returns 0 if none or if there's a problem, | |
311 | // // The arrays will contain an equal number of items found before the error. | |
312 | // // wildCard is in the form: | |
313 | // // "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png" | |
314 | // static int ParseWildcard(const wxString& wildCard, | |
315 | // wxArrayString& descriptions, | |
316 | // wxArrayString& filters); | |
317 | ||
318 | // // Append first extension to filePath from a ';' separated extensionList | |
319 | // // if filePath = "path/foo.bar" just return it as is | |
320 | // // if filePath = "foo[.]" and extensionList = "*.jpg;*.png" return "foo.jpg" | |
321 | // // if the extension is "*.j?g" (has wildcards) or "jpg" then return filePath | |
322 | // static wxString AppendExtension(const wxString &filePath, | |
323 | // const wxString &extensionList); | |
324 | ||
325 | ||
7bf85405 RD |
326 | }; |
327 | ||
328 | ||
d14a1e28 | 329 | //--------------------------------------------------------------------------- |
7bf85405 | 330 | |
293a0a86 RD |
331 | enum { wxCHOICEDLG_STYLE }; |
332 | ||
e5868095 RD |
333 | |
334 | DocStr(wxMultiChoiceDialog, | |
d07d2bc9 | 335 | "A simple dialog with a multi selection listbox.", ""); |
e5868095 | 336 | |
293a0a86 RD |
337 | class wxMultiChoiceDialog : public wxDialog |
338 | { | |
339 | public: | |
2b9048c5 | 340 | %pythonAppend wxMultiChoiceDialog "self._setOORInfo(self)" |
293a0a86 | 341 | |
e5868095 RD |
342 | DocCtorAStr( |
343 | wxMultiChoiceDialog(wxWindow *parent, | |
344 | const wxString& message, | |
345 | const wxString& caption, | |
346 | int choices=0, wxString* choices_array, | |
347 | long style = wxCHOICEDLG_STYLE, | |
348 | const wxPoint& pos = wxDefaultPosition), | |
dce2bd22 RD |
349 | "__init__(Window parent, String message, String caption, |
350 | List choices=[], long style=CHOICEDLG_STYLE, | |
351 | Point pos=DefaultPosition) -> MultiChoiceDialog", | |
d07d2bc9 | 352 | "Constructor. Use ShowModal method to show the dialog.", ""); |
e5868095 RD |
353 | |
354 | ||
355 | DocDeclAStr( | |
356 | void, SetSelections(const wxArrayInt& selections), | |
357 | "SetSelections(List selections)", | |
dce2bd22 | 358 | "Specify the items in the list that should be selected, using a list of |
d07d2bc9 | 359 | integers.", ""); |
293a0a86 | 360 | |
e5868095 RD |
361 | DocAStr(GetSelections, |
362 | "GetSelections() -> [selections]", | |
d07d2bc9 | 363 | "Returns a list of integers representing the items that are selected.", ""); |
d14a1e28 | 364 | %extend { |
293a0a86 RD |
365 | PyObject* GetSelections() { |
366 | return wxArrayInt2PyList_helper(self->GetSelections()); | |
367 | } | |
368 | } | |
369 | }; | |
370 | ||
7bf85405 | 371 | |
d14a1e28 | 372 | //--------------------------------------------------------------------------- |
7bf85405 | 373 | |
e5868095 | 374 | DocStr(wxSingleChoiceDialog, |
d07d2bc9 | 375 | "A simple dialog with a single selection listbox.", ""); |
e5868095 | 376 | |
7bf85405 RD |
377 | class wxSingleChoiceDialog : public wxDialog { |
378 | public: | |
2b9048c5 | 379 | %pythonAppend wxSingleChoiceDialog "self._setOORInfo(self)" |
e5868095 RD |
380 | |
381 | DocAStr(wxSingleChoiceDialog, | |
dce2bd22 RD |
382 | "__init__(Window parent, String message, String caption, |
383 | List choices=[], long style=CHOICEDLG_STYLE, | |
384 | Point pos=DefaultPosition) -> SingleChoiceDialog", | |
d07d2bc9 | 385 | "Constructor. Use ShowModal method to show the dialog.", ""); |
e5868095 | 386 | |
d14a1e28 RD |
387 | %extend { |
388 | // TODO: ignoring clientData for now... FIX THIS | |
7bf85405 RD |
389 | // SWIG is messing up the &/*'s for some reason. |
390 | wxSingleChoiceDialog(wxWindow* parent, | |
d14a1e28 RD |
391 | const wxString& message, |
392 | const wxString& caption, | |
393 | int choices, wxString* choices_array, | |
7bf85405 | 394 | //char** clientData = NULL, |
293a0a86 | 395 | long style = wxCHOICEDLG_STYLE, |
d14a1e28 RD |
396 | const wxPoint& pos = wxDefaultPosition) { |
397 | return new wxSingleChoiceDialog(parent, message, caption, | |
398 | choices, choices_array, NULL, style, pos); | |
7bf85405 | 399 | } |
09f3d4e6 | 400 | } |
9c039d08 | 401 | |
e5868095 RD |
402 | DocDeclStr( |
403 | int , GetSelection(), | |
d07d2bc9 | 404 | "Get the index of teh currently selected item.", ""); |
e5868095 RD |
405 | |
406 | DocDeclStr( | |
407 | wxString , GetStringSelection(), | |
d07d2bc9 | 408 | "Returns the string value of the currently selected item", ""); |
e5868095 RD |
409 | |
410 | DocDeclStr( | |
411 | void , SetSelection(int sel), | |
d07d2bc9 | 412 | "Set the current selected item to sel", ""); |
7bf85405 RD |
413 | }; |
414 | ||
415 | ||
d14a1e28 | 416 | //--------------------------------------------------------------------------- |
7bf85405 | 417 | |
e5868095 | 418 | DocStr(wxTextEntryDialog, |
d07d2bc9 | 419 | "A dialog with text control, [ok] and [cancel] buttons", ""); |
e5868095 | 420 | |
7bf85405 RD |
421 | class wxTextEntryDialog : public wxDialog { |
422 | public: | |
2b9048c5 | 423 | %pythonAppend wxTextEntryDialog "self._setOORInfo(self)" |
7bf85405 | 424 | |
e5868095 RD |
425 | DocCtorStr( |
426 | wxTextEntryDialog(wxWindow* parent, | |
427 | const wxString& message, | |
428 | const wxString& caption = wxPyGetTextFromUserPromptStr, | |
429 | const wxString& defaultValue = wxPyEmptyString, | |
430 | long style = wxOK | wxCANCEL | wxCENTRE, | |
431 | const wxPoint& pos = wxDefaultPosition), | |
d07d2bc9 | 432 | "Constructor. Use ShowModal method to show the dialog.", ""); |
e5868095 RD |
433 | |
434 | DocDeclStr( | |
435 | wxString , GetValue(), | |
dce2bd22 | 436 | "Returns the text that the user has entered if the user has pressed OK, |
d07d2bc9 | 437 | or the original value if the user has pressed Cancel.", ""); |
e5868095 RD |
438 | |
439 | DocDeclStr( | |
440 | void , SetValue(const wxString& value), | |
d07d2bc9 | 441 | "Sets the default text value.", ""); |
7bf85405 RD |
442 | }; |
443 | ||
d14a1e28 | 444 | //--------------------------------------------------------------------------- |
7bf85405 | 445 | |
e5868095 RD |
446 | |
447 | DocStr(wxFontData, | |
dce2bd22 | 448 | "This class holds a variety of information related to font dialogs and |
d07d2bc9 | 449 | is used to transfer settings to and results from a `wx.FontDialog`.", ""); |
e5868095 RD |
450 | |
451 | ||
9416aa89 | 452 | class wxFontData : public wxObject { |
7bf85405 RD |
453 | public: |
454 | wxFontData(); | |
455 | ~wxFontData(); | |
456 | ||
e5868095 RD |
457 | DocDeclStr( |
458 | void , EnableEffects(bool enable), | |
dce2bd22 RD |
459 | "Enables or disables 'effects' under MS Windows only. This refers to |
460 | the controls for manipulating colour, strikeout and underline | |
d07d2bc9 | 461 | properties. The default value is true.", ""); |
e5868095 RD |
462 | |
463 | DocDeclStr( | |
464 | bool , GetAllowSymbols(), | |
dce2bd22 RD |
465 | "Under MS Windows, returns a flag determining whether symbol fonts can |
466 | be selected. Has no effect on other platforms. The default value is | |
d07d2bc9 | 467 | true.", ""); |
e5868095 RD |
468 | |
469 | DocDeclStr( | |
470 | wxColour , GetColour(), | |
dce2bd22 | 471 | "Gets the colour associated with the font dialog. The default value is |
d07d2bc9 | 472 | black.", ""); |
e5868095 RD |
473 | |
474 | DocDeclStr( | |
475 | wxFont , GetChosenFont(), | |
d07d2bc9 | 476 | "Gets the font chosen by the user.", ""); |
e5868095 RD |
477 | |
478 | DocDeclStr( | |
479 | bool , GetEnableEffects(), | |
d07d2bc9 | 480 | "Determines whether 'effects' are enabled under Windows.", ""); |
e5868095 RD |
481 | |
482 | DocDeclStr( | |
483 | wxFont , GetInitialFont(), | |
dce2bd22 | 484 | "Gets the font that will be initially used by the font dialog. This |
d07d2bc9 | 485 | should have previously been set by the application.", ""); |
e5868095 RD |
486 | |
487 | DocDeclStr( | |
488 | bool , GetShowHelp(), | |
dce2bd22 | 489 | "Returns true if the Help button will be shown (Windows only). The |
d07d2bc9 | 490 | default value is false.", ""); |
e5868095 RD |
491 | |
492 | DocDeclStr( | |
493 | void , SetAllowSymbols(bool allowSymbols), | |
dce2bd22 | 494 | "Under MS Windows, determines whether symbol fonts can be selected. Has |
d07d2bc9 | 495 | no effect on other platforms. The default value is true.", ""); |
e5868095 RD |
496 | |
497 | DocDeclStr( | |
498 | void , SetChosenFont(const wxFont& font), | |
dce2bd22 | 499 | "Sets the font that will be returned to the user (normally for internal |
d07d2bc9 | 500 | use only).", ""); |
e5868095 RD |
501 | |
502 | DocDeclStr( | |
503 | void , SetColour(const wxColour& colour), | |
dce2bd22 | 504 | "Sets the colour that will be used for the font foreground colour. The |
d07d2bc9 | 505 | default colour is black.", ""); |
e5868095 RD |
506 | |
507 | DocDeclStr( | |
508 | void , SetInitialFont(const wxFont& font), | |
d07d2bc9 | 509 | "Sets the font that will be initially used by the font dialog.", ""); |
e5868095 RD |
510 | |
511 | DocDeclStr( | |
512 | void , SetRange(int min, int max), | |
dce2bd22 | 513 | "Sets the valid range for the font point size (Windows only). The |
d07d2bc9 | 514 | default is 0, 0 (unrestricted range).", ""); |
e5868095 RD |
515 | |
516 | DocDeclStr( | |
517 | void , SetShowHelp(bool showHelp), | |
dce2bd22 | 518 | "Determines whether the Help button will be displayed in the font |
d07d2bc9 | 519 | dialog (Windows only). The default value is false.", ""); |
7bf85405 RD |
520 | }; |
521 | ||
522 | ||
e5868095 RD |
523 | |
524 | ||
525 | DocStr(wxFontDialog, | |
dce2bd22 RD |
526 | "wx.FontDialog allows the user to select a system font and its attributes. |
527 | ||
528 | :see: `wx.FontData` | |
d07d2bc9 | 529 | ", ""); |
e5868095 | 530 | |
7bf85405 RD |
531 | class wxFontDialog : public wxDialog { |
532 | public: | |
2b9048c5 | 533 | %pythonAppend wxFontDialog "self._setOORInfo(self)" |
e5868095 RD |
534 | |
535 | DocStr(wxFontDialog, | |
dce2bd22 RD |
536 | "Constructor. Pass a parent window and the `wx.FontData` object to be |
537 | used to initialize the dialog controls. Call `ShowModal` to display | |
538 | the dialog. If ShowModal returns ``wx.ID_OK`` then you can fetch the | |
d07d2bc9 | 539 | results with via the `wx.FontData` returned by `GetFontData`.", ""); |
557a93b9 | 540 | wxFontDialog(wxWindow* parent, const wxFontData& data); |
7bf85405 | 541 | |
e5868095 RD |
542 | |
543 | DocDeclStr( | |
544 | wxFontData& , GetFontData(), | |
dce2bd22 | 545 | "Returns a reference to the internal `wx.FontData` used by the |
d07d2bc9 | 546 | wx.FontDialog.", ""); |
7bf85405 RD |
547 | }; |
548 | ||
549 | ||
d14a1e28 | 550 | //--------------------------------------------------------------------------- |
7bf85405 | 551 | |
e5868095 RD |
552 | |
553 | DocStr(wxMessageDialog, | |
dce2bd22 | 554 | "This class provides a simple dialog that shows a single or multi-line |
d07d2bc9 | 555 | message, with a choice of OK, Yes, No and/or Cancel buttons.", " |
dce2bd22 RD |
556 | |
557 | Window Styles | |
558 | -------------- | |
d07d2bc9 RD |
559 | =================== ============================================= |
560 | wx.OK Show an OK button. | |
561 | wx.CANCEL Show a Cancel button. | |
562 | wx.YES_NO Show Yes and No buttons. | |
563 | wx.YES_DEFAULT Used with wxYES_NO, makes Yes button the | |
564 | default - which is the default behaviour. | |
565 | wx.NO_DEFAULT Used with wxYES_NO, makes No button the default. | |
566 | wx.ICON_EXCLAMATION Shows an exclamation mark icon. | |
567 | wx.ICON_HAND Shows an error icon. | |
568 | wx.ICON_ERROR Shows an error icon - the same as wxICON_HAND. | |
569 | wx.ICON_QUESTION Shows a question mark icon. | |
570 | wx.ICON_INFORMATION Shows an information (i) icon. | |
571 | wx.STAY_ON_TOP The message box stays on top of all other | |
572 | window, even those of the other applications | |
573 | (Windows only). | |
574 | =================== ============================================= | |
e5868095 RD |
575 | "); |
576 | ||
577 | ||
7bf85405 RD |
578 | class wxMessageDialog : public wxDialog { |
579 | public: | |
2b9048c5 | 580 | %pythonAppend wxMessageDialog "self._setOORInfo(self)" |
d14a1e28 | 581 | |
dce2bd22 RD |
582 | DocCtorStr( |
583 | wxMessageDialog(wxWindow* parent, | |
584 | const wxString& message, | |
585 | const wxString& caption = wxPyMessageBoxCaptionStr, | |
586 | long style = wxOK | wxCANCEL | wxCENTRE, | |
587 | const wxPoint& pos = wxDefaultPosition), | |
d07d2bc9 | 588 | "Constructor, use `ShowModal` to display the dialog.", ""); |
7bf85405 | 589 | |
7bf85405 RD |
590 | }; |
591 | ||
d14a1e28 | 592 | //--------------------------------------------------------------------------- |
7bf85405 | 593 | |
e5868095 RD |
594 | |
595 | DocStr(wxProgressDialog, | |
dce2bd22 | 596 | "A dialog that shows a short message and a progress bar. Optionally, it |
d07d2bc9 | 597 | can display an ABORT button.", " |
dce2bd22 RD |
598 | |
599 | Window Styles | |
600 | -------------- | |
d07d2bc9 RD |
601 | ==================== ============================================= |
602 | wx.PD_APP_MODAL Make the progress dialog modal. If this flag is | |
603 | not given, it is only \"locally\" modal - | |
604 | that is the input to the parent window is | |
605 | disabled, but not to the other ones. | |
606 | ||
607 | wx.PD_AUTO_HIDE Causes the progress dialog to disappear from | |
608 | screen as soon as the maximum value of the | |
609 | progress meter has been reached. | |
610 | ||
611 | wx.PD_CAN_ABORT This flag tells the dialog that it should have | |
612 | a \"Cancel\" button which the user may press. If | |
613 | this happens, the next call to Update() will | |
614 | return false. | |
615 | ||
616 | wx.PD_ELAPSED_TIME This flag tells the dialog that it should show | |
617 | elapsed time (since creating the dialog). | |
618 | ||
619 | wx.PD_ESTIMATED_TIME This flag tells the dialog that it should show | |
620 | estimated time. | |
621 | ||
622 | wx.PD_REMAINING_TIME This flag tells the dialog that it should show | |
623 | remaining time. | |
624 | ==================== ============================================= | |
e5868095 RD |
625 | "); |
626 | ||
627 | ||
bb0054cd RD |
628 | class wxProgressDialog : public wxFrame { |
629 | public: | |
2b9048c5 | 630 | %pythonAppend wxProgressDialog "self._setOORInfo(self)" |
7bf85405 | 631 | |
e5868095 RD |
632 | DocCtorStr( |
633 | wxProgressDialog(const wxString& title, | |
634 | const wxString& message, | |
635 | int maximum = 100, | |
636 | wxWindow* parent = NULL, | |
637 | int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL ), | |
dce2bd22 RD |
638 | "Constructor. Creates the dialog, displays it and disables user input |
639 | for other windows, or, if wx.PD_APP_MODAL flag is not given, for its | |
d07d2bc9 | 640 | parent window only.", ""); |
e5868095 RD |
641 | |
642 | DocDeclStr( | |
75e14ed5 | 643 | virtual bool , Update(int value, const wxString& newmsg = wxPyEmptyString), |
dce2bd22 RD |
644 | "Updates the dialog, setting the progress bar to the new value and, if |
645 | given changes the message above it. Returns true unless the Cancel | |
646 | button has been pressed. | |
647 | ||
648 | If false is returned, the application can either immediately destroy | |
649 | the dialog or ask the user for the confirmation and if the abort is | |
d07d2bc9 | 650 | not confirmed the dialog may be resumed with Resume function.", ""); |
e5868095 RD |
651 | |
652 | DocDeclStr( | |
653 | void , Resume(), | |
dce2bd22 | 654 | "Can be used to continue with the dialog, after the user had chosen to |
d07d2bc9 | 655 | abort.", ""); |
e5868095 | 656 | |
d14a1e28 | 657 | }; |
bb0054cd | 658 | |
d14a1e28 | 659 | //--------------------------------------------------------------------------- |
0122b7e3 RD |
660 | |
661 | enum wxFindReplaceFlags | |
662 | { | |
663 | // downward search/replace selected (otherwise - upwards) | |
664 | wxFR_DOWN = 1, | |
665 | ||
666 | // whole word search/replace selected | |
667 | wxFR_WHOLEWORD = 2, | |
668 | ||
669 | // case sensitive search/replace selected (otherwise - case insensitive) | |
670 | wxFR_MATCHCASE = 4 | |
671 | }; | |
672 | ||
673 | ||
674 | enum wxFindReplaceDialogStyles | |
675 | { | |
676 | // replace dialog (otherwise find dialog) | |
677 | wxFR_REPLACEDIALOG = 1, | |
678 | ||
679 | // don't allow changing the search direction | |
680 | wxFR_NOUPDOWN = 2, | |
681 | ||
682 | // don't allow case sensitive searching | |
683 | wxFR_NOMATCHCASE = 4, | |
684 | ||
685 | // don't allow whole word searching | |
686 | wxFR_NOWHOLEWORD = 8 | |
687 | }; | |
688 | ||
0122b7e3 | 689 | |
0122b7e3 | 690 | |
d14a1e28 RD |
691 | %constant wxEventType wxEVT_COMMAND_FIND; |
692 | %constant wxEventType wxEVT_COMMAND_FIND_NEXT; | |
693 | %constant wxEventType wxEVT_COMMAND_FIND_REPLACE; | |
694 | %constant wxEventType wxEVT_COMMAND_FIND_REPLACE_ALL; | |
695 | %constant wxEventType wxEVT_COMMAND_FIND_CLOSE; | |
0122b7e3 | 696 | |
0122b7e3 | 697 | |
d14a1e28 RD |
698 | %pythoncode { |
699 | EVT_FIND = wx.PyEventBinder( wxEVT_COMMAND_FIND, 1 ) | |
700 | EVT_FIND_NEXT = wx.PyEventBinder( wxEVT_COMMAND_FIND_NEXT, 1 ) | |
701 | EVT_FIND_REPLACE = wx.PyEventBinder( wxEVT_COMMAND_FIND_REPLACE, 1 ) | |
702 | EVT_FIND_REPLACE_ALL = wx.PyEventBinder( wxEVT_COMMAND_FIND_REPLACE_ALL, 1 ) | |
703 | EVT_FIND_CLOSE = wx.PyEventBinder( wxEVT_COMMAND_FIND_CLOSE, 1 ) | |
0122b7e3 | 704 | |
d14a1e28 RD |
705 | %# For backwards compatibility. Should they be removed? |
706 | EVT_COMMAND_FIND = EVT_FIND | |
707 | EVT_COMMAND_FIND_NEXT = EVT_FIND_NEXT | |
708 | EVT_COMMAND_FIND_REPLACE = EVT_FIND_REPLACE | |
709 | EVT_COMMAND_FIND_REPLACE_ALL = EVT_FIND_REPLACE_ALL | |
710 | EVT_COMMAND_FIND_CLOSE = EVT_FIND_CLOSE | |
711 | } | |
0122b7e3 | 712 | |
0122b7e3 | 713 | |
e5868095 | 714 | DocStr(wxFindDialogEvent, |
d07d2bc9 | 715 | "Events for the FindReplaceDialog", ""); |
e5868095 | 716 | |
0122b7e3 RD |
717 | class wxFindDialogEvent : public wxCommandEvent |
718 | { | |
719 | public: | |
720 | wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0); | |
e5868095 RD |
721 | |
722 | DocDeclStr( | |
723 | int , GetFlags(), | |
dce2bd22 | 724 | "Get the currently selected flags: this is the combination of |
d07d2bc9 | 725 | wx.FR_DOWN, wx.FR_WHOLEWORD and wx.FR_MATCHCASE flags.", ""); |
e5868095 RD |
726 | |
727 | DocDeclStr( | |
728 | const wxString& , GetFindString(), | |
d07d2bc9 | 729 | "Return the string to find (never empty).", ""); |
e5868095 RD |
730 | |
731 | DocDeclStr( | |
732 | const wxString& , GetReplaceString(), | |
dce2bd22 | 733 | "Return the string to replace the search string with (only for replace |
d07d2bc9 | 734 | and replace all events).", ""); |
e5868095 RD |
735 | |
736 | DocDeclStr( | |
737 | wxFindReplaceDialog *, GetDialog(), | |
d07d2bc9 | 738 | "Return the pointer to the dialog which generated this event.", ""); |
e5868095 RD |
739 | |
740 | DocDeclStr( | |
741 | void , SetFlags(int flags), | |
d07d2bc9 | 742 | "", ""); |
e5868095 RD |
743 | |
744 | DocDeclStr( | |
745 | void , SetFindString(const wxString& str), | |
d07d2bc9 | 746 | "", ""); |
e5868095 RD |
747 | |
748 | DocDeclStr( | |
749 | void , SetReplaceString(const wxString& str), | |
d07d2bc9 | 750 | "", ""); |
0122b7e3 RD |
751 | }; |
752 | ||
753 | ||
754 | ||
e5868095 | 755 | DocStr(wxFindReplaceData, |
dce2bd22 RD |
756 | "wx.FindReplaceData holds the data for wx.FindReplaceDialog. It is used |
757 | to initialize the dialog with the default values and will keep the | |
758 | last values from the dialog when it is closed. It is also updated each | |
759 | time a `wx.FindDialogEvent` is generated so instead of using the | |
760 | `wx.FindDialogEvent` methods you can also directly query this object. | |
761 | ||
762 | Note that all SetXXX() methods may only be called before showing the | |
d07d2bc9 | 763 | dialog and calling them has no effect later.", " |
dce2bd22 RD |
764 | |
765 | Flags | |
766 | ----- | |
767 | ================ =============================================== | |
768 | wx.FR_DOWN Downward search/replace selected (otherwise, | |
769 | upwards) | |
770 | ||
771 | wx.FR_WHOLEWORD Whole word search/replace selected | |
772 | ||
773 | wx.FR_MATCHCASE Case sensitive search/replace selected | |
774 | (otherwise, case insensitive) | |
775 | ================ =============================================== | |
e5868095 RD |
776 | "); |
777 | ||
778 | ||
779 | ||
780 | ||
0122b7e3 RD |
781 | class wxFindReplaceData : public wxObject |
782 | { | |
783 | public: | |
e5868095 RD |
784 | DocCtorStr( |
785 | wxFindReplaceData(int flags=0), | |
d07d2bc9 | 786 | "Constuctor initializes the flags to default value (0).", ""); |
e5868095 | 787 | |
0122b7e3 | 788 | ~wxFindReplaceData(); |
e5868095 | 789 | |
0122b7e3 | 790 | |
e5868095 RD |
791 | DocDeclStr( |
792 | const wxString& , GetFindString(), | |
d07d2bc9 | 793 | "Get the string to find.", ""); |
e5868095 RD |
794 | |
795 | DocDeclStr( | |
796 | const wxString& , GetReplaceString(), | |
d07d2bc9 | 797 | "Get the replacement string.", ""); |
e5868095 RD |
798 | |
799 | DocDeclStr( | |
800 | int , GetFlags(), | |
d07d2bc9 | 801 | "Get the combination of flag values.", ""); |
e5868095 RD |
802 | |
803 | DocDeclStr( | |
804 | void , SetFlags(int flags), | |
d07d2bc9 | 805 | "Set the flags to use to initialize the controls of the dialog.", ""); |
e5868095 RD |
806 | |
807 | DocDeclStr( | |
808 | void , SetFindString(const wxString& str), | |
d07d2bc9 | 809 | "Set the string to find (used as initial value by the dialog).", ""); |
e5868095 RD |
810 | |
811 | DocDeclStr( | |
812 | void , SetReplaceString(const wxString& str), | |
d07d2bc9 | 813 | "Set the replacement string (used as initial value by the dialog).", ""); |
e5868095 | 814 | |
0122b7e3 RD |
815 | }; |
816 | ||
817 | ||
e5868095 RD |
818 | |
819 | ||
820 | DocStr(wxFindReplaceDialog, | |
dce2bd22 RD |
821 | "wx.FindReplaceDialog is a standard modeless dialog which is used to |
822 | allow the user to search for some text (and possibly replace it with | |
823 | something else). The actual searching is supposed to be done in the | |
824 | owner window which is the parent of this dialog. Note that it means | |
825 | that unlike for the other standard dialogs this one must have a parent | |
826 | window. Also note that there is no way to use this dialog in a modal | |
d07d2bc9 | 827 | way; it is always, by design and implementation, modeless.", " |
dce2bd22 RD |
828 | |
829 | ||
830 | Window Styles | |
831 | ------------- | |
e5868095 | 832 | |
dce2bd22 RD |
833 | ===================== ========================================= |
834 | wx.FR_REPLACEDIALOG replace dialog (otherwise find dialog) | |
e5868095 | 835 | |
dce2bd22 | 836 | wx.FR_NOUPDOWN don't allow changing the search direction |
e5868095 | 837 | |
dce2bd22 | 838 | wx.FR_NOMATCHCASE don't allow case sensitive searching |
e5868095 | 839 | |
dce2bd22 RD |
840 | wx.FR_NOWHOLEWORD don't allow whole word searching |
841 | ===================== ========================================= | |
e5868095 RD |
842 | "); |
843 | ||
0122b7e3 RD |
844 | class wxFindReplaceDialog : public wxDialog { |
845 | public: | |
2b9048c5 RD |
846 | %pythonAppend wxFindReplaceDialog "self._setOORInfo(self)" |
847 | %pythonAppend wxFindReplaceDialog() "" | |
d14a1e28 | 848 | |
e5868095 RD |
849 | DocCtorStr( |
850 | wxFindReplaceDialog(wxWindow *parent, | |
851 | wxFindReplaceData *data, | |
852 | const wxString &title, | |
853 | int style = 0), | |
dce2bd22 | 854 | "Create a FindReplaceDialog. The parent and data parameters must be |
d07d2bc9 | 855 | non-None. Use Show to display the dialog.", ""); |
e5868095 RD |
856 | |
857 | DocCtorStrName( | |
858 | wxFindReplaceDialog(), | |
d07d2bc9 | 859 | "Precreate a FindReplaceDialog for 2-phase creation", "", |
e5868095 | 860 | PreFindReplaceDialog); |
0122b7e3 | 861 | |
e5868095 RD |
862 | |
863 | DocDeclStr( | |
dce2bd22 RD |
864 | bool , Create(wxWindow *parent, wxFindReplaceData *data, |
865 | const wxString &title, int style = 0), | |
d07d2bc9 | 866 | "Create the dialog, for 2-phase create.", ""); |
e5868095 | 867 | |
0122b7e3 | 868 | |
e5868095 RD |
869 | DocDeclStr( |
870 | const wxFindReplaceData *, GetData(), | |
d07d2bc9 | 871 | "Get the FindReplaceData object used by this dialog.", ""); |
e5868095 RD |
872 | |
873 | DocDeclStr( | |
874 | void , SetData(wxFindReplaceData *data), | |
d07d2bc9 | 875 | "Set the FindReplaceData object used by this dialog.", ""); |
e5868095 | 876 | |
0122b7e3 RD |
877 | }; |
878 | ||
d14a1e28 RD |
879 | //--------------------------------------------------------------------------- |
880 | //--------------------------------------------------------------------------- |