1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: SWIG interface for the "Common Dialog" classes
7 // Created: 25-July-1998
9 // Copyright: (c) 2003 by Total Control Software
10 // Licence: wxWindows license
11 /////////////////////////////////////////////////////////////////////////////
16 //---------------------------------------------------------------------------
19 MAKE_CONST_WXSTRING(FileSelectorPromptStr);
20 MAKE_CONST_WXSTRING(DirSelectorPromptStr);
21 MAKE_CONST_WXSTRING(DirDialogNameStr);
22 MAKE_CONST_WXSTRING(FileSelectorDefaultWildcardStr);
23 MAKE_CONST_WXSTRING(GetTextFromUserPromptStr);
24 MAKE_CONST_WXSTRING(MessageBoxCaptionStr);
26 //---------------------------------------------------------------------------
30 "This class holds a variety of information related to the colour
31 chooser dialog, used to transfer settings and results to and from the
32 `wx.ColourDialog`.", "");
34 class wxColourData : public wxObject {
38 "Constructor, sets default values.", "");
44 bool , GetChooseFull(),
45 "Under Windows, determines whether the Windows colour dialog will
46 display the full dialog with custom colour selection controls. Has no
47 meaning under other platforms. The default value is true.", "");
50 wxColour , GetColour(),
51 "Gets the colour (pre)selected by the dialog.", "");
54 wxColour , GetCustomColour(int i),
55 "Gets the i'th custom colour associated with the colour dialog. i
56 should be an integer between 0 and 15. The default custom colours are
57 all invalid colours.", "");
60 void , SetChooseFull(int flag),
61 "Under Windows, tells the Windows colour dialog to display the full
62 dialog with custom colour selection controls. Under other platforms,
63 has no effect. The default value is true.", "");
66 void , SetColour(const wxColour& colour),
67 "Sets the default colour for the colour dialog. The default colour is
71 void , SetCustomColour(int i, const wxColour& colour),
72 "Sets the i'th custom colour for the colour dialog. i should be an
73 integer between 0 and 15. The default custom colours are all invalid colours.", "");
76 %property(ChooseFull, GetChooseFull, SetChooseFull, doc="See `GetChooseFull` and `SetChooseFull`");
77 %property(Colour, GetColour, SetColour, doc="See `GetColour` and `SetColour`");
78 %property(CustomColour, GetCustomColour, SetCustomColour, doc="See `GetCustomColour` and `SetCustomColour`");
85 DocStr(wxColourDialog,
86 "This class represents the colour chooser dialog.", "");
88 MustHaveApp(wxColourDialog);
90 class wxColourDialog : public wxDialog {
92 %pythonAppend wxColourDialog "self._setOORInfo(self)"
95 wxColourDialog(wxWindow* parent, wxColourData* data = NULL),
96 "Constructor. Pass a parent window, and optionally a `wx.ColourData`,
97 which will be copied to the colour dialog's internal ColourData
101 wxColourData& , GetColourData(),
102 "Returns a reference to the `wx.ColourData` used by the dialog.", "");
104 %property(ColourData, GetColourData, doc="See `GetColourData`");
108 wxColour wxGetColourFromUser(wxWindow *parent = (wxWindow *)NULL,
109 const wxColour& colInit = wxNullColour,
110 const wxString& caption = wxPyEmptyString);
113 //--------------------------------------------------------------------------------
122 "wx.DirDialog allows the user to select a directory by browising the
127 ==================== ==========================================
128 wx.DD_DEFAULT_STYLE Equivalent to a combination of
129 wx.DEFAULT_DIALOG_STYLE, wx.DD_NEW_DIR_BUTTON
130 and wx.RESIZE_BORDER.
132 wx.DD_NEW_DIR_BUTTON Add 'Create new directory' button and allow
133 directory names to be editable. On Windows
134 the new directory button is only available
135 with recent versions of the common dialogs.
137 wx.DD_CHANGE_DIR Change the current working directory to the
138 directory chosen by the user.
139 ==================== ==========================================
142 MustHaveApp(wxDirDialog);
144 class wxDirDialog : public wxDialog {
146 %pythonAppend wxDirDialog "self._setOORInfo(self)"
147 %pythonAppend wxDirDialog() ""
150 wxDirDialog(wxWindow* parent,
151 const wxString& message = wxPyDirSelectorPromptStr,
152 const wxString& defaultPath = wxPyEmptyString,
153 long style = wxDD_DEFAULT_STYLE,
154 const wxPoint& pos = wxDefaultPosition,
155 const wxSize& size = wxDefaultSize,
156 const wxString& name = wxPyDirDialogNameStr),
157 "Constructor. Use ShowModal method to show the dialog.", "");
159 // %RenameCtor(PreDirDialog, wxDirDialog());
161 // bool Create(wxWindow *parent,
162 // const wxString& title = wxDirSelectorPromptStr,
163 // const wxString& defaultPath = wxEmptyString,
164 // long style = wxDD_DEFAULT_STYLE,
165 // const wxPoint& pos = wxDefaultPosition,
166 // const wxSize& sz = wxDefaultSize,
167 // const wxString& name = wxPyDirDialogNameStr);
170 wxString , GetPath(),
171 "Returns the default or user-selected path.", "");
174 wxString , GetMessage(),
175 "Returns the message that will be displayed on the dialog.", "");
178 void , SetMessage(const wxString& message),
179 "Sets the message that will be displayed on the dialog.", "");
182 void , SetPath(const wxString& path),
183 "Sets the default path.", "");
185 %property(Message, GetMessage, SetMessage, doc="See `GetMessage` and `SetMessage`");
186 %property(Path, GetPath, SetPath, doc="See `GetPath` and `SetPath`");
190 //---------------------------------------------------------------------------
193 // for compatibility only
194 #define wxHIDE_READONLY 0
198 // These will dissappear in 2.8
209 wxFD_OVERWRITE_PROMPT,
210 wxFD_FILE_MUST_EXIST,
218 "wx.FileDialog allows the user to select one or more files from the
221 In Windows, this is the common file selector dialog. On X based
222 platforms a generic alternative is used. The path and filename are
223 distinct elements of a full file pathname. If path is \"\", the
224 current directory will be used. If filename is \"\", no default
225 filename will be supplied. The wildcard determines what files are
226 displayed in the file selector, and file extension supplies a type
227 extension for the required filename.
229 Both the X and Windows versions implement a wildcard filter. Typing a
230 filename containing wildcards (\*, ?) in the filename text item, and
231 clicking on Ok, will result in only those files matching the pattern
232 being displayed. The wildcard may be a specification for multiple
233 types of file with a description for each, such as::
235 \"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif\"
240 ====================== ==========================================
241 wx.FD_OPEN This is an open dialog.
243 wx.FD_SAVE This is a save dialog.
245 wx.FD_OVERWRITE_PROMPT For save dialog only: prompt for a confirmation
246 if a file will be overwritten.
248 wx.FD_MULTIPLE For open dialog only: allows selecting multiple
251 wx.FD_CHANGE_DIR Change the current working directory to the
252 directory where the file(s) chosen by the user
254 ====================== ==========================================
259 MustHaveApp(wxFileDialog);
261 class wxFileDialog : public wxDialog {
263 %pythonAppend wxFileDialog "self._setOORInfo(self)"
266 wxFileDialog(wxWindow* parent,
267 const wxString& message = wxPyFileSelectorPromptStr,
268 const wxString& defaultDir = wxPyEmptyString,
269 const wxString& defaultFile = wxPyEmptyString,
270 const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
271 long style = wxFD_DEFAULT_STYLE,
272 const wxPoint& pos = wxDefaultPosition),
273 "Constructor. Use ShowModal method to show the dialog.", "");
277 void , SetMessage(const wxString& message),
278 "Sets the message that will be displayed on the dialog.", "");
281 void , SetPath(const wxString& path),
282 "Sets the path (the combined directory and filename that will be
283 returned when the dialog is dismissed).", "");
286 void , SetDirectory(const wxString& dir),
287 "Sets the default directory.", "");
290 void , SetFilename(const wxString& name),
291 "Sets the default filename.", "");
294 void , SetWildcard(const wxString& wildCard),
295 "Sets the wildcard, which can contain multiple file types, for
298 \"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif\"
302 void , SetFilterIndex(int filterIndex),
303 "Sets the default filter index, starting from zero.", "");
306 wxString , GetMessage() const,
307 "Returns the message that will be displayed on the dialog.", "");
310 wxString , GetPath() const,
311 "Returns the full path (directory and filename) of the selected file.", "");
314 wxString , GetDirectory() const,
315 "Returns the default directory.", "");
318 wxString , GetFilename() const,
319 "Returns the default filename.", "");
322 wxString , GetWildcard() const,
323 "Returns the file dialog wildcard.", "");
326 int , GetFilterIndex() const,
327 "Returns the index into the list of filters supplied, optionally, in
328 the wildcard parameter. Before the dialog is shown, this is the index
329 which will be used when the dialog is first displayed. After the
330 dialog is shown, this is the index selected by the user.", "");
335 "Returns a list of filenames chosen in the dialog. This function
336 should only be used with the dialogs which have wx.MULTIPLE style, use
337 GetFilename for the others.", "");
338 PyObject* GetFilenames() {
340 self->GetFilenames(arr);
341 return wxArrayString2PyList_helper(arr);
345 "Fills the array paths with the full paths of the files chosen. This
346 function should only be used with the dialogs which have wx.MULTIPLE
347 style, use GetPath for the others.", "");
349 PyObject* GetPaths() {
352 return wxArrayString2PyList_helper(arr);
357 // // Utility functions
359 // // Parses the wildCard, returning the number of filters.
360 // // Returns 0 if none or if there's a problem,
361 // // The arrays will contain an equal number of items found before the error.
362 // // wildCard is in the form:
363 // // "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png"
364 // static int ParseWildcard(const wxString& wildCard,
365 // wxArrayString& descriptions,
366 // wxArrayString& filters);
368 // // Append first extension to filePath from a ';' separated extensionList
369 // // if filePath = "path/foo.bar" just return it as is
370 // // if filePath = "foo[.]" and extensionList = "*.jpg;*.png" return "foo.jpg"
371 // // if the extension is "*.j?g" (has wildcards) or "jpg" then return filePath
372 // static wxString AppendExtension(const wxString &filePath,
373 // const wxString &extensionList);
376 %property(Directory, GetDirectory, SetDirectory, doc="See `GetDirectory` and `SetDirectory`");
377 %property(Filename, GetFilename, SetFilename, doc="See `GetFilename` and `SetFilename`");
378 %property(Filenames, GetFilenames, doc="See `GetFilenames`");
379 %property(FilterIndex, GetFilterIndex, SetFilterIndex, doc="See `GetFilterIndex` and `SetFilterIndex`");
380 %property(Message, GetMessage, SetMessage, doc="See `GetMessage` and `SetMessage`");
381 %property(Path, GetPath, SetPath, doc="See `GetPath` and `SetPath`");
382 %property(Paths, GetPaths, doc="See `GetPaths`");
383 %property(Wildcard, GetWildcard, SetWildcard, doc="See `GetWildcard` and `SetWildcard`");
388 //---------------------------------------------------------------------------
390 enum { wxCHOICEDLG_STYLE };
393 DocStr(wxMultiChoiceDialog,
394 "A simple dialog with a multi selection listbox.", "");
396 MustHaveApp(wxMultiChoiceDialog);
398 class wxMultiChoiceDialog : public wxDialog
401 %pythonAppend wxMultiChoiceDialog "self._setOORInfo(self)"
404 wxMultiChoiceDialog(wxWindow *parent,
405 const wxString& message,
406 const wxString& caption,
407 int choices=0, wxString* choices_array=NULL,
408 long style = wxCHOICEDLG_STYLE,
409 const wxPoint& pos = wxDefaultPosition),
410 "__init__(self, Window parent, String message, String caption,
411 List choices=EmptyList, long style=CHOICEDLG_STYLE,
412 Point pos=DefaultPosition) -> MultiChoiceDialog",
413 "Constructor. Use the `ShowModal` method to show the dialog.
415 :param parent: The parent window.
416 :param message: Text to display above the list of selections.
417 :param caption: Text to use in the title bar of the dialog.
418 :param choices: A list of strings or unicode objects that the
419 user is allowed to choose from.
420 :param style: Styles to apply to the dialog. The default value is
421 equivallent to wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.OK|wx.CANCEL|wx.CENTER.
422 :param pos: Where to position the dialog (not used on Windows)
428 void, SetSelections(const wxArrayInt& selections),
429 "SetSelections(List selections)",
430 "Specify the items in the list that should be selected, using a list of
431 integers. The list should specify the indexes of the items that
432 should be selected.", "");
434 DocAStr(GetSelections,
435 "GetSelections() -> [selections]",
436 "Returns a list of integers representing the items that are selected.
437 If an item is selected then its index will appear in the list.", "");
439 PyObject* GetSelections() {
440 return wxArrayInt2PyList_helper(self->GetSelections());
446 //---------------------------------------------------------------------------
448 DocStr(wxSingleChoiceDialog,
449 "A simple dialog with a single selection listbox.", "");
451 MustHaveApp(wxSingleChoiceDialog);
453 class wxSingleChoiceDialog : public wxDialog {
455 %pythonAppend wxSingleChoiceDialog "self._setOORInfo(self)"
457 DocAStr(wxSingleChoiceDialog,
458 "__init__(Window parent, String message, String caption,
459 List choices=EmptyList, long style=CHOICEDLG_STYLE,
460 Point pos=DefaultPosition) -> SingleChoiceDialog",
461 "Constructor. Use ShowModal method to show the dialog.", "");
464 // TODO: ignoring clientData for now... FIX THIS
465 // SWIG is messing up the &/*'s for some reason.
466 wxSingleChoiceDialog(wxWindow* parent,
467 const wxString& message,
468 const wxString& caption,
469 int choices, wxString* choices_array,
470 //char** clientData = NULL,
471 long style = wxCHOICEDLG_STYLE,
472 const wxPoint& pos = wxDefaultPosition) {
473 return new wxSingleChoiceDialog(parent, message, caption,
474 choices, choices_array, NULL, style, pos);
479 int , GetSelection(),
480 "Get the index of the currently selected item.", "");
483 wxString , GetStringSelection(),
484 "Returns the string value of the currently selected item", "");
487 void , SetSelection(int sel),
488 "Set the current selected item to sel", "");
492 //---------------------------------------------------------------------------
494 DocStr(wxTextEntryDialog,
495 "A dialog with text control, [ok] and [cancel] buttons", "");
497 MustHaveApp(wxTextEntryDialog);
499 enum { wxTextEntryDialogStyle };
501 class wxTextEntryDialog : public wxDialog {
503 %pythonAppend wxTextEntryDialog "self._setOORInfo(self)"
506 wxTextEntryDialog(wxWindow* parent,
507 const wxString& message,
508 const wxString& caption = wxPyGetTextFromUserPromptStr,
509 const wxString& defaultValue = wxPyEmptyString,
510 long style = wxTextEntryDialogStyle,
511 const wxPoint& pos = wxDefaultPosition),
512 "Constructor. Use ShowModal method to show the dialog.", "");
515 wxString , GetValue(),
516 "Returns the text that the user has entered if the user has pressed OK,
517 or the original value if the user has pressed Cancel.", "");
520 void , SetValue(const wxString& value),
521 "Sets the default text value.", "");
524 //---------------------------------------------------------------------------
526 MAKE_CONST_WXSTRING(GetPasswordFromUserPromptStr);
528 class wxPasswordEntryDialog : public wxTextEntryDialog
531 wxPasswordEntryDialog(wxWindow *parent,
532 const wxString& message,
533 const wxString& caption = wxPyGetPasswordFromUserPromptStr,
534 const wxString& value = wxPyEmptyString,
535 long style = wxTextEntryDialogStyle,
536 const wxPoint& pos = wxDefaultPosition);
539 //---------------------------------------------------------------------------
541 DocStr( wxNumberEntryDialog,
542 "A dialog with spin control, ok and cancel buttons.", "")
544 MustHaveApp(wxNumberEntryDialog);
546 class wxNumberEntryDialog : public wxDialog
549 %pythonAppend wxNumberEntryDialog "self._setOORInfo(self)"
552 wxNumberEntryDialog(wxWindow *parent,
553 const wxString& message,
554 const wxString& prompt,
555 const wxString& caption,
556 long value, long min, long max,
557 const wxPoint& pos = wxDefaultPosition),
558 "Constructor. Use ShowModal method to show the dialog.", "");
563 //---------------------------------------------------------------------------
567 "This class holds a variety of information related to font dialogs and
568 is used to transfer settings to and results from a `wx.FontDialog`.", "");
571 class wxFontData : public wxObject {
577 void , EnableEffects(bool enable),
578 "Enables or disables 'effects' under MS Windows only. This refers to
579 the controls for manipulating colour, strikeout and underline
580 properties. The default value is true.", "");
583 bool , GetAllowSymbols(),
584 "Under MS Windows, returns a flag determining whether symbol fonts can
585 be selected. Has no effect on other platforms. The default value is
589 wxColour , GetColour(),
590 "Gets the colour associated with the font dialog. The default value is
594 wxFont , GetChosenFont(),
595 "Gets the font chosen by the user.", "");
598 bool , GetEnableEffects(),
599 "Determines whether 'effects' are enabled under Windows.", "");
602 wxFont , GetInitialFont(),
603 "Gets the font that will be initially used by the font dialog. This
604 should have previously been set by the application.", "");
607 bool , GetShowHelp(),
608 "Returns true if the Help button will be shown (Windows only). The
609 default value is false.", "");
612 void , SetAllowSymbols(bool allowSymbols),
613 "Under MS Windows, determines whether symbol fonts can be selected. Has
614 no effect on other platforms. The default value is true.", "");
617 void , SetChosenFont(const wxFont& font),
618 "Sets the font that will be returned to the user (normally for internal
622 void , SetColour(const wxColour& colour),
623 "Sets the colour that will be used for the font foreground colour. The
624 default colour is black.", "");
627 void , SetInitialFont(const wxFont& font),
628 "Sets the font that will be initially used by the font dialog.", "");
631 void , SetRange(int min, int max),
632 "Sets the valid range for the font point size (Windows only). The
633 default is 0, 0 (unrestricted range).", "");
636 void , SetShowHelp(bool showHelp),
637 "Determines whether the Help button will be displayed in the font
638 dialog (Windows only). The default value is false.", "");
640 %property(AllowSymbols, GetAllowSymbols, SetAllowSymbols, doc="See `GetAllowSymbols` and `SetAllowSymbols`");
641 %property(ChosenFont, GetChosenFont, SetChosenFont, doc="See `GetChosenFont` and `SetChosenFont`");
642 %property(Colour, GetColour, SetColour, doc="See `GetColour` and `SetColour`");
643 %property(EnableEffects, GetEnableEffects, doc="See `GetEnableEffects`");
644 %property(InitialFont, GetInitialFont, SetInitialFont, doc="See `GetInitialFont` and `SetInitialFont`");
645 %property(ShowHelp, GetShowHelp, SetShowHelp, doc="See `GetShowHelp` and `SetShowHelp`");
653 "wx.FontDialog allows the user to select a system font and its attributes.
658 MustHaveApp(wxFontDialog);
660 class wxFontDialog : public wxDialog {
662 %pythonAppend wxFontDialog "self._setOORInfo(self)"
665 "Constructor. Pass a parent window and the `wx.FontData` object to be
666 used to initialize the dialog controls. Call `ShowModal` to display
667 the dialog. If ShowModal returns ``wx.ID_OK`` then you can fetch the
668 results with via the `wx.FontData` returned by `GetFontData`.", "");
669 wxFontDialog(wxWindow* parent, const wxFontData& data);
673 wxFontData& , GetFontData(),
674 "Returns a reference to the internal `wx.FontData` used by the
675 wx.FontDialog.", "");
677 %property(FontData, GetFontData, doc="See `GetFontData`");
681 wxFont wxGetFontFromUser(wxWindow *parent = NULL,
682 const wxFont& fontInit = wxNullFont,
683 const wxString& caption = wxPyEmptyString);
686 //---------------------------------------------------------------------------
689 DocStr(wxMessageDialog,
690 "This class provides a simple dialog that shows a single or multi-line
691 message, with a choice of OK, Yes, No and/or Cancel buttons.", "
695 =================== =============================================
696 wx.OK Show an OK button.
697 wx.CANCEL Show a Cancel button.
698 wx.YES_NO Show Yes and No buttons.
699 wx.YES_DEFAULT Used with wxYES_NO, makes Yes button the
700 default - which is the default behaviour.
701 wx.NO_DEFAULT Used with wxYES_NO, makes No button the default.
702 wx.ICON_EXCLAMATION Shows an exclamation mark icon.
703 wx.ICON_HAND Shows an error icon.
704 wx.ICON_ERROR Shows an error icon - the same as wxICON_HAND.
705 wx.ICON_QUESTION Shows a question mark icon.
706 wx.ICON_INFORMATION Shows an information (i) icon.
707 wx.STAY_ON_TOP The message box stays on top of all other
708 window, even those of the other applications
710 =================== =============================================
714 MustHaveApp(wxMessageDialog);
716 class wxMessageDialog : public wxDialog {
718 %pythonAppend wxMessageDialog "self._setOORInfo(self)"
721 wxMessageDialog(wxWindow* parent,
722 const wxString& message,
723 const wxString& caption = wxPyMessageBoxCaptionStr,
724 long style = wxOK | wxCANCEL | wxCENTRE,
725 const wxPoint& pos = wxDefaultPosition),
726 "Constructor, use `ShowModal` to display the dialog.", "");
730 //---------------------------------------------------------------------------
744 DocStr(wxProgressDialog,
745 "A dialog that shows a short message and a progress bar. Optionally, it
746 can display an ABORT button.", "
750 ==================== =============================================
751 wx.PD_APP_MODAL Make the progress dialog modal. If this flag is
752 not given, it is only \"locally\" modal -
753 that is the input to the parent window is
754 disabled, but not to the other ones.
756 wx.PD_AUTO_HIDE Causes the progress dialog to disappear from
757 screen as soon as the maximum value of the
758 progress meter has been reached.
760 wx.PD_CAN_ABORT This flag tells the dialog that it should have
761 a \"Cancel\" button which the user may press. If
762 this happens, the next call to Update() will
763 return False in the first component of its return
766 wx.PD_CAN_SKIP This flag tells the dialog that it should have a
767 \"Skip\" button which the user may press. If this
768 happens, the next call to Update() will return
769 True in the second component of its return value.
771 wx.PD_ELAPSED_TIME This flag tells the dialog that it should show
772 elapsed time (since creating the dialog).
774 wx.PD_ESTIMATED_TIME This flag tells the dialog that it should show
777 wx.PD_REMAINING_TIME This flag tells the dialog that it should show
780 wx.PD_SMOOTH Uses the wx.GA_SMOOTH style on the embedded
782 ==================== =============================================
786 // TODO: wxPD_CAN_SKIP
788 MustHaveApp(wxProgressDialog);
790 class wxProgressDialog : public wxFrame {
792 %pythonAppend wxProgressDialog "self._setOORInfo(self)"
795 wxProgressDialog(const wxString& title,
796 const wxString& message,
798 wxWindow* parent = NULL,
799 int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL ),
800 "Constructor. Creates the dialog, displays it and disables user input
801 for other windows, or, if wx.PD_APP_MODAL flag is not given, for its
802 parent window only.", "");
804 // TODO: support getting the skipped value back in the return value, but
805 // only if style is set. This is so the API doesn't change for existing
808 virtual bool , Update(int value,
809 const wxString& newmsg = wxPyEmptyString,
811 "Update(self, int value, String newmsg) --> (continue, skip)",
812 "Updates the dialog, setting the progress bar to the new value and, if
813 given changes the message above it. The value given should be less
814 than or equal to the maximum value given to the constructor and the
815 dialog is closed if it is equal to the maximum. Returns a tuple of
816 boolean values, ``(continue, skip)`` where ``continue`` is ``True``
817 unless the Cancel button has been pressed, and ``skip`` is ``False``
818 unless the Skip button (if any) has been pressed.
820 If the ``continue`` return value is ``false``, the application can either
821 immediately destroy the dialog or ask the user for confirmation, and if the
822 abort is not confirmed the dialog may be resumed with `Resume` function.
827 virtual bool , UpdatePulse(const wxString& newmsg = wxPyEmptyString,
829 "UpdatePulse(self, String newmsg) --> (continue, skip)",
830 "Just like `Update` but switches the dialog to use a gauge in
831 interminante mode and calls `wx.Gauge.Pulse` to show the user a bit of
837 "Can be used to continue with the dialog, after the user had chosen to
842 //---------------------------------------------------------------------------
844 enum wxFindReplaceFlags
846 // downward search/replace selected (otherwise - upwards)
849 // whole word search/replace selected
852 // case sensitive search/replace selected (otherwise - case insensitive)
857 enum wxFindReplaceDialogStyles
859 // replace dialog (otherwise find dialog)
860 wxFR_REPLACEDIALOG = 1,
862 // don't allow changing the search direction
865 // don't allow case sensitive searching
866 wxFR_NOMATCHCASE = 4,
868 // don't allow whole word searching
874 %constant wxEventType wxEVT_COMMAND_FIND;
875 %constant wxEventType wxEVT_COMMAND_FIND_NEXT;
876 %constant wxEventType wxEVT_COMMAND_FIND_REPLACE;
877 %constant wxEventType wxEVT_COMMAND_FIND_REPLACE_ALL;
878 %constant wxEventType wxEVT_COMMAND_FIND_CLOSE;
882 EVT_FIND = wx.PyEventBinder( wxEVT_COMMAND_FIND, 1 )
883 EVT_FIND_NEXT = wx.PyEventBinder( wxEVT_COMMAND_FIND_NEXT, 1 )
884 EVT_FIND_REPLACE = wx.PyEventBinder( wxEVT_COMMAND_FIND_REPLACE, 1 )
885 EVT_FIND_REPLACE_ALL = wx.PyEventBinder( wxEVT_COMMAND_FIND_REPLACE_ALL, 1 )
886 EVT_FIND_CLOSE = wx.PyEventBinder( wxEVT_COMMAND_FIND_CLOSE, 1 )
888 %# For backwards compatibility. Should they be removed?
889 EVT_COMMAND_FIND = EVT_FIND
890 EVT_COMMAND_FIND_NEXT = EVT_FIND_NEXT
891 EVT_COMMAND_FIND_REPLACE = EVT_FIND_REPLACE
892 EVT_COMMAND_FIND_REPLACE_ALL = EVT_FIND_REPLACE_ALL
893 EVT_COMMAND_FIND_CLOSE = EVT_FIND_CLOSE
897 DocStr(wxFindDialogEvent,
898 "Events for the FindReplaceDialog", "");
900 class wxFindDialogEvent : public wxCommandEvent
903 wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
907 "Get the currently selected flags: this is the combination of
908 wx.FR_DOWN, wx.FR_WHOLEWORD and wx.FR_MATCHCASE flags.", "");
911 const wxString& , GetFindString(),
912 "Return the string to find (never empty).", "");
915 const wxString& , GetReplaceString(),
916 "Return the string to replace the search string with (only for replace
917 and replace all events).", "");
920 wxFindReplaceDialog *, GetDialog(),
921 "Return the pointer to the dialog which generated this event.", "");
924 void , SetFlags(int flags),
928 void , SetFindString(const wxString& str),
932 void , SetReplaceString(const wxString& str),
935 %property(Dialog, GetDialog, doc="See `GetDialog`");
936 %property(FindString, GetFindString, SetFindString, doc="See `GetFindString` and `SetFindString`");
937 %property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`");
938 %property(ReplaceString, GetReplaceString, SetReplaceString, doc="See `GetReplaceString` and `SetReplaceString`");
943 DocStr(wxFindReplaceData,
944 "wx.FindReplaceData holds the data for wx.FindReplaceDialog. It is used
945 to initialize the dialog with the default values and will keep the
946 last values from the dialog when it is closed. It is also updated each
947 time a `wx.FindDialogEvent` is generated so instead of using the
948 `wx.FindDialogEvent` methods you can also directly query this object.
950 Note that all SetXXX() methods may only be called before showing the
951 dialog and calling them has no effect later.", "
955 ================ ===============================================
956 wx.FR_DOWN Downward search/replace selected (otherwise,
959 wx.FR_WHOLEWORD Whole word search/replace selected
961 wx.FR_MATCHCASE Case sensitive search/replace selected
962 (otherwise, case insensitive)
963 ================ ===============================================
969 class wxFindReplaceData : public wxObject
973 wxFindReplaceData(int flags=0),
974 "Constuctor initializes the flags to default value (0).", "");
976 ~wxFindReplaceData();
980 const wxString& , GetFindString(),
981 "Get the string to find.", "");
984 const wxString& , GetReplaceString(),
985 "Get the replacement string.", "");
989 "Get the combination of flag values.", "");
992 void , SetFlags(int flags),
993 "Set the flags to use to initialize the controls of the dialog.", "");
996 void , SetFindString(const wxString& str),
997 "Set the string to find (used as initial value by the dialog).", "");
1000 void , SetReplaceString(const wxString& str),
1001 "Set the replacement string (used as initial value by the dialog).", "");
1003 %property(FindString, GetFindString, SetFindString, doc="See `GetFindString` and `SetFindString`");
1004 %property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`");
1005 %property(ReplaceString, GetReplaceString, SetReplaceString, doc="See `GetReplaceString` and `SetReplaceString`");
1011 DocStr(wxFindReplaceDialog,
1012 "wx.FindReplaceDialog is a standard modeless dialog which is used to
1013 allow the user to search for some text (and possibly replace it with
1014 something else). The actual searching is supposed to be done in the
1015 owner window which is the parent of this dialog. Note that it means
1016 that unlike for the other standard dialogs this one must have a parent
1017 window. Also note that there is no way to use this dialog in a modal
1018 way; it is always, by design and implementation, modeless.", "
1024 ===================== =========================================
1025 wx.FR_REPLACEDIALOG replace dialog (otherwise find dialog)
1027 wx.FR_NOUPDOWN don't allow changing the search direction
1029 wx.FR_NOMATCHCASE don't allow case sensitive searching
1031 wx.FR_NOWHOLEWORD don't allow whole word searching
1032 ===================== =========================================
1035 MustHaveApp(wxFindReplaceDialog);
1037 class wxFindReplaceDialog : public wxDialog {
1039 %pythonAppend wxFindReplaceDialog "self._setOORInfo(self)"
1040 %pythonAppend wxFindReplaceDialog() ""
1043 wxFindReplaceDialog(wxWindow *parent,
1044 wxFindReplaceData *data,
1045 const wxString &title,
1047 "Create a FindReplaceDialog. The parent and data parameters must be
1048 non-None. Use Show to display the dialog.", "");
1051 wxFindReplaceDialog(),
1052 "Precreate a FindReplaceDialog for 2-phase creation", "",
1053 PreFindReplaceDialog);
1057 bool , Create(wxWindow *parent, wxFindReplaceData *data,
1058 const wxString &title, int style = 0),
1059 "Create the dialog, for 2-phase create.", "");
1063 const wxFindReplaceData *, GetData(),
1064 "Get the FindReplaceData object used by this dialog.", "");
1067 void , SetData(wxFindReplaceData *data),
1068 "Set the FindReplaceData object used by this dialog.", "");
1070 %property(Data, GetData, SetData, doc="See `GetData` and `SetData`");
1073 //---------------------------------------------------------------------------
1074 //---------------------------------------------------------------------------