]>
git.saurik.com Git - wxWidgets.git/blob - interface/dirdlg.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxDirDialog
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 This class represents the directory chooser dialog.
16 @style{wxDD_DEFAULT_STYLE}
17 Equivalent to a combination of wxDEFAULT_DIALOG_STYLE and
18 wxRESIZE_BORDER (the last one is not used under wxWinCE).
19 @style{wxDD_DIR_MUST_EXIST}
20 The dialog will allow the user to choose only an existing folder.
21 When this style is not given, a "Create new directory" button is
22 added to the dialog (on Windows) or some other way is provided to
23 the user to type the name of a new folder.
24 @style{wxDD_CHANGE_DIR}
25 Change the current working directory to the directory chosen by the
29 @note On Windows the new directory button is only available with recent
30 versions of the common dialogs.
35 @see @ref overview_cmndlg_dir, wxFileDialog
37 class wxDirDialog
: public wxDialog
41 Constructor. Use ShowModal() to show the dialog.
46 Message to show on the dialog.
48 The default path, or the empty string.
50 The dialog style. See wxDirDialog
52 Dialog position. Ignored under Windows.
54 Dialog size. Ignored under Windows.
56 The dialog name, not used.
58 wxDirDialog(wxWindow
* parent
,
59 const wxString
& message
= "Choose a directory",
60 const wxString
& defaultPath
= "",
61 long style
= wxDD_DEFAULT_STYLE
,
62 const wxPoint
& pos
= wxDefaultPosition
,
63 const wxSize
& size
= wxDefaultSize
,
64 const wxString
& name
= "wxDirCtrl");
72 Returns the message that will be displayed on the dialog.
74 wxString
GetMessage() const;
77 Returns the default or user-selected path.
79 wxString
GetPath() const;
82 Sets the message that will be displayed on the dialog.
84 void SetMessage(const wxString
& message
);
87 Sets the default path.
89 void SetPath(const wxString
& path
);
92 Shows the dialog, returning wxID_OK if the user pressed OK, and
93 wxID_CANCEL otherwise.
100 // ============================================================================
101 // Global functions/macros
102 // ============================================================================
104 /** @ingroup group_funcmacro_dialog */
108 Pops up a directory selector dialog. The arguments have the same meaning
109 as those of wxDirDialog::wxDirDialog(). The message is displayed at the
110 top, and the default_path, if specified, is set as the initial selection.
112 The application must check for an empty return value (if the user pressed
113 Cancel). For example:
116 const wxString& dir = wxDirSelector("Choose a folder");
125 wxString
wxDirSelector(const wxString
& message
= wxDirSelectorPromptStr
,
126 const wxString
& default_path
= "",
128 const wxPoint
& pos
= wxDefaultPosition
,
129 wxWindow
* parent
= NULL
);