]> git.saurik.com Git - wxWidgets.git/blob - docs/latex/wx/filedlg.tex
* Stream doc update.
[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{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
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.
30
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.
37
38 Under Windows (only), the wildcard may be a specification for multiple
39 types 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
53 Constructor. 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
84 Destructor.
85
86 \membersection{wxFileDialog::GetDirectory}\label{wxfiledialoggetdirectory}
87
88 \constfunc{wxString}{GetDirectory}{\void}
89
90 Returns the default directory.
91
92 \membersection{wxFileDialog::GetFilename}\label{wxfiledialoggetfilename}
93
94 \constfunc{wxString}{GetFilename}{\void}
95
96 Returns the default filename.
97
98 \membersection{wxFileDialog::GetFilterIndex}\label{wxfiledialoggetfilterindex}
99
100 \constfunc{int}{GetFilterIndex}{\void}
101
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.
105
106 \membersection{wxFileDialog::GetMessage}\label{wxfiledialoggetmessage}
107
108 \constfunc{wxString}{GetMessage}{\void}
109
110 Returns the message that will be displayed on the dialog.
111
112 \membersection{wxFileDialog::GetPath}\label{wxfiledialoggetpath}
113
114 \constfunc{wxString}{GetPath}{\void}
115
116 Returns the full path (directory and filename) of the selected file.
117
118 \membersection{wxFileDialog::GetStyle}\label{wxfiledialoggetstyle}
119
120 \constfunc{long}{GetStyle}{\void}
121
122 Returns the dialog style.
123
124 \membersection{wxFileDialog::GetWildcard}\label{wxfiledialoggetwildcard}
125
126 \constfunc{wxString}{GetWildcard}{\void}
127
128 Returns the file dialog wildcard.
129
130 \membersection{wxFileDialog::SetDirectory}\label{wxfiledialogsetdirectory}
131
132 \func{void}{SetDirectory}{\param{const wxString\& }{directory}}
133
134 Sets the default directory.
135
136 \membersection{wxFileDialog::SetFilename}\label{wxfiledialogsetfilename}
137
138 \func{void}{SetFilename}{\param{const wxString\& }{setfilename}}
139
140 Sets the default filename.
141
142 \membersection{wxFileDialog::SetFilterIndex}\label{wxfiledialogsetfilterindex}
143
144 \func{void}{SetFilterIndex}{\param{int }{filterIndex}}
145
146 Sets 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
152 Sets 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
158 Sets 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
164 Sets 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
170 Sets the wildcard, which in Windows can contain multiple file types.
171
172 \membersection{wxFileDialog::ShowModal}\label{wxfiledialogshowmodal}
173
174 \func{int}{ShowModal}{\void}
175
176 Shows the dialog, returning wxID\_OK if the user pressed OK, and wxOK\_CANCEL
177 otherwise.
178
179