#include </home/zeitlin/src/wx/github/interface/wx/filectrl.h>
Inheritance diagram for wxFileCtrl:This control allows the user to select a file.
Two implementations of this class exist, one for Gtk and another generic one for all the other ports.
This class is only available if wxUSE_FILECTRL is set to 1.
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 | |
| wxFileCtrl () | |
| wxFileCtrl (wxWindow *parent, wxWindowID id, const wxString &defaultDirectory=wxEmptyString, const wxString &defaultFilename=wxEmptyString, const wxString &wildCard=wxFileSelectorDefaultWildcardStr, long style=wxFC_DEFAULT_STYLE, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, const wxString &name=wxFileCtrlNameStr) | |
| Constructs the window. | |
| bool | Create (wxWindow *parent, wxWindowID id, const wxString &defaultDirectory=wxEmptyString, const wxString &defaultFilename=wxEmptyString, const wxString &wildCard=wxFileSelectorDefaultWildcardStr, long style=wxFC_DEFAULT_STYLE, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, const wxString &name=wxFileCtrlNameStr) |
| Create function for two-step construction. | |
| virtual wxString | GetDirectory () const |
| Returns the current directory of the file control (i.e. | |
| virtual wxString | GetFilename () const |
| Returns the currently selected filename. | |
| virtual void | GetFilenames (wxArrayString &filenames) const |
| Fills the array filenames with the filenames only of selected items. | |
| virtual int | GetFilterIndex () const |
| Returns the zero-based index of the currently selected filter. | |
| virtual wxString | GetPath () const |
| Returns the full path (directory and filename) of the currently selected file. | |
| virtual void | GetPaths (wxArrayString &paths) const |
| Fills the array paths with the full paths of the files chosen. | |
| virtual wxString | GetWildcard () const |
| Returns the current wildcard. | |
| virtual bool | SetDirectory (const wxString &directory) |
| Sets(changes) the current directory displayed in the control. | |
| virtual bool | SetFilename (const wxString &filename) |
| Selects a certain file. | |
| virtual bool | SetPath (const wxString &path) |
| Changes to a certain directory and selects a certain file. | |
| virtual void | SetFilterIndex (int filterIndex) |
| Sets the current filter index, starting from zero. | |
| virtual void | SetWildcard (const wxString &wildCard) |
| Sets the wildcard, which can contain multiple file types, for example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif". | |
| virtual void | ShowHidden (bool show) |
| Sets whether hidden files and folders are shown or not. | |
| wxFileCtrl::wxFileCtrl | ( | ) |
| wxFileCtrl::wxFileCtrl | ( | wxWindow * | parent, |
| wxWindowID | id, | ||
| const wxString & | defaultDirectory = wxEmptyString, |
||
| const wxString & | defaultFilename = wxEmptyString, |
||
| const wxString & | wildCard = wxFileSelectorDefaultWildcardStr, |
||
| long | style = wxFC_DEFAULT_STYLE, |
||
| const wxPoint & | pos = wxDefaultPosition, |
||
| const wxSize & | size = wxDefaultSize, |
||
| const wxString & | name = wxFileCtrlNameStr |
||
| ) |
Constructs the window.
| parent | Parent window, must not be non-NULL. |
| id | The identifier for the control. |
| defaultDirectory | The initial directory shown in the control. Must be a valid path to a directory or the empty string. In case it is the empty string, the current working directory is used. |
| defaultFilename | The default filename, or the empty string. |
| wildCard | A wildcard specifying which files can be selected, such as "*.*" or "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif". |
| style | The window style, see wxFC_* flags. |
| pos | Initial position. |
| size | Initial size. |
| name | Control name. |
| bool wxFileCtrl::Create | ( | wxWindow * | parent, |
| wxWindowID | id, | ||
| const wxString & | defaultDirectory = wxEmptyString, |
||
| const wxString & | defaultFilename = wxEmptyString, |
||
| const wxString & | wildCard = wxFileSelectorDefaultWildcardStr, |
||
| long | style = wxFC_DEFAULT_STYLE, |
||
| const wxPoint & | pos = wxDefaultPosition, |
||
| const wxSize & | size = wxDefaultSize, |
||
| const wxString & | name = wxFileCtrlNameStr |
||
| ) |
Create function for two-step construction.
See wxFileCtrl() for details.
| virtual wxString wxFileCtrl::GetDirectory | ( | ) | const [virtual] |
Returns the current directory of the file control (i.e.
the directory shown by it).
| virtual wxString wxFileCtrl::GetFilename | ( | ) | const [virtual] |
Returns the currently selected filename.
For the controls having the wxFC_MULTIPLE style, use GetFilenames() instead.
| virtual void wxFileCtrl::GetFilenames | ( | wxArrayString & | filenames | ) | const [virtual] |
Fills the array filenames with the filenames only of selected items.
This function should only be used with the controls having the wxFC_MULTIPLE style, use GetFilename() for the others.
| virtual int wxFileCtrl::GetFilterIndex | ( | ) | const [virtual] |
Returns the zero-based index of the currently selected filter.
| virtual wxString wxFileCtrl::GetPath | ( | ) | const [virtual] |
Returns the full path (directory and filename) of the currently selected file.
For the controls having the wxFC_MULTIPLE style, use GetPaths() instead.
| virtual void wxFileCtrl::GetPaths | ( | wxArrayString & | paths | ) | const [virtual] |
Fills the array paths with the full paths of the files chosen.
This function should be used with the controls having the wxFC_MULTIPLE style, use GetPath() otherwise.
| virtual wxString wxFileCtrl::GetWildcard | ( | ) | const [virtual] |
Returns the current wildcard.
| virtual bool wxFileCtrl::SetDirectory | ( | const wxString & | directory | ) | [virtual] |
Sets(changes) the current directory displayed in the control.
| virtual bool wxFileCtrl::SetFilename | ( | const wxString & | filename | ) | [virtual] |
Selects a certain file.
| virtual void wxFileCtrl::SetFilterIndex | ( | int | filterIndex | ) | [virtual] |
Sets the current filter index, starting from zero.
| virtual bool wxFileCtrl::SetPath | ( | const wxString & | path | ) | [virtual] |
Changes to a certain directory and selects a certain file.
In case the filename specified isn't found/couldn't be shown with currently selected filter, false is returned.
| virtual void wxFileCtrl::SetWildcard | ( | const wxString & | wildCard | ) | [virtual] |
Sets the wildcard, which can contain multiple file types, for example: "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".
| virtual void wxFileCtrl::ShowHidden | ( | bool | show | ) | [virtual] |
Sets whether hidden files and folders are shown or not.