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
}
19 %\rtfsp\helpref{wxFileSelectorEx}{wxfileselectorex}
20 %\helpref{wxLoadFileSelector}{wxloadfileselector},\rtfsp
21 %\helpref{wxSaveFileSelector}{wxsavefileselector}
25 Pops up a file selector box. In Windows, this is the common file selector
26 dialog. In X, this is a file selector box with somewhat less functionality.
27 The path and filename are distinct elements of a full file pathname.
28 If path is ``", the current directory will be used. If filename is ``",
29 no default filename will be supplied. The wildcard determines what files
30 are displayed in the file selector, and file extension supplies a type
31 extension for the required filename. Flags may be a combination of wxOPEN,
32 wxSAVE, wxOVERWRITE
\_PROMPT, wxHIDE
\_READONLY, or
0. They are only significant
33 at present in Windows.
35 Both the X and Windows versions implement a wildcard filter. Typing a
36 filename containing wildcards
(*, ?) in the filename text item, and
37 clicking on Ok, will result in only those files matching the pattern being
38 displayed. In the X version, supplying no default name will result in the
39 wildcard filter being inserted in the filename text item; the filter is
40 ignored if a default name is supplied.
42 Under Windows (only), the wildcard may be a specification for multiple
43 types of file with a description for each, such as:
46 "BMP files (*.bmp) | *.bmp | GIF files (*.gif) | *.gif"
49 \latexignore{\rtfignore{\wxheading{Members}}}
51 \membersection{wxFileDialog::wxFileDialog}\label{wxfiledialogconstr}
53 \func{}{wxFileDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{message = "Choose a file"},\rtfsp
54 \param{const wxString\& }{defaultDir = ""}, \param{const wxString\& }{defaultFile = ``"},\rtfsp
55 \param{const wxString\& }{wildcard = ``*.*"}, \param{long }{style = 0}, \param{const wxPoint\& }{pos = wxDefaultPosition}}
57 Constructor. Use \helpref{wxFileDialog::ShowModal}{wxfiledialogshowmodal} to show the dialog.
59 \wxheading{Parameters}
61 \docparam{parent}{Parent window.}
63 \docparam{message}{Message to show on the dialog.}
65 \docparam{defaultDir}{The default directory, or the empty string.}
67 \docparam{defaultFile}{The default filename, or the empty string.}
69 \docparam{wildcard}{A wildcard, such as ``*.*".}
71 \docparam{style}{A dialog style. A bitlist of:
75 \twocolitem{{\bf wxOPEN}}{This is an open dialog (Windows only).}
76 \twocolitem{{\bf wxSAVE}}{This is a save dialog (Windows only).}
77 \twocolitem{{\bf wxHIDE\_READONLY}}{Hide read-only files (Windows only).}
78 \twocolitem{{\bf wxOVERWRITE\_PROMPT}}{Prompt for a conformation if a file will be overridden (Windows only).}
82 \docparam{pos}{Dialog position. Not implemented.}
84 \membersection{wxFileDialog::\destruct{wxFileDialog}}
86 \func{}{\destruct{wxFileDialog}}{\void}
90 \membersection{wxFileDialog::GetDirectory}\label{wxfiledialoggetdirectory}
92 \constfunc{wxString}{GetDirectory}{\void}
94 Returns the default directory.
96 \membersection{wxFileDialog::GetFilename}\label{wxfiledialoggetfilename}
98 \constfunc{wxString}{GetFilename}{\void}
100 Returns the default filename.
102 \membersection{wxFileDialog::GetFilterIndex}\label{wxfiledialoggetfilterindex}
104 \constfunc{int}{GetFilterIndex}{\void}
106 Returns the index into the list of filters supplied, optionally, in the wildcard parameter.
107 Before the dialog is shown, this is the index which will be used when the dialog is first displayed.
108 After the dialog is shown, this is the index selected by the user.
110 \membersection{wxFileDialog::GetMessage}\label{wxfiledialoggetmessage}
112 \constfunc{wxString}{GetMessage}{\void}
114 Returns the message that will be displayed on the dialog.
116 \membersection{wxFileDialog::GetPath}\label{wxfiledialoggetpath}
118 \constfunc{wxString}{GetPath}{\void}
120 Returns the full path (directory and filename) of the selected file.
122 \membersection{wxFileDialog::GetStyle}\label{wxfiledialoggetstyle}
124 \constfunc{long}{GetStyle}{\void}
126 Returns the dialog style.
128 \membersection{wxFileDialog::GetWildcard}\label{wxfiledialoggetwildcard}
130 \constfunc{wxString}{GetWildcard}{\void}
132 Returns the file dialog wildcard.
134 \membersection{wxFileDialog::SetDirectory}\label{wxfiledialogsetdirectory}
136 \func{void}{SetDirectory}{\param{const wxString\& }{directory}}
138 Sets the default directory.
140 \membersection{wxFileDialog::SetFilename}\label{wxfiledialogsetfilename}
142 \func{void}{SetFilename}{\param{const wxString\& }{setfilename}}
144 Sets the default filename.
146 \membersection{wxFileDialog::SetFilterIndex}\label{wxfiledialogsetfilterindex}
148 \func{void}{SetFilterIndex}{\param{int }{filterIndex}}
150 Sets the default filter index, starting from zero. Windows only.
152 \membersection{wxFileDialog::SetMessage}\label{wxfiledialogsetmessage}
154 \func{void}{SetMessage}{\param{const wxString\& }{message}}
156 Sets the message that will be displayed on the dialog.
158 \membersection{wxFileDialog::SetPath}\label{wxfiledialogsetpath}
160 \func{void}{SetPath}{\param{const wxString\& }{path}}
162 Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).
164 \membersection{wxFileDialog::SetStyle}\label{wxfiledialogsetstyle}
166 \func{void}{SetStyle}{\param{long }{style}}
168 Sets the dialog style. See \helpref{wxFileDialog::wxFileDialog}{wxfiledialogconstr} for details.
170 \membersection{wxFileDialog::SetWildcard}\label{wxfiledialogsetwildcard}
172 \func{void}{SetWildcard}{\param{const wxString\& }{wildCard}}
174 Sets the wildcard, which in Windows can contain multiple file types.
176 \membersection{wxFileDialog::ShowModal}\label{wxfiledialogshowmodal}
178 \func{int}{ShowModal}{\void}
180 Shows the dialog, returning wxID\_OK if the user pressed OK, and wxOK\_CANCEL