]>
git.saurik.com Git - wxWidgets.git/blob - interface/wx/dirdlg.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxDirDialog
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
12 This class represents the directory chooser dialog.
15 @style{wxDD_DEFAULT_STYLE}
16 Equivalent to a combination of wxDEFAULT_DIALOG_STYLE and
17 wxRESIZE_BORDER (the last one is not used under wxWinCE).
18 @style{wxDD_DIR_MUST_EXIST}
19 The dialog will allow the user to choose only an existing folder.
20 When this style is not given, a "Create new directory" button is
21 added to the dialog (on Windows) or some other way is provided to
22 the user to type the name of a new folder.
23 @style{wxDD_CHANGE_DIR}
24 Change the current working directory to the directory chosen by the
28 @note On Windows the new directory button is only available with recent
29 versions of the common dialogs.
34 @see @ref overview_cmndlg_dir, wxFileDialog
36 class wxDirDialog
: public wxDialog
40 Constructor. Use ShowModal() to show the dialog.
45 Message to show on the dialog.
47 The default path, or the empty string.
49 The dialog style. See wxDirDialog
51 Dialog position. Ignored under Windows.
53 Dialog size. Ignored under Windows.
55 The dialog name, not used.
57 wxDirDialog(wxWindow
* parent
,
58 const wxString
& message
= "Choose a directory",
59 const wxString
& defaultPath
= "",
60 long style
= wxDD_DEFAULT_STYLE
,
61 const wxPoint
& pos
= wxDefaultPosition
,
62 const wxSize
& size
= wxDefaultSize
,
63 const wxString
& name
= "wxDirCtrl");
71 Returns the message that will be displayed on the dialog.
73 wxString
GetMessage() const;
76 Returns the default or user-selected path.
78 wxString
GetPath() const;
81 Sets the message that will be displayed on the dialog.
83 void SetMessage(const wxString
& message
);
86 Sets the default path.
88 void SetPath(const wxString
& path
);
91 Shows the dialog, returning wxID_OK if the user pressed OK, and
92 wxID_CANCEL otherwise.
99 // ============================================================================
100 // Global functions/macros
101 // ============================================================================
103 /** @ingroup group_funcmacro_dialog */
107 Pops up a directory selector dialog. The arguments have the same meaning
108 as those of wxDirDialog::wxDirDialog(). The message is displayed at the
109 top, and the default_path, if specified, is set as the initial selection.
111 The application must check for an empty return value (if the user pressed
112 Cancel). For example:
115 const wxString& dir = wxDirSelector("Choose a folder");
124 wxString
wxDirSelector(const wxString
& message
= wxDirSelectorPromptStr
,
125 const wxString
& default_path
= "",
127 const wxPoint
& pos
= wxDefaultPosition
,
128 wxWindow
* parent
= NULL
);