Contents Up Previous Next

wxDirDialog

This class represents the directory chooser dialog.

Derived from

wxDialog
wxWindow
wxEvtHandler
wxObject

Include files

<wx/dirdlg.h>

Window styles

wxDD_DEFAULT_STYLE Equivalent to a combination of wxDEFAULT_DIALOG_STYLE and wxRESIZE_BORDER (the last one is not used under wxWinCE).
wxDD_DIR_MUST_EXIST The dialog will allow the user to choose only an existing folder. When this style is not given, a "Create new directory" button is added to the dialog (on Windows) or some other way is provided to the user to type the name of a new folder.
wxDD_CHANGE_DIR Change the current working directory to the directory chosen by the user.

NB: on Windows the new directory button is only available with recent versions of the common dialogs.

See also Generic window styles.

See also

wxDirDialog overview, wxFileDialog

Members

wxDirDialog::wxDirDialog
wxDirDialog::~wxDirDialog
wxDirDialog::GetPath
wxDirDialog::GetMessage
wxDirDialog::SetMessage
wxDirDialog::SetPath
wxDirDialog::ShowModal


wxDirDialog::wxDirDialog

wxDirDialog(wxWindow* parent, const wxString& message = "Choose a directory", const wxString& defaultPath = "", long style = wxDD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxString& name = "wxDirCtrl")

Constructor. Use wxDirDialog::ShowModal to show the dialog.

Parameters

parent

message

defaultPath

style

pos

size

name


wxDirDialog::~wxDirDialog

~wxDirDialog()

Destructor.


wxDirDialog::GetPath

wxString GetPath() const

Returns the default or user-selected path.


wxDirDialog::GetMessage

wxString GetMessage() const

Returns the message that will be displayed on the dialog.


wxDirDialog::SetMessage

void SetMessage(const wxString& message)

Sets the message that will be displayed on the dialog.


wxDirDialog::SetPath

void SetPath(const wxString& path)

Sets the default path.


wxDirDialog::ShowModal

int ShowModal()

Shows the dialog, returning wxID_OK if the user pressed OK, and wxID_CANCEL otherwise.