1 \section{\class{wxFileDialog
}}\label{wxfiledialog
}
3 This class represents the file chooser dialog.
5 \wxheading{Derived from
}
7 \helpref{wxDialog
}{wxdialog
}\\
8 \helpref{wxWindow
}{wxwindow
}\\
9 \helpref{wxEvtHandler
}{wxevthandler
}\\
10 \helpref{wxObject
}{wxobject
}
12 \wxheading{Include files
}
18 \helpref{wxFileDialog overview
}{wxfiledialogoverview
},
\helpref{wxFileSelector
}{wxfileselector
}
22 Pops up a file selector box. In Windows, this is the common file selector
23 dialog. In X, this is a file selector box with somewhat less functionality.
24 The path and filename are distinct elements of a full file pathname.
25 If path is ``", the current directory will be used. If filename is ``",
26 no default filename will be supplied. The wildcard determines what files
27 are displayed in the file selector, and file extension supplies a type
28 extension for the required filename. Flags may be a combination of wxOPEN,
29 wxSAVE, wxOVERWRITE
\_PROMPT, wxHIDE
\_READONLY, wxFILE
\_MUST\_EXIST, wxMULTIPLE or
0.
31 Both the X and Windows versions implement a wildcard filter. Typing a
32 filename containing wildcards
(*, ?) in the filename text item, and
33 clicking on Ok, will result in only those files matching the pattern being
34 displayed. The wildcard may be a specification for multiple
35 types of file with a description for each, such as:
38 "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
41 \latexignore{\rtfignore{\wxheading{Members}}}
43 \membersection{wxFileDialog::wxFileDialog}\label{wxfiledialogconstr}
45 \func{}{wxFileDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{message = "Choose a file"},\rtfsp
46 \param{const wxString\& }{defaultDir = ""}, \param{const wxString\& }{defaultFile = ``"},\rtfsp
47 \param{const wxString\& }{wildcard = ``*.*"}, \param{long }{style = 0}, \param{const wxPoint\& }{pos = wxDefaultPosition}}
49 Constructor. Use \helpref{wxFileDialog::ShowModal}{wxfiledialogshowmodal} to show the dialog.
51 \wxheading{Parameters}
53 \docparam{parent}{Parent window.}
55 \docparam{message}{Message to show on the dialog.}
57 \docparam{defaultDir}{The default directory, or the empty string.}
59 \docparam{defaultFile}{The default filename, or the empty string.}
61 \docparam{wildcard}{A wildcard, such as ``*.*" or ``BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".}
63 \docparam{style}{A dialog style. A bitlist of:
67 \twocolitem{{\bf wxOPEN}}{This is an open dialog.}
68 \twocolitem{{\bf wxSAVE}}{This is a save dialog.}
69 \twocolitem{{\bf wxHIDE\_READONLY}}{For open dialog only: hide the checkbox allowing to open the file in read-only mode.}
70 \twocolitem{{\bf wxOVERWRITE\_PROMPT}}{For save dialog only: prompt for a confirmation if a file will be overwritten.}
71 \twocolitem{{\bf wxMULTIPLE}}{For open dialog only: allows selecting multiple files.}
72 \twocolitem{{\bf wxCHANGE\_DIR}}{Change the current working directory to the directory where the file(s) chosen by the user are.}
76 \docparam{pos}{Dialog position. Not implemented.}
78 {\bf NB:} Previous versions of wxWindows used {\tt wxCHANGE\_DIR} by default
79 under MS Windows which allowed the program to simply remember the last
80 directory where user selected the files to open/save. This (desired)
81 functionality must be implemented in the program itself now (manually remember
82 the last path used and pass it to the dialog the next time it is called) or
85 \membersection{wxFileDialog::\destruct{wxFileDialog}}
87 \func{}{\destruct{wxFileDialog}}{\void}
91 \membersection{wxFileDialog::GetDirectory}\label{wxfiledialoggetdirectory}
93 \constfunc{wxString}{GetDirectory}{\void}
95 Returns the default directory.
97 \membersection{wxFileDialog::GetFilename}\label{wxfiledialoggetfilename}
99 \constfunc{wxString}{GetFilename}{\void}
101 Returns the default filename.
103 \membersection{wxFileDialog::GetFilenames}\label{wxfiledialoggetfilenames}
105 \constfunc{void}{GetFilenames}{\param{wxArrayString\& }{filenames}}
107 Fills the array {\it filenames} with the names of the files chosen. This
108 function should only be used with the dialogs which have {\tt wxMULTIPLE} style,
109 use \helpref{GetFilename}{wxfiledialoggetfilename} for the others.
111 \membersection{wxFileDialog::GetFilterIndex}\label{wxfiledialoggetfilterindex}
113 \constfunc{int}{GetFilterIndex}{\void}
115 Returns the index into the list of filters supplied, optionally, in the wildcard parameter.
116 Before the dialog is shown, this is the index which will be used when the dialog is first displayed.
117 After the dialog is shown, this is the index selected by the user.
119 \membersection{wxFileDialog::GetMessage}\label{wxfiledialoggetmessage}
121 \constfunc{wxString}{GetMessage}{\void}
123 Returns the message that will be displayed on the dialog.
125 \membersection{wxFileDialog::GetPath}\label{wxfiledialoggetpath}
127 \constfunc{wxString}{GetPath}{\void}
129 Returns the full path (directory and filename) of the selected file.
131 \membersection{wxFileDialog::GetPaths}\label{wxfiledialoggetpaths}
133 \constfunc{void}{GetPaths}{\param{wxArrayString\& }{paths}}
135 Fills the array {\it paths} with the full paths of the files chosen. This
136 function should only be used with the dialogs which have {\tt wxMULTIPLE} style,
137 use \helpref{GetPath}{wxfiledialoggetpath} for the others.
139 \membersection{wxFileDialog::GetStyle}\label{wxfiledialoggetstyle}
141 \constfunc{long}{GetStyle}{\void}
143 Returns the dialog style.
145 \membersection{wxFileDialog::GetWildcard}\label{wxfiledialoggetwildcard}
147 \constfunc{wxString}{GetWildcard}{\void}
149 Returns the file dialog wildcard.
151 \membersection{wxFileDialog::SetDirectory}\label{wxfiledialogsetdirectory}
153 \func{void}{SetDirectory}{\param{const wxString\& }{directory}}
155 Sets the default directory.
157 \membersection{wxFileDialog::SetFilename}\label{wxfiledialogsetfilename}
159 \func{void}{SetFilename}{\param{const wxString\& }{setfilename}}
161 Sets the default filename.
163 \membersection{wxFileDialog::SetFilterIndex}\label{wxfiledialogsetfilterindex}
165 \func{void}{SetFilterIndex}{\param{int }{filterIndex}}
167 Sets the default filter index, starting from zero.
169 \membersection{wxFileDialog::SetMessage}\label{wxfiledialogsetmessage}
171 \func{void}{SetMessage}{\param{const wxString\& }{message}}
173 Sets the message that will be displayed on the dialog.
175 \membersection{wxFileDialog::SetPath}\label{wxfiledialogsetpath}
177 \func{void}{SetPath}{\param{const wxString\& }{path}}
179 Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).
181 \membersection{wxFileDialog::SetStyle}\label{wxfiledialogsetstyle}
183 \func{void}{SetStyle}{\param{long }{style}}
185 Sets the dialog style. See \helpref{wxFileDialog::wxFileDialog}{wxfiledialogconstr} for details.
187 \membersection{wxFileDialog::SetWildcard}\label{wxfiledialogsetwildcard}
189 \func{void}{SetWildcard}{\param{const wxString\& }{wildCard}}
191 Sets the wildcard, which can contain multiple file types, for example:
193 ``BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
195 \membersection{wxFileDialog::ShowModal}\label{wxfiledialogshowmodal}
197 \func{int}{ShowModal}{\void}
199 Shows the dialog, returning wxID\_OK if the user pressed OK, and wxID\_CANCEL