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