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 //--------------------------------------------------------------------------------
 
 123        "wx.DirDialog allows the user to select a directory by browising the
 
 128     ====================  ==========================================
 
 129     wx.DD_DEFAULT_STYLE   Equivalent to a combination of
 
 130                           wx.DEFAULT_DIALOG_STYLE, wx.DD_NEW_DIR_BUTTON
 
 131                           and wx.RESIZE_BORDER.
 
 133     wx.DD_DIR_MUST_EXIST  The dialog will allow the user to choose only an
 
 134                           existing folder. When this style is not given, a
 
 135                           'Create new directory' button is added to the dialog
 
 136                           (on Windows) or some other way is provided to the
 
 137                           user to type the name of a new folder.
 
 138                           Use this instead of deprecated wx.DD_NEW_DIR_BUTTON.
 
 140     wx.DD_CHANGE_DIR      Change the current working directory to the
 
 141                           directory chosen by the user.
 
 142     ====================  ==========================================
 
 145 MustHaveApp(wxDirDialog);
 
 147 class wxDirDialog : public wxDialog {
 
 149     %pythonAppend wxDirDialog   "self._setOORInfo(self)"
 
 150     %pythonAppend wxDirDialog() ""
 
 153         wxDirDialog(wxWindow* parent,
 
 154                     const wxString& message = wxPyDirSelectorPromptStr,
 
 155                     const wxString& defaultPath = wxPyEmptyString,
 
 156                     long style = wxDD_DEFAULT_STYLE,
 
 157                     const wxPoint& pos = wxDefaultPosition,
 
 158                     const wxSize& size = wxDefaultSize,
 
 159                     const wxString& name = wxPyDirDialogNameStr),
 
 160         "Constructor.  Use ShowModal method to show the dialog.", "");
 
 162 //     %RenameCtor(PreDirDialog, wxDirDialog());
 
 164 //     bool Create(wxWindow *parent,
 
 165 //                 const wxString& title = wxDirSelectorPromptStr,
 
 166 //                 const wxString& defaultPath = wxEmptyString,
 
 167 //                 long style = wxDD_DEFAULT_STYLE,
 
 168 //                 const wxPoint& pos = wxDefaultPosition,
 
 169 //                 const wxSize& sz = wxDefaultSize,
 
 170 //                 const wxString& name = wxPyDirDialogNameStr);
 
 173         wxString , GetPath(),
 
 174         "Returns the default or user-selected path.", "");
 
 177         wxString , GetMessage(),
 
 178         "Returns the message that will be displayed on the dialog.", "");
 
 181         void , SetMessage(const wxString& message),
 
 182         "Sets the message that will be displayed on the dialog.", "");
 
 185         void , SetPath(const wxString& path),
 
 186         "Sets the default path.", "");
 
 188     %property(Message, GetMessage, SetMessage, doc="See `GetMessage` and `SetMessage`");
 
 189     %property(Path, GetPath, SetPath, doc="See `GetPath` and `SetPath`");
 
 193 //---------------------------------------------------------------------------
 
 196 // for compatibility only    
 
 197 #define wxHIDE_READONLY 0
 
 203     wxFD_OVERWRITE_PROMPT,
 
 204     wxFD_FILE_MUST_EXIST,
 
 215     OVERWRITE_PROMPT  = FD_OVERWRITE_PROMPT,
 
 216     FILE_MUST_EXIST   = FD_FILE_MUST_EXIST,
 
 217     MULTIPLE          = FD_MULTIPLE,
 
 218     CHANGE_DIR        = FD_CHANGE_DIR
 
 223 "wx.FileDialog allows the user to select one or more files from the
 
 226 In Windows, this is the common file selector dialog. On X based
 
 227 platforms a generic alternative is used.  The path and filename are
 
 228 distinct elements of a full file pathname. If path is \"\", the
 
 229 current directory will be used. If filename is \"\", no default
 
 230 filename will be supplied. The wildcard determines what files are
 
 231 displayed in the file selector, and file extension supplies a type
 
 232 extension for the required filename.
 
 234 Both the X and Windows versions implement a wildcard filter. Typing a
 
 235 filename containing wildcards (\*, ?) in the filename text item, and
 
 236 clicking on Ok, will result in only those files matching the pattern
 
 237 being displayed. The wildcard may be a specification for multiple
 
 238 types of file with a description for each, such as::
 
 240    \"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif\"
 
 245     ======================   ==========================================
 
 246     wx.FD_OPEN               This is an open dialog.
 
 248     wx.FD_SAVE               This is a save dialog.
 
 250     wx.FD_OVERWRITE_PROMPT   For save dialog only: prompt for a confirmation
 
 251                              if a file will be overwritten.
 
 253     wx.FD_MULTIPLE           For open dialog only: allows selecting multiple
 
 256     wx.FD_CHANGE_DIR         Change the current working directory to the
 
 257                              directory  where the file(s) chosen by the user
 
 259     ======================   ==========================================
 
 264 MustHaveApp(wxFileDialog);
 
 266 class wxFileDialog : public wxDialog {
 
 268     %pythonAppend wxFileDialog   "self._setOORInfo(self)"
 
 271         wxFileDialog(wxWindow* parent,
 
 272                      const wxString& message = wxPyFileSelectorPromptStr,
 
 273                      const wxString& defaultDir = wxPyEmptyString,
 
 274                      const wxString& defaultFile = wxPyEmptyString,
 
 275                      const wxString& wildcard = wxPyFileSelectorDefaultWildcardStr,
 
 276                      long style = wxFD_DEFAULT_STYLE,
 
 277                      const wxPoint& pos = wxDefaultPosition),
 
 278         "Constructor.  Use ShowModal method to show the dialog.", "");
 
 282         void , SetMessage(const wxString& message),
 
 283         "Sets the message that will be displayed on the dialog.", "");
 
 286         void , SetPath(const wxString& path),
 
 287         "Sets the path (the combined directory and filename that will be
 
 288 returned when the dialog is dismissed).", "");
 
 291         void , SetDirectory(const wxString& dir),
 
 292         "Sets the default directory.", "");
 
 295         void , SetFilename(const wxString& name),
 
 296         "Sets the default filename.", "");
 
 299         void , SetWildcard(const wxString& wildCard),
 
 300         "Sets the wildcard, which can contain multiple file types, for
 
 303     \"BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif\"
 
 307         void , SetFilterIndex(int filterIndex),
 
 308         "Sets the default filter index, starting from zero.", "");
 
 311         wxString , GetMessage() const,
 
 312         "Returns the message that will be displayed on the dialog.", "");
 
 315         wxString , GetPath() const,
 
 316         "Returns the full path (directory and filename) of the selected file.", "");
 
 319         wxString , GetDirectory() const,
 
 320         "Returns the default directory.", "");
 
 323         wxString , GetFilename() const,
 
 324         "Returns the default filename.", "");
 
 327         wxString , GetWildcard() const,
 
 328         "Returns the file dialog wildcard.", "");
 
 331         int , GetFilterIndex() const,
 
 332         "Returns the index into the list of filters supplied, optionally, in
 
 333 the wildcard parameter. Before the dialog is shown, this is the index
 
 334 which will be used when the dialog is first displayed. After the
 
 335 dialog is shown, this is the index selected by the user.", "");
 
 340                "Returns a list of filenames chosen in the dialog.  This function
 
 341 should only be used with the dialogs which have wx.MULTIPLE style, use
 
 342 GetFilename for the others.", "");
 
 343         PyObject* GetFilenames() {
 
 345             self->GetFilenames(arr);
 
 346             return wxArrayString2PyList_helper(arr);
 
 350                "Fills the array paths with the full paths of the files chosen. This
 
 351 function should only be used with the dialogs which have wx.MULTIPLE
 
 352 style, use GetPath for the others.", "");
 
 354         PyObject* GetPaths() {
 
 357             return wxArrayString2PyList_helper(arr);
 
 362 //     // Utility functions
 
 364 //     // Parses the wildCard, returning the number of filters.
 
 365 //     // Returns 0 if none or if there's a problem,
 
 366 //     // The arrays will contain an equal number of items found before the error.
 
 367 //     // wildCard is in the form:
 
 368 //     // "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png"
 
 369 //     static int ParseWildcard(const wxString& wildCard,
 
 370 //                              wxArrayString& descriptions,
 
 371 //                              wxArrayString& filters);
 
 373 //     // Append first extension to filePath from a ';' separated extensionList
 
 374 //     // if filePath = "path/foo.bar" just return it as is
 
 375 //     // if filePath = "foo[.]" and extensionList = "*.jpg;*.png" return "foo.jpg"
 
 376 //     // if the extension is "*.j?g" (has wildcards) or "jpg" then return filePath
 
 377 //     static wxString AppendExtension(const wxString &filePath,
 
 378 //                                     const wxString &extensionList);
 
 381     %property(Directory, GetDirectory, SetDirectory, doc="See `GetDirectory` and `SetDirectory`");
 
 382     %property(Filename, GetFilename, SetFilename, doc="See `GetFilename` and `SetFilename`");
 
 383     %property(Filenames, GetFilenames, doc="See `GetFilenames`");
 
 384     %property(FilterIndex, GetFilterIndex, SetFilterIndex, doc="See `GetFilterIndex` and `SetFilterIndex`");
 
 385     %property(Message, GetMessage, SetMessage, doc="See `GetMessage` and `SetMessage`");
 
 386     %property(Path, GetPath, SetPath, doc="See `GetPath` and `SetPath`");
 
 387     %property(Paths, GetPaths, doc="See `GetPaths`");
 
 388     %property(Wildcard, GetWildcard, SetWildcard, doc="See `GetWildcard` and `SetWildcard`");
 
 393 //---------------------------------------------------------------------------
 
 395 enum { wxCHOICEDLG_STYLE };
 
 398 DocStr(wxMultiChoiceDialog,
 
 399        "A simple dialog with a multi selection listbox.", "");
 
 401 MustHaveApp(wxMultiChoiceDialog);
 
 403 class wxMultiChoiceDialog : public wxDialog
 
 406     %pythonAppend wxMultiChoiceDialog   "self._setOORInfo(self)"
 
 409         wxMultiChoiceDialog(wxWindow *parent,
 
 410                             const wxString& message,
 
 411                             const wxString& caption,
 
 412                             int choices=0, wxString* choices_array=NULL,
 
 413                             long style = wxCHOICEDLG_STYLE,
 
 414                             const wxPoint& pos = wxDefaultPosition),
 
 415         "__init__(self, Window parent, String message, String caption,
 
 416     List choices=EmptyList, long style=CHOICEDLG_STYLE,
 
 417     Point pos=DefaultPosition) -> MultiChoiceDialog",
 
 418         "Constructor.  Use the `ShowModal` method to show the dialog.
 
 420     :param parent: The parent window.
 
 421     :param message: Text to display above the list of selections.
 
 422     :param caption: Text to use in the title bar of the dialog.
 
 423     :param choices: A list of strings or unicode objects that the
 
 424         user is allowed to choose from.
 
 425     :param style: Styles to apply to the dialog.  The default value is
 
 426         equivallent to wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.OK|wx.CANCEL|wx.CENTER.
 
 427     :param pos: Where to position the dialog (not used on Windows)
 
 433         void, SetSelections(const wxArrayInt& selections),
 
 434         "SetSelections(List selections)",
 
 435         "Specify the items in the list that should be selected, using a list of
 
 436 integers.  The list should specify the indexes of the items that
 
 437 should be selected.", "");
 
 439     DocAStr(GetSelections,
 
 440             "GetSelections() -> [selections]",
 
 441             "Returns a list of integers representing the items that are selected.
 
 442 If an item is selected then its index will appear in the list.", "");
 
 444         PyObject* GetSelections() {
 
 445             return wxArrayInt2PyList_helper(self->GetSelections());
 
 449     %property(Selections, GetSelections, SetSelections, doc="See `GetSelections` and `SetSelections`");
 
 453 //---------------------------------------------------------------------------
 
 455 DocStr(wxSingleChoiceDialog,
 
 456        "A simple dialog with a single selection listbox.", "");
 
 458 MustHaveApp(wxSingleChoiceDialog);
 
 460 class wxSingleChoiceDialog : public wxDialog {
 
 462     %pythonAppend wxSingleChoiceDialog   "self._setOORInfo(self)"
 
 464     DocAStr(wxSingleChoiceDialog,
 
 465             "__init__(Window parent, String message, String caption,
 
 466     List choices=EmptyList, long style=CHOICEDLG_STYLE,
 
 467     Point pos=DefaultPosition) -> SingleChoiceDialog",
 
 468             "Constructor.  Use ShowModal method to show the dialog.", "");
 
 471         // TODO: ignoring clientData for now...  FIX THIS
 
 472         //       SWIG is messing up the &/*'s for some reason.
 
 473         wxSingleChoiceDialog(wxWindow* parent,
 
 474                              const wxString& message,
 
 475                              const wxString& caption,
 
 476                              int choices, wxString* choices_array,
 
 477                              //char** clientData = NULL,
 
 478                              long style = wxCHOICEDLG_STYLE,
 
 479                              const wxPoint& pos = wxDefaultPosition) {
 
 480             return new wxSingleChoiceDialog(parent, message, caption,
 
 481                                             choices, choices_array, NULL, style, pos);
 
 486         int , GetSelection(),
 
 487         "Get the index of the currently selected item.", "");
 
 490         wxString , GetStringSelection(),
 
 491         "Returns the string value of the currently selected item", "");
 
 494         void , SetSelection(int sel),
 
 495         "Set the current selected item to sel", "");
 
 497     %property(Selection, GetSelection, SetSelection, doc="See `GetSelection` and `SetSelection`");
 
 498     %property(StringSelection, GetStringSelection, doc="See `GetStringSelection`");
 
 502 //---------------------------------------------------------------------------
 
 504 DocStr(wxTextEntryDialog,
 
 505        "A dialog with text control, [ok] and [cancel] buttons", "");
 
 507 MustHaveApp(wxTextEntryDialog);
 
 509 enum { wxTextEntryDialogStyle };
 
 511 class wxTextEntryDialog : public wxDialog {
 
 513     %pythonAppend wxTextEntryDialog   "self._setOORInfo(self)"
 
 516         wxTextEntryDialog(wxWindow* parent,
 
 517                           const wxString& message,
 
 518                           const wxString& caption = wxPyGetTextFromUserPromptStr,
 
 519                           const wxString& defaultValue = wxPyEmptyString,
 
 520                           long style = wxTextEntryDialogStyle,
 
 521                           const wxPoint& pos = wxDefaultPosition),
 
 522         "Constructor.  Use ShowModal method to show the dialog.", "");
 
 525         wxString , GetValue(),
 
 526         "Returns the text that the user has entered if the user has pressed OK,
 
 527 or the original value if the user has pressed Cancel.", "");
 
 530         void , SetValue(const wxString& value),
 
 531         "Sets the default text value.", "");
 
 533     %property(Value, GetValue, SetValue, doc="See `GetValue` and `SetValue`");
 
 536 //---------------------------------------------------------------------------
 
 538 MAKE_CONST_WXSTRING(GetPasswordFromUserPromptStr);
 
 540 class wxPasswordEntryDialog : public wxTextEntryDialog
 
 543     wxPasswordEntryDialog(wxWindow *parent,
 
 544                       const wxString& message,
 
 545                       const wxString& caption = wxPyGetPasswordFromUserPromptStr,
 
 546                       const wxString& value = wxPyEmptyString,
 
 547                       long style = wxTextEntryDialogStyle,
 
 548                       const wxPoint& pos = wxDefaultPosition);
 
 551 //---------------------------------------------------------------------------
 
 553 DocStr( wxNumberEntryDialog,
 
 554 "A dialog with spin control, ok and cancel buttons.", "")
 
 556 MustHaveApp(wxNumberEntryDialog);
 
 558 class wxNumberEntryDialog : public wxDialog
 
 561     %pythonAppend wxNumberEntryDialog   "self._setOORInfo(self)"
 
 564         wxNumberEntryDialog(wxWindow *parent,
 
 565                             const wxString& message,
 
 566                             const wxString& prompt,
 
 567                             const wxString& caption,
 
 568                             long value, long min, long max,
 
 569                             const wxPoint& pos = wxDefaultPosition),
 
 570         "Constructor.  Use ShowModal method to show the dialog.", "");
 
 574     %property(Value, GetValue, doc="See `GetValue`");
 
 578 //---------------------------------------------------------------------------
 
 582        "This class holds a variety of information related to font dialogs and
 
 583 is used to transfer settings to and results from a `wx.FontDialog`.", "");
 
 586 class wxFontData : public wxObject {
 
 592         void , EnableEffects(bool enable),
 
 593         "Enables or disables 'effects' under MS Windows only. This refers to
 
 594 the controls for manipulating colour, strikeout and underline
 
 595 properties.  The default value is true.", "");
 
 598         bool , GetAllowSymbols(),
 
 599         "Under MS Windows, returns a flag determining whether symbol fonts can
 
 600 be selected. Has no effect on other platforms. The default value is
 
 604         wxColour , GetColour(),
 
 605         "Gets the colour associated with the font dialog. The default value is
 
 609         wxFont , GetChosenFont(),
 
 610         "Gets the font chosen by the user.", "");
 
 613         bool , GetEnableEffects(),
 
 614         "Determines whether 'effects' are enabled under Windows.", "");
 
 617         wxFont , GetInitialFont(),
 
 618         "Gets the font that will be initially used by the font dialog. This
 
 619 should have previously been set by the application.", "");
 
 622         bool , GetShowHelp(),
 
 623         "Returns true if the Help button will be shown (Windows only).  The
 
 624 default value is false.", "");
 
 627         void , SetAllowSymbols(bool allowSymbols),
 
 628         "Under MS Windows, determines whether symbol fonts can be selected. Has
 
 629 no effect on other platforms.  The default value is true.", "");
 
 632         void , SetChosenFont(const wxFont& font),
 
 633         "Sets the font that will be returned to the user (normally for internal
 
 637         void , SetColour(const wxColour& colour),
 
 638         "Sets the colour that will be used for the font foreground colour.  The
 
 639 default colour is black.", "");
 
 642         void , SetInitialFont(const wxFont& font),
 
 643         "Sets the font that will be initially used by the font dialog.", "");
 
 646         void , SetRange(int min, int max),
 
 647         "Sets the valid range for the font point size (Windows only).  The
 
 648 default is 0, 0 (unrestricted range).", "");
 
 651         void , SetShowHelp(bool showHelp),
 
 652         "Determines whether the Help button will be displayed in the font
 
 653 dialog (Windows only).  The default value is false.", "");
 
 655     %property(AllowSymbols, GetAllowSymbols, SetAllowSymbols, doc="See `GetAllowSymbols` and `SetAllowSymbols`");
 
 656     %property(ChosenFont, GetChosenFont, SetChosenFont, doc="See `GetChosenFont` and `SetChosenFont`");
 
 657     %property(Colour, GetColour, SetColour, doc="See `GetColour` and `SetColour`");
 
 658 //    %property(EnableEffects, GetEnableEffects, doc="See `GetEnableEffects`");
 
 659     %property(InitialFont, GetInitialFont, SetInitialFont, doc="See `GetInitialFont` and `SetInitialFont`");
 
 660     %property(ShowHelp, GetShowHelp, SetShowHelp, doc="See `GetShowHelp` and `SetShowHelp`");
 
 668        "wx.FontDialog allows the user to select a system font and its attributes.
 
 673 MustHaveApp(wxFontDialog);
 
 675 class wxFontDialog : public wxDialog {
 
 677     %pythonAppend wxFontDialog   "self._setOORInfo(self)"
 
 680            "Constructor. Pass a parent window and the `wx.FontData` object to be
 
 681 used to initialize the dialog controls.  Call `ShowModal` to display
 
 682 the dialog.  If ShowModal returns ``wx.ID_OK`` then you can fetch the
 
 683 results with via the `wx.FontData` returned by `GetFontData`.", "");
 
 684     wxFontDialog(wxWindow* parent, const wxFontData& data);
 
 688         wxFontData& , GetFontData(),
 
 689         "Returns a reference to the internal `wx.FontData` used by the
 
 690 wx.FontDialog.", "");
 
 692     %property(FontData, GetFontData, doc="See `GetFontData`");    
 
 696 wxFont wxGetFontFromUser(wxWindow *parent = NULL,
 
 697                          const wxFont& fontInit = wxNullFont,
 
 698                          const wxString& caption = wxPyEmptyString);
 
 701 //---------------------------------------------------------------------------
 
 704 DocStr(wxMessageDialog,
 
 705 "This class provides a simple dialog that shows a single or multi-line
 
 706 message, with a choice of OK, Yes, No and/or Cancel buttons.", "
 
 710     ===================    =============================================
 
 711     wx.OK                  Show an OK button.
 
 712     wx.CANCEL              Show a Cancel button.
 
 713     wx.YES_NO              Show Yes and No buttons.
 
 714     wx.YES_DEFAULT         Used with wxYES_NO, makes Yes button the
 
 715                            default - which is the default behaviour.
 
 716     wx.NO_DEFAULT          Used with wxYES_NO, makes No button the default.
 
 717     wx.ICON_EXCLAMATION    Shows an exclamation mark icon.
 
 718     wx.ICON_HAND           Shows an error icon.
 
 719     wx.ICON_ERROR          Shows an error icon - the same as wxICON_HAND.
 
 720     wx.ICON_QUESTION       Shows a question mark icon.
 
 721     wx.ICON_INFORMATION    Shows an information (i) icon.
 
 722     wx.STAY_ON_TOP         The message box stays on top of all other
 
 723                            window, even those of the other applications
 
 725     ===================    =============================================
 
 729 MustHaveApp(wxMessageDialog);
 
 731 class wxMessageDialog : public wxDialog {
 
 733     %pythonAppend wxMessageDialog   "self._setOORInfo(self)"
 
 736         wxMessageDialog(wxWindow* parent,
 
 737                         const wxString& message,
 
 738                         const wxString& caption = wxPyMessageBoxCaptionStr,
 
 739                         long style = wxOK | wxCANCEL | wxCENTRE,
 
 740                         const wxPoint& pos = wxDefaultPosition),
 
 741         "Constructor, use `ShowModal` to display the dialog.", "");
 
 745 //---------------------------------------------------------------------------
 
 759 DocStr(wxProgressDialog,
 
 760 "A dialog that shows a short message and a progress bar. Optionally, it
 
 761 can display an ABORT button.", "
 
 765     ====================     =============================================
 
 766     wx.PD_APP_MODAL          Make the progress dialog modal. If this flag is
 
 767                              not given, it is only \"locally\" modal -
 
 768                              that is the input to the parent window is
 
 769                              disabled, but not to the other ones.
 
 771     wx.PD_AUTO_HIDE          Causes the progress dialog to disappear from
 
 772                              screen as soon as the maximum value of the
 
 773                              progress meter has been reached.
 
 775     wx.PD_CAN_ABORT          This flag tells the dialog that it should have
 
 776                              a \"Cancel\" button which the user may press. If
 
 777                              this happens, the next call to Update() will
 
 778                              return False in the first component of its return
 
 781     wx.PD_CAN_SKIP           This flag tells the dialog that it should have a
 
 782                              \"Skip\" button which the user may press. If this
 
 783                              happens, the next call to Update() will return
 
 784                              True in the second component of its return value.
 
 786     wx.PD_ELAPSED_TIME       This flag tells the dialog that it should show
 
 787                              elapsed time (since creating the dialog).
 
 789     wx.PD_ESTIMATED_TIME     This flag tells the dialog that it should show
 
 792     wx.PD_REMAINING_TIME     This flag tells the dialog that it should show
 
 795     wx.PD_SMOOTH             Uses the wx.GA_SMOOTH style on the embedded
 
 797     ====================     =============================================
 
 801 // TODO: wxPD_CAN_SKIP
 
 803 MustHaveApp(wxProgressDialog);
 
 805 class wxProgressDialog : public wxFrame {
 
 807     %pythonAppend wxProgressDialog   "self._setOORInfo(self)"
 
 810         wxProgressDialog(const wxString& title,
 
 811                          const wxString& message,
 
 813                          wxWindow* parent = NULL,
 
 814                          int style = wxPD_AUTO_HIDE | wxPD_APP_MODAL ),
 
 815         "Constructor. Creates the dialog, displays it and disables user input
 
 816 for other windows, or, if wx.PD_APP_MODAL flag is not given, for its
 
 817 parent window only.", "");
 
 819     // TODO: support getting the skipped value back in the return value, but
 
 820     // only if style is set.  This is so the API doesn't change for existing
 
 823         virtual bool , Update(int value,
 
 824                               const wxString& newmsg = wxPyEmptyString,
 
 826         "Update(self, int value, String newmsg) --> (continue, skip)",
 
 827         "Updates the dialog, setting the progress bar to the new value and, if
 
 828 given changes the message above it. The value given should be less
 
 829 than or equal to the maximum value given to the constructor and the
 
 830 dialog is closed if it is equal to the maximum.  Returns a tuple of
 
 831 boolean values, ``(continue, skip)`` where ``continue`` is ``True``
 
 832 unless the Cancel button has been pressed, and ``skip`` is ``False``
 
 833 unless the Skip button (if any) has been pressed.
 
 835 If the ``continue`` return value is ``False``, the application can either
 
 836 immediately destroy the dialog or ask the user for confirmation, and if the
 
 837 abort is not confirmed the dialog may be resumed with `Resume` function.
 
 842         virtual bool , Pulse(const wxString& newmsg = wxPyEmptyString,
 
 844         "Pulse(self, String newmsg) --> (continue, skip)",
 
 845         "Just like `Update` but switches the dialog to use a gauge in
 
 846 interminante mode and calls `wx.Gauge.Pulse` to show the user a bit of
 
 848     %pythoncode { UpdatePulse =  Pulse }
 
 852         "Can be used to continue with the dialog, after the user had chosen to
 
 857 //---------------------------------------------------------------------------
 
 859 enum wxFindReplaceFlags
 
 861     // downward search/replace selected (otherwise - upwards)
 
 864     // whole word search/replace selected
 
 867     // case sensitive search/replace selected (otherwise - case insensitive)
 
 872 enum wxFindReplaceDialogStyles
 
 874     // replace dialog (otherwise find dialog)
 
 875     wxFR_REPLACEDIALOG = 1,
 
 877     // don't allow changing the search direction
 
 880     // don't allow case sensitive searching
 
 881     wxFR_NOMATCHCASE   = 4,
 
 883     // don't allow whole word searching
 
 889 %constant wxEventType wxEVT_COMMAND_FIND;
 
 890 %constant wxEventType wxEVT_COMMAND_FIND_NEXT;
 
 891 %constant wxEventType wxEVT_COMMAND_FIND_REPLACE;
 
 892 %constant wxEventType wxEVT_COMMAND_FIND_REPLACE_ALL;
 
 893 %constant wxEventType wxEVT_COMMAND_FIND_CLOSE;
 
 897 EVT_FIND = wx.PyEventBinder( wxEVT_COMMAND_FIND, 1 )
 
 898 EVT_FIND_NEXT = wx.PyEventBinder( wxEVT_COMMAND_FIND_NEXT, 1 )
 
 899 EVT_FIND_REPLACE = wx.PyEventBinder( wxEVT_COMMAND_FIND_REPLACE, 1 )
 
 900 EVT_FIND_REPLACE_ALL = wx.PyEventBinder( wxEVT_COMMAND_FIND_REPLACE_ALL, 1 )
 
 901 EVT_FIND_CLOSE = wx.PyEventBinder( wxEVT_COMMAND_FIND_CLOSE, 1 )
 
 903 %# For backwards compatibility.  Should they be removed?
 
 904 EVT_COMMAND_FIND             = EVT_FIND
 
 905 EVT_COMMAND_FIND_NEXT        = EVT_FIND_NEXT
 
 906 EVT_COMMAND_FIND_REPLACE     = EVT_FIND_REPLACE
 
 907 EVT_COMMAND_FIND_REPLACE_ALL = EVT_FIND_REPLACE_ALL
 
 908 EVT_COMMAND_FIND_CLOSE       = EVT_FIND_CLOSE
 
 912 DocStr(wxFindDialogEvent,
 
 913        "Events for the FindReplaceDialog", "");
 
 915 class wxFindDialogEvent : public wxCommandEvent
 
 918     wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
 
 922         "Get the currently selected flags: this is the combination of
 
 923 wx.FR_DOWN, wx.FR_WHOLEWORD and wx.FR_MATCHCASE flags.", "");
 
 926         const wxString& , GetFindString(),
 
 927         "Return the string to find (never empty).", "");
 
 930         const wxString& , GetReplaceString(),
 
 931         "Return the string to replace the search string with (only for replace
 
 932 and replace all events).", "");
 
 935         wxFindReplaceDialog *, GetDialog(),
 
 936         "Return the pointer to the dialog which generated this event.", "");
 
 939         void , SetFlags(int flags),
 
 943         void , SetFindString(const wxString& str),
 
 947         void , SetReplaceString(const wxString& str),
 
 950     %property(Dialog, GetDialog, doc="See `GetDialog`");
 
 951     %property(FindString, GetFindString, SetFindString, doc="See `GetFindString` and `SetFindString`");
 
 952     %property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`");
 
 953     %property(ReplaceString, GetReplaceString, SetReplaceString, doc="See `GetReplaceString` and `SetReplaceString`");
 
 958 DocStr(wxFindReplaceData,
 
 959 "wx.FindReplaceData holds the data for wx.FindReplaceDialog. It is used
 
 960 to initialize the dialog with the default values and will keep the
 
 961 last values from the dialog when it is closed. It is also updated each
 
 962 time a `wx.FindDialogEvent` is generated so instead of using the
 
 963 `wx.FindDialogEvent` methods you can also directly query this object.
 
 965 Note that all SetXXX() methods may only be called before showing the
 
 966 dialog and calling them has no effect later.", "
 
 970     ================   ===============================================
 
 971     wx.FR_DOWN         Downward search/replace selected (otherwise,
 
 974     wx.FR_WHOLEWORD    Whole word search/replace selected
 
 976     wx.FR_MATCHCASE    Case sensitive search/replace selected
 
 977                        (otherwise, case insensitive)
 
 978     ================   ===============================================
 
 984 class wxFindReplaceData : public wxObject
 
 988         wxFindReplaceData(int flags=0),
 
 989         "Constuctor initializes the flags to default value (0).", "");
 
 991     ~wxFindReplaceData();
 
 995         const wxString& , GetFindString(),
 
 996         "Get the string to find.", "");
 
 999         const wxString& , GetReplaceString(),
 
1000         "Get the replacement string.", "");
 
1004         "Get the combination of flag values.", "");
 
1007         void , SetFlags(int flags),
 
1008         "Set the flags to use to initialize the controls of the dialog.", "");
 
1011         void , SetFindString(const wxString& str),
 
1012         "Set the string to find (used as initial value by the dialog).", "");
 
1015         void , SetReplaceString(const wxString& str),
 
1016         "Set the replacement string (used as initial value by the dialog).", "");
 
1018     %property(FindString, GetFindString, SetFindString, doc="See `GetFindString` and `SetFindString`");
 
1019     %property(Flags, GetFlags, SetFlags, doc="See `GetFlags` and `SetFlags`");
 
1020     %property(ReplaceString, GetReplaceString, SetReplaceString, doc="See `GetReplaceString` and `SetReplaceString`");
 
1026 DocStr(wxFindReplaceDialog,
 
1027 "wx.FindReplaceDialog is a standard modeless dialog which is used to
 
1028 allow the user to search for some text (and possibly replace it with
 
1029 something else). The actual searching is supposed to be done in the
 
1030 owner window which is the parent of this dialog. Note that it means
 
1031 that unlike for the other standard dialogs this one must have a parent
 
1032 window. Also note that there is no way to use this dialog in a modal
 
1033 way; it is always, by design and implementation, modeless.", "
 
1039     =====================  =========================================
 
1040     wx.FR_REPLACEDIALOG    replace dialog (otherwise find dialog)
 
1042     wx.FR_NOUPDOWN         don't allow changing the search direction
 
1044     wx.FR_NOMATCHCASE      don't allow case sensitive searching
 
1046     wx.FR_NOWHOLEWORD      don't allow whole word searching
 
1047     =====================  =========================================
 
1050 MustHaveApp(wxFindReplaceDialog);
 
1052 class wxFindReplaceDialog : public wxDialog {
 
1054     %pythonAppend wxFindReplaceDialog     "self._setOORInfo(self)"
 
1055     %pythonAppend wxFindReplaceDialog()   ""
 
1058         wxFindReplaceDialog(wxWindow *parent,
 
1059                             wxFindReplaceData *data,
 
1060                             const wxString &title,
 
1062         "Create a FindReplaceDialog.  The parent and data parameters must be
 
1063 non-None.  Use Show to display the dialog.", "");
 
1066         wxFindReplaceDialog(),
 
1067         "Precreate a FindReplaceDialog for 2-phase creation", "",
 
1068         PreFindReplaceDialog);
 
1072         bool , Create(wxWindow *parent, wxFindReplaceData *data,
 
1073                       const wxString &title, int style = 0),
 
1074         "Create the dialog, for 2-phase create.", "");
 
1078         const wxFindReplaceData *, GetData(),
 
1079         "Get the FindReplaceData object used by this dialog.", "");
 
1082         void , SetData(wxFindReplaceData *data),
 
1083         "Set the FindReplaceData object used by this dialog.", "");
 
1085     %property(Data, GetData, SetData, doc="See `GetData` and `SetData`");
 
1088 //---------------------------------------------------------------------------
 
1089 //---------------------------------------------------------------------------