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