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