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