]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/filedlg.tex
Some stubs corrections; Motif corrections incl. busy cursor fix; doc corrections
[wxWidgets.git] / docs / latex / wx / filedlg.tex
1 \section{\class{wxFileDialog}}\label{wxfiledialog}
2
3 This 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{Include files}
13
14 <wx/filedlg.h>
15
16 \wxheading{See also}
17
18 \helpref{wxFileDialog overview}{wxfiledialogoverview}, \helpref{wxFileSelector}{wxfileselector}
19 %\rtfsp\helpref{wxFileSelectorEx}{wxfileselectorex}
20 %\helpref{wxLoadFileSelector}{wxloadfileselector},\rtfsp
21 %\helpref{wxSaveFileSelector}{wxsavefileselector}
22
23 \wxheading{Remarks}
24
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.
34
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.
41
42 Under Windows (only), the wildcard may be a specification for multiple
43 types of file with a description for each, such as:
44
45 \begin{verbatim}
46 "BMP files (*.bmp) | *.bmp | GIF files (*.gif) | *.gif"
47 \end{verbatim}
48
49 \latexignore{\rtfignore{\wxheading{Members}}}
50
51 \membersection{wxFileDialog::wxFileDialog}\label{wxfiledialogconstr}
52
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}}
56
57 Constructor. Use \helpref{wxFileDialog::ShowModal}{wxfiledialogshowmodal} to show the dialog.
58
59 \wxheading{Parameters}
60
61 \docparam{parent}{Parent window.}
62
63 \docparam{message}{Message to show on the dialog.}
64
65 \docparam{defaultDir}{The default directory, or the empty string.}
66
67 \docparam{defaultFile}{The default filename, or the empty string.}
68
69 \docparam{wildcard}{A wildcard, such as ``*.*".}
70
71 \docparam{style}{A dialog style. A bitlist of:
72
73 \twocolwidtha{5cm}
74 \begin{twocollist}
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).}
79 \end{twocollist}%
80 }
81
82 \docparam{pos}{Dialog position. Not implemented.}
83
84 \membersection{wxFileDialog::\destruct{wxFileDialog}}
85
86 \func{}{\destruct{wxFileDialog}}{\void}
87
88 Destructor.
89
90 \membersection{wxFileDialog::GetDirectory}\label{wxfiledialoggetdirectory}
91
92 \constfunc{wxString}{GetDirectory}{\void}
93
94 Returns the default directory.
95
96 \membersection{wxFileDialog::GetFilename}\label{wxfiledialoggetfilename}
97
98 \constfunc{wxString}{GetFilename}{\void}
99
100 Returns the default filename.
101
102 \membersection{wxFileDialog::GetFilterIndex}\label{wxfiledialoggetfilterindex}
103
104 \constfunc{int}{GetFilterIndex}{\void}
105
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.
109
110 \membersection{wxFileDialog::GetMessage}\label{wxfiledialoggetmessage}
111
112 \constfunc{wxString}{GetMessage}{\void}
113
114 Returns the message that will be displayed on the dialog.
115
116 \membersection{wxFileDialog::GetPath}\label{wxfiledialoggetpath}
117
118 \constfunc{wxString}{GetPath}{\void}
119
120 Returns the full path (directory and filename) of the selected file.
121
122 \membersection{wxFileDialog::GetStyle}\label{wxfiledialoggetstyle}
123
124 \constfunc{long}{GetStyle}{\void}
125
126 Returns the dialog style.
127
128 \membersection{wxFileDialog::GetWildcard}\label{wxfiledialoggetwildcard}
129
130 \constfunc{wxString}{GetWildcard}{\void}
131
132 Returns the file dialog wildcard.
133
134 \membersection{wxFileDialog::SetDirectory}\label{wxfiledialogsetdirectory}
135
136 \func{void}{SetDirectory}{\param{const wxString\& }{directory}}
137
138 Sets the default directory.
139
140 \membersection{wxFileDialog::SetFilename}\label{wxfiledialogsetfilename}
141
142 \func{void}{SetFilename}{\param{const wxString\& }{setfilename}}
143
144 Sets the default filename.
145
146 \membersection{wxFileDialog::SetFilterIndex}\label{wxfiledialogsetfilterindex}
147
148 \func{void}{SetFilterIndex}{\param{int }{filterIndex}}
149
150 Sets the default filter index, starting from zero. Windows only.
151
152 \membersection{wxFileDialog::SetMessage}\label{wxfiledialogsetmessage}
153
154 \func{void}{SetMessage}{\param{const wxString\& }{message}}
155
156 Sets the message that will be displayed on the dialog.
157
158 \membersection{wxFileDialog::SetPath}\label{wxfiledialogsetpath}
159
160 \func{void}{SetPath}{\param{const wxString\& }{path}}
161
162 Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).
163
164 \membersection{wxFileDialog::SetStyle}\label{wxfiledialogsetstyle}
165
166 \func{void}{SetStyle}{\param{long }{style}}
167
168 Sets the dialog style. See \helpref{wxFileDialog::wxFileDialog}{wxfiledialogconstr} for details.
169
170 \membersection{wxFileDialog::SetWildcard}\label{wxfiledialogsetwildcard}
171
172 \func{void}{SetWildcard}{\param{const wxString\& }{wildCard}}
173
174 Sets the wildcard, which in Windows can contain multiple file types.
175
176 \membersection{wxFileDialog::ShowModal}\label{wxfiledialogshowmodal}
177
178 \func{int}{ShowModal}{\void}
179
180 Shows the dialog, returning wxID\_OK if the user pressed OK, and wxOK\_CANCEL
181 otherwise.
182
183