X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/12f5e1e78fe906050ff2fee9529476db332633f0..1b7751aaa9a86d76a850b9267bc0c201e3cea30f:/interface/wx/dirdlg.h diff --git a/interface/wx/dirdlg.h b/interface/wx/dirdlg.h index b9ceeb9571..953b45be41 100644 --- a/interface/wx/dirdlg.h +++ b/interface/wx/dirdlg.h @@ -3,9 +3,30 @@ // Purpose: interface of wxDirDialog // Author: wxWidgets team // RCS-ID: $Id$ -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +#define wxDD_CHANGE_DIR 0x0100 +#define wxDD_DIR_MUST_EXIST 0x0200 +#define wxDD_NEW_DIR_BUTTON 0 // deprecated, on by default now, + +#define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) + +/** + Initial folder for generic directory dialog. +*/ +const char wxDirDialogDefaultFolderStr[] = "/"; + +/** + Default message for directory selector dialog. +*/ +const char wxDirSelectorPromptStr[] = "Select a directory"; + +/** + Default name for directory selector dialog. +*/ +const char wxDirDialogNameStr[] = "wxDirCtrl"; + /** @class wxDirDialog @@ -25,8 +46,20 @@ user. @endStyleTable - @note On Windows the new directory button is only available with recent - versions of the common dialogs. + Notice that @c wxRESIZE_BORDER has special side effect under recent (i.e. + later than Win9x) Windows where two different directory selection dialogs + are available and this style also implicitly selects the new version as the + old one always has fixed size. As the new version is almost always + preferable, it is recommended that @c wxRESIZE_BORDER style be always used. + This is the case if the dialog is created with the default style value but + if you need to use any additional styles you should still specify @c + wxDD_DEFAULT_STYLE unless you explicitly need to use the old dialog version + under Windows. E.g. do + @code + wxDirDialog dlg(NULL, "Choose input directory", "", + wxDD_DEFAULT_STYLE | wxDD_DIR_MUST_EXIST); + @endcode + instead of just using @c wxDD_DIR_MUST_EXIST style alone. @library{wxcore} @category{cmndlg} @@ -55,37 +88,37 @@ public: The dialog name, not used. */ wxDirDialog(wxWindow* parent, - const wxString& message = "Choose a directory", - const wxString& defaultPath = "", + const wxString& message = wxDirSelectorPromptStr, + const wxString& defaultPath = wxEmptyString, long style = wxDD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - const wxString& name = "wxDirCtrl"); + const wxString& name = wxDirDialogNameStr); /** Destructor. */ - ~wxDirDialog(); + virtual ~wxDirDialog(); /** Returns the message that will be displayed on the dialog. */ - wxString GetMessage() const; + virtual wxString GetMessage() const; /** Returns the default or user-selected path. */ - wxString GetPath() const; + virtual wxString GetPath() const; /** Sets the message that will be displayed on the dialog. */ - void SetMessage(const wxString& message); + virtual void SetMessage(const wxString& message); /** Sets the default path. */ - void SetPath(const wxString& path); + virtual void SetPath(const wxString& path); /** Shows the dialog, returning wxID_OK if the user pressed OK, and @@ -100,7 +133,7 @@ public: // Global functions/macros // ============================================================================ -/** @ingroup group_funcmacro_dialog */ +/** @addtogroup group_funcmacro_dialog */ //@{ /** @@ -122,7 +155,7 @@ public: @header{wx/dirdlg.h} */ wxString wxDirSelector(const wxString& message = wxDirSelectorPromptStr, - const wxString& default_path = "", + const wxString& default_path = wxEmptyString, long style = 0, const wxPoint& pos = wxDefaultPosition, wxWindow* parent = NULL);