]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/filedlg.tex
1. wxGetOsDescription() function added
[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
954b8ae6
JS
12\wxheading{Include files}
13
14<wx/filedlg.h>
15
a660d684
KB
16\wxheading{See also}
17
18\helpref{wxFileDialog overview}{wxfiledialogoverview}, \helpref{wxFileSelector}{wxfileselector}
a660d684
KB
19
20\wxheading{Remarks}
21
22Pops up a file selector box. In Windows, this is the common file selector
23dialog. In X, this is a file selector box with somewhat less functionality.
24The path and filename are distinct elements of a full file pathname.
25If path is ``", the current directory will be used. If filename is ``",
26no default filename will be supplied. The wildcard determines what files
27are displayed in the file selector, and file extension supplies a type
28extension for the required filename. Flags may be a combination of wxOPEN,
7941ba11 29wxSAVE, wxOVERWRITE\_PROMPT, wxHIDE\_READONLY, wxMULTIPLE or 0.
a660d684
KB
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
330d6fd0 34displayed. The wildcard may be a specification for multiple
a660d684
KB
35types of file with a description for each, such as:
36
37\begin{verbatim}
58abfef6 38 "BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
a660d684
KB
39\end{verbatim}
40
41\latexignore{\rtfignore{\wxheading{Members}}}
42
43\membersection{wxFileDialog::wxFileDialog}\label{wxfiledialogconstr}
44
45\func{}{wxFileDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{message = "Choose a file"},\rtfsp
46\param{const wxString\& }{defaultDir = ""}, \param{const wxString\& }{defaultFile = ``"},\rtfsp
47\param{const wxString\& }{wildcard = ``*.*"}, \param{long }{style = 0}, \param{const wxPoint\& }{pos = wxDefaultPosition}}
48
49Constructor. Use \helpref{wxFileDialog::ShowModal}{wxfiledialogshowmodal} to show the dialog.
50
51\wxheading{Parameters}
52
53\docparam{parent}{Parent window.}
54
55\docparam{message}{Message to show on the dialog.}
56
57\docparam{defaultDir}{The default directory, or the empty string.}
58
59\docparam{defaultFile}{The default filename, or the empty string.}
60
61\docparam{wildcard}{A wildcard, such as ``*.*".}
62
63\docparam{style}{A dialog style. A bitlist of:
64
65\twocolwidtha{5cm}
66\begin{twocollist}
330d6fd0
RR
67\twocolitem{{\bf wxOPEN}}{This is an open dialog.}
68\twocolitem{{\bf wxSAVE}}{This is a save dialog.}
69\twocolitem{{\bf wxHIDE\_READONLY}}{Hide read-only files.}
70\twocolitem{{\bf wxOVERWRITE\_PROMPT}}{Prompt for a conformation if a file will be overridden.}
a660d684
KB
71\end{twocollist}%
72}
73
74\docparam{pos}{Dialog position. Not implemented.}
75
76\membersection{wxFileDialog::\destruct{wxFileDialog}}
77
78\func{}{\destruct{wxFileDialog}}{\void}
79
80Destructor.
81
82\membersection{wxFileDialog::GetDirectory}\label{wxfiledialoggetdirectory}
83
84\constfunc{wxString}{GetDirectory}{\void}
85
86Returns the default directory.
87
88\membersection{wxFileDialog::GetFilename}\label{wxfiledialoggetfilename}
89
90\constfunc{wxString}{GetFilename}{\void}
91
92Returns the default filename.
93
94\membersection{wxFileDialog::GetFilterIndex}\label{wxfiledialoggetfilterindex}
95
96\constfunc{int}{GetFilterIndex}{\void}
97
98Returns the index into the list of filters supplied, optionally, in the wildcard parameter.
99Before the dialog is shown, this is the index which will be used when the dialog is first displayed.
100After the dialog is shown, this is the index selected by the user.
101
102\membersection{wxFileDialog::GetMessage}\label{wxfiledialoggetmessage}
103
104\constfunc{wxString}{GetMessage}{\void}
105
106Returns the message that will be displayed on the dialog.
107
108\membersection{wxFileDialog::GetPath}\label{wxfiledialoggetpath}
109
110\constfunc{wxString}{GetPath}{\void}
111
112Returns the full path (directory and filename) of the selected file.
113
114\membersection{wxFileDialog::GetStyle}\label{wxfiledialoggetstyle}
115
116\constfunc{long}{GetStyle}{\void}
117
118Returns the dialog style.
119
120\membersection{wxFileDialog::GetWildcard}\label{wxfiledialoggetwildcard}
121
122\constfunc{wxString}{GetWildcard}{\void}
123
124Returns the file dialog wildcard.
125
126\membersection{wxFileDialog::SetDirectory}\label{wxfiledialogsetdirectory}
127
128\func{void}{SetDirectory}{\param{const wxString\& }{directory}}
129
130Sets the default directory.
131
132\membersection{wxFileDialog::SetFilename}\label{wxfiledialogsetfilename}
133
134\func{void}{SetFilename}{\param{const wxString\& }{setfilename}}
135
136Sets the default filename.
137
138\membersection{wxFileDialog::SetFilterIndex}\label{wxfiledialogsetfilterindex}
139
140\func{void}{SetFilterIndex}{\param{int }{filterIndex}}
141
142Sets the default filter index, starting from zero. Windows only.
143
144\membersection{wxFileDialog::SetMessage}\label{wxfiledialogsetmessage}
145
146\func{void}{SetMessage}{\param{const wxString\& }{message}}
147
148Sets the message that will be displayed on the dialog.
149
150\membersection{wxFileDialog::SetPath}\label{wxfiledialogsetpath}
151
152\func{void}{SetPath}{\param{const wxString\& }{path}}
153
154Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).
155
156\membersection{wxFileDialog::SetStyle}\label{wxfiledialogsetstyle}
157
158\func{void}{SetStyle}{\param{long }{style}}
159
160Sets the dialog style. See \helpref{wxFileDialog::wxFileDialog}{wxfiledialogconstr} for details.
161
162\membersection{wxFileDialog::SetWildcard}\label{wxfiledialogsetwildcard}
163
164\func{void}{SetWildcard}{\param{const wxString\& }{wildCard}}
165
166Sets the wildcard, which in Windows can contain multiple file types.
167
168\membersection{wxFileDialog::ShowModal}\label{wxfiledialogshowmodal}
169
170\func{int}{ShowModal}{\void}
171
172Shows the dialog, returning wxID\_OK if the user pressed OK, and wxOK\_CANCEL
173otherwise.
174
175