]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/filedlg.tex
Various; wxRadioButton::GetValue corrected
[wxWidgets.git] / docs / latex / wx / filedlg.tex
CommitLineData
a660d684
KB
1\section{\class{wxFileDialog}}\label{wxfiledialog}
2
3This class represents the file chooser dialog.
4
5\wxheading{Derived from}
6
7\helpref{wxDialog}{wxdialog}\\
8\helpref{wxWindow}{wxwindow}\\
9\helpref{wxEvtHandler}{wxevthandler}\\
10\helpref{wxObject}{wxobject}
11
12\wxheading{See also}
13
14\helpref{wxFileDialog overview}{wxfiledialogoverview}, \helpref{wxFileSelector}{wxfileselector}
15%\rtfsp\helpref{wxFileSelectorEx}{wxfileselectorex}
16%\helpref{wxLoadFileSelector}{wxloadfileselector},\rtfsp
17%\helpref{wxSaveFileSelector}{wxsavefileselector}
18
19\wxheading{Remarks}
20
21Pops up a file selector box. In Windows, this is the common file selector
22dialog. In X, this is a file selector box with somewhat less functionality.
23The path and filename are distinct elements of a full file pathname.
24If path is ``", the current directory will be used. If filename is ``",
25no default filename will be supplied. The wildcard determines what files
26are displayed in the file selector, and file extension supplies a type
27extension for the required filename. Flags may be a combination of wxOPEN,
28wxSAVE, wxOVERWRITE\_PROMPT, wxHIDE\_READONLY, or 0. They are only significant
29at present in Windows.
30
31Both the X and Windows versions implement a wildcard filter. Typing a
32filename containing wildcards (*, ?) in the filename text item, and
33clicking on Ok, will result in only those files matching the pattern being
34displayed. In the X version, supplying no default name will result in the
35wildcard filter being inserted in the filename text item; the filter is
36ignored if a default name is supplied.
37
38Under Windows (only), the wildcard may be a specification for multiple
39types of file with a description for each, such as:
40
41\begin{verbatim}
42 "BMP files (*.bmp) | *.bmp | GIF files (*.gif) | *.gif"
43\end{verbatim}
44
45\latexignore{\rtfignore{\wxheading{Members}}}
46
47\membersection{wxFileDialog::wxFileDialog}\label{wxfiledialogconstr}
48
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}}
52
53Constructor. Use \helpref{wxFileDialog::ShowModal}{wxfiledialogshowmodal} to show the dialog.
54
55\wxheading{Parameters}
56
57\docparam{parent}{Parent window.}
58
59\docparam{message}{Message to show on the dialog.}
60
61\docparam{defaultDir}{The default directory, or the empty string.}
62
63\docparam{defaultFile}{The default filename, or the empty string.}
64
65\docparam{wildcard}{A wildcard, such as ``*.*".}
66
67\docparam{style}{A dialog style. A bitlist of:
68
69\twocolwidtha{5cm}
70\begin{twocollist}
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).}
75\end{twocollist}%
76}
77
78\docparam{pos}{Dialog position. Not implemented.}
79
80\membersection{wxFileDialog::\destruct{wxFileDialog}}
81
82\func{}{\destruct{wxFileDialog}}{\void}
83
84Destructor.
85
86\membersection{wxFileDialog::GetDirectory}\label{wxfiledialoggetdirectory}
87
88\constfunc{wxString}{GetDirectory}{\void}
89
90Returns the default directory.
91
92\membersection{wxFileDialog::GetFilename}\label{wxfiledialoggetfilename}
93
94\constfunc{wxString}{GetFilename}{\void}
95
96Returns the default filename.
97
98\membersection{wxFileDialog::GetFilterIndex}\label{wxfiledialoggetfilterindex}
99
100\constfunc{int}{GetFilterIndex}{\void}
101
102Returns the index into the list of filters supplied, optionally, in the wildcard parameter.
103Before the dialog is shown, this is the index which will be used when the dialog is first displayed.
104After the dialog is shown, this is the index selected by the user.
105
106\membersection{wxFileDialog::GetMessage}\label{wxfiledialoggetmessage}
107
108\constfunc{wxString}{GetMessage}{\void}
109
110Returns the message that will be displayed on the dialog.
111
112\membersection{wxFileDialog::GetPath}\label{wxfiledialoggetpath}
113
114\constfunc{wxString}{GetPath}{\void}
115
116Returns the full path (directory and filename) of the selected file.
117
118\membersection{wxFileDialog::GetStyle}\label{wxfiledialoggetstyle}
119
120\constfunc{long}{GetStyle}{\void}
121
122Returns the dialog style.
123
124\membersection{wxFileDialog::GetWildcard}\label{wxfiledialoggetwildcard}
125
126\constfunc{wxString}{GetWildcard}{\void}
127
128Returns the file dialog wildcard.
129
130\membersection{wxFileDialog::SetDirectory}\label{wxfiledialogsetdirectory}
131
132\func{void}{SetDirectory}{\param{const wxString\& }{directory}}
133
134Sets the default directory.
135
136\membersection{wxFileDialog::SetFilename}\label{wxfiledialogsetfilename}
137
138\func{void}{SetFilename}{\param{const wxString\& }{setfilename}}
139
140Sets the default filename.
141
142\membersection{wxFileDialog::SetFilterIndex}\label{wxfiledialogsetfilterindex}
143
144\func{void}{SetFilterIndex}{\param{int }{filterIndex}}
145
146Sets the default filter index, starting from zero. Windows only.
147
148\membersection{wxFileDialog::SetMessage}\label{wxfiledialogsetmessage}
149
150\func{void}{SetMessage}{\param{const wxString\& }{message}}
151
152Sets the message that will be displayed on the dialog.
153
154\membersection{wxFileDialog::SetPath}\label{wxfiledialogsetpath}
155
156\func{void}{SetPath}{\param{const wxString\& }{path}}
157
158Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).
159
160\membersection{wxFileDialog::SetStyle}\label{wxfiledialogsetstyle}
161
162\func{void}{SetStyle}{\param{long }{style}}
163
164Sets the dialog style. See \helpref{wxFileDialog::wxFileDialog}{wxfiledialogconstr} for details.
165
166\membersection{wxFileDialog::SetWildcard}\label{wxfiledialogsetwildcard}
167
168\func{void}{SetWildcard}{\param{const wxString\& }{wildCard}}
169
170Sets the wildcard, which in Windows can contain multiple file types.
171
172\membersection{wxFileDialog::ShowModal}\label{wxfiledialogshowmodal}
173
174\func{int}{ShowModal}{\void}
175
176Shows the dialog, returning wxID\_OK if the user pressed OK, and wxOK\_CANCEL
177otherwise.
178
179