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