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, 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 ``*.*".}
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}}{Hide read-only files.}
70 \twocolitem{{\bf wxOVERWRITE\_PROMPT}}{Prompt for a conformation if a file will be overridden.}
74 \docparam{pos}{Dialog position. Not implemented.}
76 \membersection{wxFileDialog::\destruct{wxFileDialog}}
78 \func{}{\destruct{wxFileDialog}}{\void}
82 \membersection{wxFileDialog::GetDirectory}\label{wxfiledialoggetdirectory}
84 \constfunc{wxString}{GetDirectory}{\void}
86 Returns the default directory.
88 \membersection{wxFileDialog::GetFilename}\label{wxfiledialoggetfilename}
90 \constfunc{wxString}{GetFilename}{\void}
92 Returns the default filename.
94 \membersection{wxFileDialog::GetFilterIndex}\label{wxfiledialoggetfilterindex}
96 \constfunc{int}{GetFilterIndex}{\void}
98 Returns the index into the list of filters supplied, optionally, in the wildcard parameter.
99 Before the dialog is shown, this is the index which will be used when the dialog is first displayed.
100 After the dialog is shown, this is the index selected by the user.
102 \membersection{wxFileDialog::GetMessage}\label{wxfiledialoggetmessage}
104 \constfunc{wxString}{GetMessage}{\void}
106 Returns the message that will be displayed on the dialog.
108 \membersection{wxFileDialog::GetPath}\label{wxfiledialoggetpath}
110 \constfunc{wxString}{GetPath}{\void}
112 Returns the full path (directory and filename) of the selected file.
114 \membersection{wxFileDialog::GetStyle}\label{wxfiledialoggetstyle}
116 \constfunc{long}{GetStyle}{\void}
118 Returns the dialog style.
120 \membersection{wxFileDialog::GetWildcard}\label{wxfiledialoggetwildcard}
122 \constfunc{wxString}{GetWildcard}{\void}
124 Returns the file dialog wildcard.
126 \membersection{wxFileDialog::SetDirectory}\label{wxfiledialogsetdirectory}
128 \func{void}{SetDirectory}{\param{const wxString\& }{directory}}
130 Sets the default directory.
132 \membersection{wxFileDialog::SetFilename}\label{wxfiledialogsetfilename}
134 \func{void}{SetFilename}{\param{const wxString\& }{setfilename}}
136 Sets the default filename.
138 \membersection{wxFileDialog::SetFilterIndex}\label{wxfiledialogsetfilterindex}
140 \func{void}{SetFilterIndex}{\param{int }{filterIndex}}
142 Sets the default filter index, starting from zero. Windows only.
144 \membersection{wxFileDialog::SetMessage}\label{wxfiledialogsetmessage}
146 \func{void}{SetMessage}{\param{const wxString\& }{message}}
148 Sets the message that will be displayed on the dialog.
150 \membersection{wxFileDialog::SetPath}\label{wxfiledialogsetpath}
152 \func{void}{SetPath}{\param{const wxString\& }{path}}
154 Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).
156 \membersection{wxFileDialog::SetStyle}\label{wxfiledialogsetstyle}
158 \func{void}{SetStyle}{\param{long }{style}}
160 Sets the dialog style. See \helpref{wxFileDialog::wxFileDialog}{wxfiledialogconstr} for details.
162 \membersection{wxFileDialog::SetWildcard}\label{wxfiledialogsetwildcard}
164 \func{void}{SetWildcard}{\param{const wxString\& }{wildCard}}
166 Sets the wildcard, which in Windows can contain multiple file types.
168 \membersection{wxFileDialog::ShowModal}\label{wxfiledialogshowmodal}
170 \func{int}{ShowModal}{\void}
172 Shows the dialog, returning wxID\_OK if the user pressed OK, and wxOK\_CANCEL