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