.\" This is a wxWidgets manpage page generated from the XML docs .TH wxFileDialog 3wx 2005-02-15 "wxWidgets" "wxWidgets class documentation" .SH NAME wxFileDialog \- File selector dialog .SH DESCRIPTION This class represents the file chooser dialog. .SH REMARKS Pops up a file selector box. In Windows and GTK2.4+, this is the common file selector dialog. In X, this is a file selector box with somewhat less functionality. The path and filename are distinct elements of a full file pathname. If path is ``", the current directory will be used. If filename is ``", 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 wxOPEN, wxSAVE, wxOVERWRITE_PROMPT, wxHIDE_READONLY, wxFILE_MUST_EXIST, wxMULTIPLE, wxCHANGE_DIR or 0. Both the X 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: "BMP and GIF files (*.bmp;*.gif)|*.bmp;*.gif|PNG files (*.png)|*.png" It must be noted that wildcard support in the native Motif file dialog is quite limited: only one alternative is supported, and it is displayed without the descriptive test; ``BMP files (*.bmp)|*.bmp'' is displayed as ``*.bmp'', and both ``BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif'' and ``Image files|*.bmp;*.gif'' are errors. .SH "PARENTS" wxDialog wxWindow wxEvtHandler wxObject .SH "INCLUDE FILES" wx/filedlg.h .SH MEMBERS .SS wxFileDialog (wxWindow* parentconst wxString& message = "Chooseconst wxString& defaultDir = ""const wxString& defaultFile = ``"const wxString& wildcard = ``*.*"long style = 0const wxPoint& pos = wxDefaultPosition) Constructor. Use wxFileDialog::ShowModal to show the dialog. NB: Previous versions of wxWidgets used wxCHANGE_DIR by default under MS Windows which allowed the program to simply remember the last directory where user selected the files to open/save. This (desired) functionality must be implemented in the program itself now (manually remember the last path used and pass it to the dialog the next time it is called) or by using this flag. .SS ~wxFileDialog () Destructor. .SS wxString GetDirectory () Returns the default directory. .SS wxString GetFilename () Returns the default filename. .SS void GetFilenames (wxArrayString& filenames) Fills the array filenames with the names of the files chosen. This function should only be used with the dialogs which have wxMULTIPLE style, use GetFilename for the others. Note that under Windows, if the user selects shortcuts, the filenames include paths, since the application cannot determine the full path of each referenced file by appending the directory containing the shortcuts to the filename. .SS int GetFilterIndex () Returns the index into the list of filters supplied, optionally, in the wildcard parameter. Before the dialog is shown, this is the index which will be used when the dialog is first displayed. After the dialog is shown, this is the index selected by the user. .SS wxString GetMessage () Returns the message that will be displayed on the dialog. .SS wxString GetPath () Returns the full path (directory and filename) of the selected file. .SS void GetPaths (wxArrayString& paths) Fills the array paths with the full paths of the files chosen. This function should only be used with the dialogs which have wxMULTIPLE style, use GetPath for the others. .SS long GetStyle () Returns the dialog style. .SS wxString GetWildcard () Returns the file dialog wildcard. .SS void SetDirectory (const wxString& directory) Sets the default directory. .SS void SetFilename (const wxString& setfilename) Sets the default filename. .SS void SetFilterIndex (int filterIndex) Sets the default filter index, starting from zero. .SS void SetMessage (const wxString& message) Sets the message that will be displayed on the dialog. .SS void SetPath (const wxString& path) Sets the path (the combined directory and filename that will be returned when the dialog is dismissed). .SS void SetStyle (long style) Sets the dialog style. See wxFileDialog::wxFileDialog for details. .SS void SetWildcard (const wxString& wildCard) Sets the wildcard, which can contain multiple file types, for example: ``BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif" Note that the native Motif dialog has some limitations with respect to wildcards; see the Remarks section above. .SS int ShowModal () Shows the dialog, returning wxID_OK if the user pressed OK, and wxID_CANCEL otherwise. .SH "SEE ALSO" wxDialog wxWindow wxEvtHandler wxObject wxFileDialog overview wxFileSelector .SH "AUTHORS" Documentation content by Julian Smart, Robert Roebling, Vadim Zeitlin, Robin Dunn, et al Conversion to manpage format by Arnout Engelen (http://bzzt.net), bugreports welcome.