\section{\class{wxFileDialog}}\label{wxfiledialog} This class represents the file chooser dialog. \wxheading{Derived from} \helpref{wxDialog}{wxdialog}\\ \helpref{wxWindow}{wxwindow}\\ \helpref{wxEvtHandler}{wxevthandler}\\ \helpref{wxObject}{wxobject} \wxheading{Include files} \wxheading{See also} \helpref{wxFileDialog overview}{wxfiledialogoverview}, \helpref{wxFileSelector}{wxfileselector} %\rtfsp\helpref{wxFileSelectorEx}{wxfileselectorex} %\helpref{wxLoadFileSelector}{wxloadfileselector},\rtfsp %\helpref{wxSaveFileSelector}{wxsavefileselector} \wxheading{Remarks} Pops up a file selector box. In Windows, 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, or 0. They are only significant at present in Windows. 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. In the X version, supplying no default name will result in the wildcard filter being inserted in the filename text item; the filter is ignored if a default name is supplied. Under Windows (only), the wildcard may be a specification for multiple types of file with a description for each, such as: \begin{verbatim} "BMP files (*.bmp) | *.bmp | GIF files (*.gif) | *.gif" \end{verbatim} \latexignore{\rtfignore{\wxheading{Members}}} \membersection{wxFileDialog::wxFileDialog}\label{wxfiledialogconstr} \func{}{wxFileDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{message = "Choose a file"},\rtfsp \param{const wxString\& }{defaultDir = ""}, \param{const wxString\& }{defaultFile = ``"},\rtfsp \param{const wxString\& }{wildcard = ``*.*"}, \param{long }{style = 0}, \param{const wxPoint\& }{pos = wxDefaultPosition}} Constructor. Use \helpref{wxFileDialog::ShowModal}{wxfiledialogshowmodal} to show the dialog. \wxheading{Parameters} \docparam{parent}{Parent window.} \docparam{message}{Message to show on the dialog.} \docparam{defaultDir}{The default directory, or the empty string.} \docparam{defaultFile}{The default filename, or the empty string.} \docparam{wildcard}{A wildcard, such as ``*.*".} \docparam{style}{A dialog style. A bitlist of: \twocolwidtha{5cm} \begin{twocollist} \twocolitem{{\bf wxOPEN}}{This is an open dialog (Windows only).} \twocolitem{{\bf wxSAVE}}{This is a save dialog (Windows only).} \twocolitem{{\bf wxHIDE\_READONLY}}{Hide read-only files (Windows only).} \twocolitem{{\bf wxOVERWRITE\_PROMPT}}{Prompt for a conformation if a file will be overridden (Windows only).} \end{twocollist}% } \docparam{pos}{Dialog position. Not implemented.} \membersection{wxFileDialog::\destruct{wxFileDialog}} \func{}{\destruct{wxFileDialog}}{\void} Destructor. \membersection{wxFileDialog::GetDirectory}\label{wxfiledialoggetdirectory} \constfunc{wxString}{GetDirectory}{\void} Returns the default directory. \membersection{wxFileDialog::GetFilename}\label{wxfiledialoggetfilename} \constfunc{wxString}{GetFilename}{\void} Returns the default filename. \membersection{wxFileDialog::GetFilterIndex}\label{wxfiledialoggetfilterindex} \constfunc{int}{GetFilterIndex}{\void} 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. \membersection{wxFileDialog::GetMessage}\label{wxfiledialoggetmessage} \constfunc{wxString}{GetMessage}{\void} Returns the message that will be displayed on the dialog. \membersection{wxFileDialog::GetPath}\label{wxfiledialoggetpath} \constfunc{wxString}{GetPath}{\void} Returns the full path (directory and filename) of the selected file. \membersection{wxFileDialog::GetStyle}\label{wxfiledialoggetstyle} \constfunc{long}{GetStyle}{\void} Returns the dialog style. \membersection{wxFileDialog::GetWildcard}\label{wxfiledialoggetwildcard} \constfunc{wxString}{GetWildcard}{\void} Returns the file dialog wildcard. \membersection{wxFileDialog::SetDirectory}\label{wxfiledialogsetdirectory} \func{void}{SetDirectory}{\param{const wxString\& }{directory}} Sets the default directory. \membersection{wxFileDialog::SetFilename}\label{wxfiledialogsetfilename} \func{void}{SetFilename}{\param{const wxString\& }{setfilename}} Sets the default filename. \membersection{wxFileDialog::SetFilterIndex}\label{wxfiledialogsetfilterindex} \func{void}{SetFilterIndex}{\param{int }{filterIndex}} Sets the default filter index, starting from zero. Windows only. \membersection{wxFileDialog::SetMessage}\label{wxfiledialogsetmessage} \func{void}{SetMessage}{\param{const wxString\& }{message}} Sets the message that will be displayed on the dialog. \membersection{wxFileDialog::SetPath}\label{wxfiledialogsetpath} \func{void}{SetPath}{\param{const wxString\& }{path}} Sets the path (the combined directory and filename that will be returned when the dialog is dismissed). \membersection{wxFileDialog::SetStyle}\label{wxfiledialogsetstyle} \func{void}{SetStyle}{\param{long }{style}} Sets the dialog style. See \helpref{wxFileDialog::wxFileDialog}{wxfiledialogconstr} for details. \membersection{wxFileDialog::SetWildcard}\label{wxfiledialogsetwildcard} \func{void}{SetWildcard}{\param{const wxString\& }{wildCard}} Sets the wildcard, which in Windows can contain multiple file types. \membersection{wxFileDialog::ShowModal}\label{wxfiledialogshowmodal} \func{int}{ShowModal}{\void} Shows the dialog, returning wxID\_OK if the user pressed OK, and wxOK\_CANCEL otherwise.