]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/filedlg.tex
Several changes and updates
[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
20 \wxheading{Remarks}
21
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. They are only significant
30 at present in Windows.
31
32 Both the X and Windows versions implement a wildcard filter. Typing a
33 filename containing wildcards (*, ?) in the filename text item, and
34 clicking on Ok, will result in only those files matching the pattern being
35 displayed. In the X version, supplying no default name will result in the
36 wildcard filter being inserted in the filename text item; the filter is
37 ignored if a default name is supplied.
38
39 Under Windows (only), the wildcard may be a specification for multiple
40 types of file with a description for each, such as:
41
42 \begin{verbatim}
43 "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
44 \end{verbatim}
45
46 \latexignore{\rtfignore{\wxheading{Members}}}
47
48 \membersection{wxFileDialog::wxFileDialog}\label{wxfiledialogconstr}
49
50 \func{}{wxFileDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{message = "Choose a file"},\rtfsp
51 \param{const wxString\& }{defaultDir = ""}, \param{const wxString\& }{defaultFile = ``"},\rtfsp
52 \param{const wxString\& }{wildcard = ``*.*"}, \param{long }{style = 0}, \param{const wxPoint\& }{pos = wxDefaultPosition}}
53
54 Constructor. Use \helpref{wxFileDialog::ShowModal}{wxfiledialogshowmodal} to show the dialog.
55
56 \wxheading{Parameters}
57
58 \docparam{parent}{Parent window.}
59
60 \docparam{message}{Message to show on the dialog.}
61
62 \docparam{defaultDir}{The default directory, or the empty string.}
63
64 \docparam{defaultFile}{The default filename, or the empty string.}
65
66 \docparam{wildcard}{A wildcard, such as ``*.*".}
67
68 \docparam{style}{A dialog style. A bitlist of:
69
70 \twocolwidtha{5cm}
71 \begin{twocollist}
72 \twocolitem{{\bf wxOPEN}}{This is an open dialog (Windows only).}
73 \twocolitem{{\bf wxSAVE}}{This is a save dialog (Windows only).}
74 \twocolitem{{\bf wxHIDE\_READONLY}}{Hide read-only files (Windows only).}
75 \twocolitem{{\bf wxOVERWRITE\_PROMPT}}{Prompt for a conformation if a file will be overridden (Windows only).}
76 \end{twocollist}%
77 }
78
79 \docparam{pos}{Dialog position. Not implemented.}
80
81 \membersection{wxFileDialog::\destruct{wxFileDialog}}
82
83 \func{}{\destruct{wxFileDialog}}{\void}
84
85 Destructor.
86
87 \membersection{wxFileDialog::GetDirectory}\label{wxfiledialoggetdirectory}
88
89 \constfunc{wxString}{GetDirectory}{\void}
90
91 Returns the default directory.
92
93 \membersection{wxFileDialog::GetFilename}\label{wxfiledialoggetfilename}
94
95 \constfunc{wxString}{GetFilename}{\void}
96
97 Returns the default filename.
98
99 \membersection{wxFileDialog::GetFilterIndex}\label{wxfiledialoggetfilterindex}
100
101 \constfunc{int}{GetFilterIndex}{\void}
102
103 Returns the index into the list of filters supplied, optionally, in the wildcard parameter.
104 Before the dialog is shown, this is the index which will be used when the dialog is first displayed.
105 After the dialog is shown, this is the index selected by the user.
106
107 \membersection{wxFileDialog::GetMessage}\label{wxfiledialoggetmessage}
108
109 \constfunc{wxString}{GetMessage}{\void}
110
111 Returns the message that will be displayed on the dialog.
112
113 \membersection{wxFileDialog::GetPath}\label{wxfiledialoggetpath}
114
115 \constfunc{wxString}{GetPath}{\void}
116
117 Returns the full path (directory and filename) of the selected file.
118
119 \membersection{wxFileDialog::GetStyle}\label{wxfiledialoggetstyle}
120
121 \constfunc{long}{GetStyle}{\void}
122
123 Returns the dialog style.
124
125 \membersection{wxFileDialog::GetWildcard}\label{wxfiledialoggetwildcard}
126
127 \constfunc{wxString}{GetWildcard}{\void}
128
129 Returns the file dialog wildcard.
130
131 \membersection{wxFileDialog::SetDirectory}\label{wxfiledialogsetdirectory}
132
133 \func{void}{SetDirectory}{\param{const wxString\& }{directory}}
134
135 Sets the default directory.
136
137 \membersection{wxFileDialog::SetFilename}\label{wxfiledialogsetfilename}
138
139 \func{void}{SetFilename}{\param{const wxString\& }{setfilename}}
140
141 Sets the default filename.
142
143 \membersection{wxFileDialog::SetFilterIndex}\label{wxfiledialogsetfilterindex}
144
145 \func{void}{SetFilterIndex}{\param{int }{filterIndex}}
146
147 Sets the default filter index, starting from zero. Windows only.
148
149 \membersection{wxFileDialog::SetMessage}\label{wxfiledialogsetmessage}
150
151 \func{void}{SetMessage}{\param{const wxString\& }{message}}
152
153 Sets the message that will be displayed on the dialog.
154
155 \membersection{wxFileDialog::SetPath}\label{wxfiledialogsetpath}
156
157 \func{void}{SetPath}{\param{const wxString\& }{path}}
158
159 Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).
160
161 \membersection{wxFileDialog::SetStyle}\label{wxfiledialogsetstyle}
162
163 \func{void}{SetStyle}{\param{long }{style}}
164
165 Sets the dialog style. See \helpref{wxFileDialog::wxFileDialog}{wxfiledialogconstr} for details.
166
167 \membersection{wxFileDialog::SetWildcard}\label{wxfiledialogsetwildcard}
168
169 \func{void}{SetWildcard}{\param{const wxString\& }{wildCard}}
170
171 Sets the wildcard, which in Windows can contain multiple file types.
172
173 \membersection{wxFileDialog::ShowModal}\label{wxfiledialogshowmodal}
174
175 \func{int}{ShowModal}{\void}
176
177 Shows the dialog, returning wxID\_OK if the user pressed OK, and wxOK\_CANCEL
178 otherwise.
179
180