File: wx90.htm

package info (click to toggle)
wxwin2-doc 2.01-1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,540 kB
  • ctags: 5,968
  • sloc: cpp: 15,157; makefile: 434; sh: 6
file content (254 lines) | stat: -rw-r--r-- 8,468 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
<HTML>
<head><title>wxFileDialog</title></head>

<BODY BGCOLOR=#FFFFFF>
<A NAME="wxfiledialog"></A><CENTER>
<A HREF="wx.htm"><img align=center src="contents.gif" BORDER=0 ALT="Contents"></A> <A HREF="wx22.htm#classref"><img align=center src="up.gif" BORDER=0 ALT="Up"></A> <A HREF="wx89.htm#wxfiledataobject"><img align=center src="back.gif" BORDER=0 ALT="Previous"></A> <A HREF="wx91.htm#wxfiledroptarget"><img align=center src="forward.gif" BORDER=0 ALT="Next"></A> </CENTER><HR>

<H2>wxFileDialog</H2>
<P>
This class represents the file chooser dialog.<P>
<B><FONT COLOR="#FF0000">Derived from</FONT></B><P>
<A HREF="wx71.htm#wxdialog">wxDialog</A><BR>

<A HREF="wx260.htm#wxwindow">wxWindow</A><BR>

<A HREF="wx85.htm#wxevthandler">wxEvtHandler</A><BR>

<A HREF="wx158.htm#wxobject">wxObject</A><P>
<B><FONT COLOR="#FF0000">Include files</FONT></B><P>
&lt;wx/filedlg.h&gt;<P>
<B><FONT COLOR="#FF0000">See also</FONT></B><P>
<A HREF="wx291.htm#wxfiledialogoverview">wxFileDialog overview</A>, <A HREF="wx267.htm#wxfileselector">wxFileSelector</A>
<B><FONT COLOR="#FF0000">Remarks</FONT></B><P>
Pops up a file selector box. In Windows, this is the common file selector
dialog. In X, this is a file selector box with somewhat less functionality.
The path and filename are distinct elements of a full file pathname.
If path is "", the current directory will be used. If filename is "",
no default filename will be supplied. The wildcard determines what files
are displayed in the file selector, and file extension supplies a type
extension for the required filename. Flags may be a combination of wxOPEN,
wxSAVE, wxOVERWRITE_PROMPT, wxHIDE_READONLY, or 0. They are only significant
at present in Windows.<P>
Both the X and Windows versions implement a wildcard filter. Typing a
filename containing wildcards (*, ?) in the filename text item, and
clicking on Ok, will result in only those files matching the pattern being
displayed. In the X version, supplying no default name will result in the
wildcard filter being inserted in the filename text item; the filter is
ignored if a default name is supplied.<P>
Under Windows (only), the wildcard may be a specification for multiple
types of file with a description for each, such as:<P>
<PRE>
 "BMP files (*.bmp) | *.bmp | GIF files (*.gif) | *.gif"
</PRE>
<B><FONT COLOR="#FF0000">Members</FONT></B><P>
<A HREF="#wxfiledialogconstr">wxFileDialog::wxFileDialog</A><BR>
<A HREF="#topic362">wxFileDialog::~wxFileDialog</A><BR>
<A HREF="#wxfiledialoggetdirectory">wxFileDialog::GetDirectory</A><BR>
<A HREF="#wxfiledialoggetfilename">wxFileDialog::GetFilename</A><BR>
<A HREF="#wxfiledialoggetfilterindex">wxFileDialog::GetFilterIndex</A><BR>
<A HREF="#wxfiledialoggetmessage">wxFileDialog::GetMessage</A><BR>
<A HREF="#wxfiledialoggetpath">wxFileDialog::GetPath</A><BR>
<A HREF="#wxfiledialoggetstyle">wxFileDialog::GetStyle</A><BR>
<A HREF="#wxfiledialoggetwildcard">wxFileDialog::GetWildcard</A><BR>
<A HREF="#wxfiledialogsetdirectory">wxFileDialog::SetDirectory</A><BR>
<A HREF="#wxfiledialogsetfilename">wxFileDialog::SetFilename</A><BR>
<A HREF="#wxfiledialogsetfilterindex">wxFileDialog::SetFilterIndex</A><BR>
<A HREF="#wxfiledialogsetmessage">wxFileDialog::SetMessage</A><BR>
<A HREF="#wxfiledialogsetpath">wxFileDialog::SetPath</A><BR>
<A HREF="#wxfiledialogsetstyle">wxFileDialog::SetStyle</A><BR>
<A HREF="#wxfiledialogsetwildcard">wxFileDialog::SetWildcard</A><BR>
<A HREF="#wxfiledialogshowmodal">wxFileDialog::ShowModal</A><BR>
<P>

<HR>
<A NAME="wxfiledialogconstr"></A>
<H3>wxFileDialog::wxFileDialog</H3>
<P>
<B></B> <B>wxFileDialog</B>(<B>wxWindow* </B><I>parent</I>, <B>const wxString&amp; </B><I>message = "Choose a file"</I>,
<B>const wxString&amp; </B><I>defaultDir = ""</I>, <B>const wxString&amp; </B><I>defaultFile = ""</I>,
<B>const wxString&amp; </B><I>wildcard = "*.*"</I>, <B>long </B><I>style = 0</I>, <B>const wxPoint&amp; </B><I>pos = wxDefaultPosition</I>)<P>
Constructor. Use <A HREF="wx90.htm#wxfiledialogshowmodal">wxFileDialog::ShowModal</A> to show the dialog.<P>
<B><FONT COLOR="#FF0000">Parameters</FONT></B><P>
<I>parent</I><UL><UL>
Parent window.</UL></UL>
<P>
<I>message</I><UL><UL>
Message to show on the dialog.</UL></UL>
<P>
<I>defaultDir</I><UL><UL>
The default directory, or the empty string.</UL></UL>
<P>
<I>defaultFile</I><UL><UL>
The default filename, or the empty string.</UL></UL>
<P>
<I>wildcard</I><UL><UL>
A wildcard, such as "*.*".</UL></UL>
<P>
<I>style</I><UL><UL>
A dialog style. A bitlist of:<P>


<TABLE>


<TR><TD VALIGN=TOP>
<B>wxOPEN</B>
</TD>

<TD VALIGN=TOP>
This is an open dialog (Windows only).
</TD></TR>


<TR><TD VALIGN=TOP>
<B>wxSAVE</B>
</TD>

<TD VALIGN=TOP>
This is a save dialog (Windows only).
</TD></TR>


<TR><TD VALIGN=TOP>
<B>wxHIDE_READONLY</B>
</TD>

<TD VALIGN=TOP>
Hide read-only files (Windows only).
</TD></TR>


<TR><TD VALIGN=TOP>
<B>wxOVERWRITE_PROMPT</B>
</TD>

<TD VALIGN=TOP>
Prompt for a conformation if a file will be overridden (Windows only).
</TD></TR>


</TABLE>
</UL></UL>
<P>
<I>pos</I><UL><UL>
Dialog position. Not implemented.</UL></UL>
<P>

<HR>
<A NAME="topic362"></A>
<H3>wxFileDialog::~wxFileDialog</H3>
<P>
<B></B> <B>~wxFileDialog</B>()<P>
Destructor.<P>

<HR>
<A NAME="wxfiledialoggetdirectory"></A>
<H3>wxFileDialog::GetDirectory</H3>
<P>
<B>wxString</B> <B>GetDirectory</B>() <B>const</B><P>
Returns the default directory.<P>

<HR>
<A NAME="wxfiledialoggetfilename"></A>
<H3>wxFileDialog::GetFilename</H3>
<P>
<B>wxString</B> <B>GetFilename</B>() <B>const</B><P>
Returns the default filename.<P>

<HR>
<A NAME="wxfiledialoggetfilterindex"></A>
<H3>wxFileDialog::GetFilterIndex</H3>
<P>
<B>int</B> <B>GetFilterIndex</B>() <B>const</B><P>
Returns the index into the list of filters supplied, optionally, in the wildcard parameter.
Before the dialog is shown, this is the index which will be used when the dialog is first displayed.
After the dialog is shown, this is the index selected by the user.<P>

<HR>
<A NAME="wxfiledialoggetmessage"></A>
<H3>wxFileDialog::GetMessage</H3>
<P>
<B>wxString</B> <B>GetMessage</B>() <B>const</B><P>
Returns the message that will be displayed on the dialog.<P>

<HR>
<A NAME="wxfiledialoggetpath"></A>
<H3>wxFileDialog::GetPath</H3>
<P>
<B>wxString</B> <B>GetPath</B>() <B>const</B><P>
Returns the full path (directory and filename) of the selected file.<P>

<HR>
<A NAME="wxfiledialoggetstyle"></A>
<H3>wxFileDialog::GetStyle</H3>
<P>
<B>long</B> <B>GetStyle</B>() <B>const</B><P>
Returns the dialog style.<P>

<HR>
<A NAME="wxfiledialoggetwildcard"></A>
<H3>wxFileDialog::GetWildcard</H3>
<P>
<B>wxString</B> <B>GetWildcard</B>() <B>const</B><P>
Returns the file dialog wildcard.<P>

<HR>
<A NAME="wxfiledialogsetdirectory"></A>
<H3>wxFileDialog::SetDirectory</H3>
<P>
<B>void</B> <B>SetDirectory</B>(<B>const wxString&amp; </B><I>directory</I>)<P>
Sets the default directory.<P>

<HR>
<A NAME="wxfiledialogsetfilename"></A>
<H3>wxFileDialog::SetFilename</H3>
<P>
<B>void</B> <B>SetFilename</B>(<B>const wxString&amp; </B><I>setfilename</I>)<P>
Sets the default filename.<P>

<HR>
<A NAME="wxfiledialogsetfilterindex"></A>
<H3>wxFileDialog::SetFilterIndex</H3>
<P>
<B>void</B> <B>SetFilterIndex</B>(<B>int </B><I>filterIndex</I>)<P>
Sets the default filter index, starting from zero. Windows only.<P>

<HR>
<A NAME="wxfiledialogsetmessage"></A>
<H3>wxFileDialog::SetMessage</H3>
<P>
<B>void</B> <B>SetMessage</B>(<B>const wxString&amp; </B><I>message</I>)<P>
Sets the message that will be displayed on the dialog.<P>

<HR>
<A NAME="wxfiledialogsetpath"></A>
<H3>wxFileDialog::SetPath</H3>
<P>
<B>void</B> <B>SetPath</B>(<B>const wxString&amp; </B><I>path</I>)<P>
Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).<P>

<HR>
<A NAME="wxfiledialogsetstyle"></A>
<H3>wxFileDialog::SetStyle</H3>
<P>
<B>void</B> <B>SetStyle</B>(<B>long </B><I>style</I>)<P>
Sets the dialog style. See <A HREF="wx90.htm#wxfiledialogconstr">wxFileDialog::wxFileDialog</A> for details.<P>

<HR>
<A NAME="wxfiledialogsetwildcard"></A>
<H3>wxFileDialog::SetWildcard</H3>
<P>
<B>void</B> <B>SetWildcard</B>(<B>const wxString&amp; </B><I>wildCard</I>)<P>
Sets the wildcard, which in Windows can contain multiple file types.<P>

<HR>
<A NAME="wxfiledialogshowmodal"></A>
<H3>wxFileDialog::ShowModal</H3>
<P>
<B>int</B> <B>ShowModal</B>()<P>
Shows the dialog, returning wxID_OK if the user pressed OK, and wxOK_CANCEL
otherwise.<P>


</BODY></HTML>