#include <wx/filepicker.h>
This control allows the user to select a directory.
The generic implementation is a button which brings up a wxDirDialog when clicked. Native implementation may differ but this is usually a (small) widget which give access to the dir-chooser dialog. It is only available if wxUSE_DIRPICKERCTRL
is set to 1 (the default).
This class supports the following styles:
The following event handler macros redirect the events to member function handlers 'func' with prototypes like:
Event macros for events emitted by this class:
![]() | ![]() | ![]() |
wxMSW appearance | wxGTK appearance | wxMac appearance |
Public Member Functions | |
wxDirPickerCtrl (wxWindow *parent, wxWindowID id, const wxString &path=wxEmptyString, const wxString &message=wxDirSelectorPromptStr, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDIRP_DEFAULT_STYLE, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxDirPickerCtrlNameStr) | |
Initializes the object and calls Create() with all the parameters. | |
bool | Create (wxWindow *parent, wxWindowID id, const wxString &path=wxEmptyString, const wxString &message=wxDirSelectorPromptStr, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDIRP_DEFAULT_STYLE, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxDirPickerCtrlNameStr) |
Creates the widgets with the given parameters. | |
wxFileName | GetDirName () const |
Returns the absolute path of the currently selected directory as a wxFileName object. | |
wxString | GetPath () const |
Returns the absolute path of the currently selected directory. | |
void | SetDirName (const wxFileName &dirname) |
Just like SetPath() but this function takes a wxFileName object. | |
void | SetPath (const wxString &dirname) |
Sets the absolute path of (the default converter uses current locale's charset)the currently selected directory. |
wxDirPickerCtrl::wxDirPickerCtrl | ( | wxWindow * | parent, | |
wxWindowID | id, | |||
const wxString & | path = wxEmptyString , |
|||
const wxString & | message = wxDirSelectorPromptStr , |
|||
const wxPoint & | pos = wxDefaultPosition , |
|||
const wxSize & | size = wxDefaultSize , |
|||
long | style = wxDIRP_DEFAULT_STYLE , |
|||
const wxValidator & | validator = wxDefaultValidator , |
|||
const wxString & | name = wxDirPickerCtrlNameStr | |||
) |
Initializes the object and calls Create() with all the parameters.
bool wxDirPickerCtrl::Create | ( | wxWindow * | parent, | |
wxWindowID | id, | |||
const wxString & | path = wxEmptyString , |
|||
const wxString & | message = wxDirSelectorPromptStr , |
|||
const wxPoint & | pos = wxDefaultPosition , |
|||
const wxSize & | size = wxDefaultSize , |
|||
long | style = wxDIRP_DEFAULT_STYLE , |
|||
const wxValidator & | validator = wxDefaultValidator , |
|||
const wxString & | name = wxDirPickerCtrlNameStr | |||
) |
Creates the widgets with the given parameters.
parent | Parent window, must not be non-NULL. | |
id | The identifier for the control. | |
path | The initial directory shown in the control. Must be a valid path to a directory or the empty string. | |
message | The message shown to the user in the wxDirDialog shown by the control. | |
pos | Initial position. | |
size | Initial size. | |
style | The window style, see wxDIRP_* flags. | |
validator | Validator which can be used for additional date checks. | |
name | Control name. |
wxFileName wxDirPickerCtrl::GetDirName | ( | ) | const |
Returns the absolute path of the currently selected directory as a wxFileName object.
This function is equivalent to GetPath().
wxString wxDirPickerCtrl::GetPath | ( | ) | const |
Returns the absolute path of the currently selected directory.
void wxDirPickerCtrl::SetDirName | ( | const wxFileName & | dirname | ) |
Just like SetPath() but this function takes a wxFileName object.
void wxDirPickerCtrl::SetPath | ( | const wxString & | dirname | ) |
Sets the absolute path of (the default converter uses current locale's charset)the currently selected directory.
This must be a valid directory if wxDIRP_DIR_MUST_EXIST
style was given.
![]() |
[ top ] |