Classes | |
class | wxFileDialog |
This class represents the file chooser dialog. More... | |
Macros | |
#define | wxFD_DEFAULT_STYLE wxFD_OPEN |
Enumerations | |
enum | { wxFD_OPEN = 0x0001 , wxFD_SAVE = 0x0002 , wxFD_OVERWRITE_PROMPT = 0x0004 , wxFD_FILE_MUST_EXIST = 0x0010 , wxFD_MULTIPLE = 0x0020 , wxFD_CHANGE_DIR = 0x0080 , wxFD_PREVIEW = 0x0100 } |
Functions | |
wxString | wxFileSelector (const wxString &message, const wxString &default_path=wxEmptyString, const wxString &default_filename=wxEmptyString, const wxString &default_extension=wxEmptyString, const wxString &wildcard=wxFileSelectorDefaultWildcardStr, int flags=0, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord) |
Pops up a file selector box. | |
wxString | wxFileSelectorEx (const wxString &message=wxFileSelectorPromptStr, const wxString &default_path=wxEmptyString, const wxString &default_filename=wxEmptyString, int *indexDefaultExtension=NULL, const wxString &wildcard=wxFileSelectorDefaultWildcardStr, int flags=0, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord) |
An extended version of wxFileSelector. | |
wxString | wxLoadFileSelector (const wxString &what, const wxString &extension, const wxString &default_name=wxEmptyString, wxWindow *parent=NULL) |
Ask for filename to load. | |
wxString | wxSaveFileSelector (const wxString &what, const wxString &extension, const wxString &default_name=wxEmptyString, wxWindow *parent=NULL) |
Ask for filename to save. | |
Variables | |
const char | wxFileSelectorDefaultWildcardStr [] |
Default wildcard string used in wxFileDialog corresponding to all files. | |
#define wxFD_DEFAULT_STYLE wxFD_OPEN |
anonymous enum |
wxString wxFileSelector | ( | const wxString & | message, |
const wxString & | default_path = wxEmptyString , |
||
const wxString & | default_filename = wxEmptyString , |
||
const wxString & | default_extension = wxEmptyString , |
||
const wxString & | wildcard = wxFileSelectorDefaultWildcardStr , |
||
int | flags = 0 , |
||
wxWindow * | parent = NULL , |
||
int | x = wxDefaultCoord , |
||
int | y = wxDefaultCoord |
||
) |
Pops up a file selector box.
In Windows, this is the common file selector dialog. In X, this is a file selector box with the same functionality. The path and filename are distinct elements of a full file pathname. If path is empty, the current directory will be used. If filename is empty, no default filename will be supplied. The wildcard determines what files are displayed in the file selector, and file extension supplies a type extension for the required filename. Flags may be a combination of wxFD_OPEN, wxFD_SAVE, wxFD_OVERWRITE_PROMPT or wxFD_FILE_MUST_EXIST.
Both the Unix and Windows versions implement a wildcard filter. Typing a filename containing wildcards (*, ?) in the filename text item, and clicking on Ok, will result in only those files matching the pattern being displayed.
The wildcard may be a specification for multiple types of file with a description for each, such as:
The application must check for an empty return value (the user pressed Cancel). For example:
Include file:
#include <wx/filedlg.h>
wxString wxFileSelectorEx | ( | const wxString & | message = wxFileSelectorPromptStr , |
const wxString & | default_path = wxEmptyString , |
||
const wxString & | default_filename = wxEmptyString , |
||
int * | indexDefaultExtension = NULL , |
||
const wxString & | wildcard = wxFileSelectorDefaultWildcardStr , |
||
int | flags = 0 , |
||
wxWindow * | parent = NULL , |
||
int | x = wxDefaultCoord , |
||
int | y = wxDefaultCoord |
||
) |
An extended version of wxFileSelector.
wxString wxLoadFileSelector | ( | const wxString & | what, |
const wxString & | extension, | ||
const wxString & | default_name = wxEmptyString , |
||
wxWindow * | parent = NULL |
||
) |
Ask for filename to load.
wxString wxSaveFileSelector | ( | const wxString & | what, |
const wxString & | extension, | ||
const wxString & | default_name = wxEmptyString , |
||
wxWindow * | parent = NULL |
||
) |
Ask for filename to save.
const char wxFileSelectorDefaultWildcardStr[] |
Default wildcard string used in wxFileDialog corresponding to all files.
It is defined as "*.*" under MSW and OS/2 and "*" everywhere else.