1998-05-20 10:25:30 -04:00
|
|
|
\section{\class{wxFileDialog}}\label{wxfiledialog}
|
|
|
|
|
|
|
|
This class represents the file chooser dialog.
|
|
|
|
|
|
|
|
\wxheading{Derived from}
|
|
|
|
|
|
|
|
\helpref{wxDialog}{wxdialog}\\
|
|
|
|
\helpref{wxWindow}{wxwindow}\\
|
|
|
|
\helpref{wxEvtHandler}{wxevthandler}\\
|
|
|
|
\helpref{wxObject}{wxobject}
|
|
|
|
|
1999-02-15 15:41:29 -05:00
|
|
|
\wxheading{Include files}
|
|
|
|
|
|
|
|
<wx/filedlg.h>
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\wxheading{See also}
|
|
|
|
|
|
|
|
\helpref{wxFileDialog overview}{wxfiledialogoverview}, \helpref{wxFileSelector}{wxfileselector}
|
|
|
|
|
|
|
|
\wxheading{Remarks}
|
|
|
|
|
|
|
|
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,
|
2004-06-02 12:24:58 -04:00
|
|
|
wxSAVE, wxOVERWRITE\_PROMPT, wxFILE\_MUST\_EXIST, wxMULTIPLE or 0.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
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
|
1999-11-04 12:49:21 -05:00
|
|
|
displayed. The wildcard may be a specification for multiple
|
1998-05-20 10:25:30 -04:00
|
|
|
types of file with a description for each, such as:
|
|
|
|
|
|
|
|
\begin{verbatim}
|
2004-11-06 20:11:42 -05:00
|
|
|
"BMP and GIF files (*.bmp;*.gif)|*.bmp;*.gif|PNG files (*.png)|*.png"
|
1998-05-20 10:25:30 -04:00
|
|
|
\end{verbatim}
|
|
|
|
|
2003-01-11 09:36:25 -05:00
|
|
|
It must be noted that wildcard support in the native Motif file
|
|
|
|
dialog is quite limited: only one alternative is supported,
|
|
|
|
and it is displayed without the descriptive test; ``BMP files (*.bmp)|*.bmp''
|
|
|
|
is displayed as ``*.bmp'', and both
|
|
|
|
``BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif'' and
|
|
|
|
``Image files|*.bmp;*.gif'' are errors.
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\latexignore{\rtfignore{\wxheading{Members}}}
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxFileDialog::wxFileDialog}\label{wxfiledialogctor}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{}{wxFileDialog}{\param{wxWindow* }{parent}, \param{const wxString\& }{message = "Choose a file"},\rtfsp
|
|
|
|
\param{const wxString\& }{defaultDir = ""}, \param{const wxString\& }{defaultFile = ``"},\rtfsp
|
|
|
|
\param{const wxString\& }{wildcard = ``*.*"}, \param{long }{style = 0}, \param{const wxPoint\& }{pos = wxDefaultPosition}}
|
|
|
|
|
|
|
|
Constructor. Use \helpref{wxFileDialog::ShowModal}{wxfiledialogshowmodal} to show the dialog.
|
|
|
|
|
|
|
|
\wxheading{Parameters}
|
|
|
|
|
|
|
|
\docparam{parent}{Parent window.}
|
|
|
|
|
|
|
|
\docparam{message}{Message to show on the dialog.}
|
|
|
|
|
|
|
|
\docparam{defaultDir}{The default directory, or the empty string.}
|
|
|
|
|
|
|
|
\docparam{defaultFile}{The default filename, or the empty string.}
|
|
|
|
|
2003-01-11 09:36:25 -05:00
|
|
|
\docparam{wildcard}{A wildcard, such as ``*.*" or ``BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif".
|
|
|
|
|
|
|
|
Note that the native Motif dialog has some limitations with respect to
|
|
|
|
wildcards; see the Remarks section above.}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\docparam{style}{A dialog style. A bitlist of:
|
|
|
|
|
|
|
|
\twocolwidtha{5cm}
|
|
|
|
\begin{twocollist}
|
1999-11-04 12:49:21 -05:00
|
|
|
\twocolitem{{\bf wxOPEN}}{This is an open dialog.}
|
|
|
|
\twocolitem{{\bf wxSAVE}}{This is a save dialog.}
|
2001-01-13 09:32:03 -05:00
|
|
|
\twocolitem{{\bf wxOVERWRITE\_PROMPT}}{For save dialog only: prompt for a confirmation if a file will be overwritten.}
|
2000-10-08 19:35:09 -04:00
|
|
|
\twocolitem{{\bf wxMULTIPLE}}{For open dialog only: allows selecting multiple files.}
|
2002-01-18 10:47:05 -05:00
|
|
|
\twocolitem{{\bf wxCHANGE\_DIR}}{Change the current working directory to the directory where the file(s) chosen by the user are.}
|
1998-05-20 10:25:30 -04:00
|
|
|
\end{twocollist}%
|
|
|
|
}
|
|
|
|
|
|
|
|
\docparam{pos}{Dialog position. Not implemented.}
|
|
|
|
|
2004-05-04 04:27:20 -04:00
|
|
|
{\bf NB:} Previous versions of wxWidgets used {\tt wxCHANGE\_DIR} by default
|
2000-10-08 19:35:09 -04:00
|
|
|
under MS Windows which allowed the program to simply remember the last
|
|
|
|
directory where user selected the files to open/save. This (desired)
|
|
|
|
functionality must be implemented in the program itself now (manually remember
|
|
|
|
the last path used and pass it to the dialog the next time it is called) or
|
|
|
|
by using this flag.
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
\membersection{wxFileDialog::\destruct{wxFileDialog}}\label{wxfiledialogdtor}
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\func{}{\destruct{wxFileDialog}}{\void}
|
|
|
|
|
|
|
|
Destructor.
|
|
|
|
|
|
|
|
\membersection{wxFileDialog::GetDirectory}\label{wxfiledialoggetdirectory}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetDirectory}{\void}
|
|
|
|
|
|
|
|
Returns the default directory.
|
|
|
|
|
|
|
|
\membersection{wxFileDialog::GetFilename}\label{wxfiledialoggetfilename}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetFilename}{\void}
|
|
|
|
|
|
|
|
Returns the default filename.
|
|
|
|
|
1999-12-06 19:48:45 -05:00
|
|
|
\membersection{wxFileDialog::GetFilenames}\label{wxfiledialoggetfilenames}
|
|
|
|
|
|
|
|
\constfunc{void}{GetFilenames}{\param{wxArrayString\& }{filenames}}
|
|
|
|
|
|
|
|
Fills the array {\it filenames} with the names of the files chosen. This
|
|
|
|
function should only be used with the dialogs which have {\tt wxMULTIPLE} style,
|
|
|
|
use \helpref{GetFilename}{wxfiledialoggetfilename} for the others.
|
2003-05-18 05:20:42 -04:00
|
|
|
|
|
|
|
Note that under Windows, if the user selects shortcuts, the filenames
|
|
|
|
include paths, since the application cannot determine the full path
|
|
|
|
of each referenced file by appending the directory containing the shortcuts
|
|
|
|
to the filename.
|
1999-12-06 19:48:45 -05:00
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxFileDialog::GetFilterIndex}\label{wxfiledialoggetfilterindex}
|
|
|
|
|
|
|
|
\constfunc{int}{GetFilterIndex}{\void}
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
\membersection{wxFileDialog::GetMessage}\label{wxfiledialoggetmessage}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetMessage}{\void}
|
|
|
|
|
|
|
|
Returns the message that will be displayed on the dialog.
|
|
|
|
|
|
|
|
\membersection{wxFileDialog::GetPath}\label{wxfiledialoggetpath}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetPath}{\void}
|
|
|
|
|
|
|
|
Returns the full path (directory and filename) of the selected file.
|
|
|
|
|
1999-12-06 19:48:45 -05:00
|
|
|
\membersection{wxFileDialog::GetPaths}\label{wxfiledialoggetpaths}
|
|
|
|
|
|
|
|
\constfunc{void}{GetPaths}{\param{wxArrayString\& }{paths}}
|
|
|
|
|
|
|
|
Fills the array {\it paths} with the full paths of the files chosen. This
|
|
|
|
function should only be used with the dialogs which have {\tt wxMULTIPLE} style,
|
|
|
|
use \helpref{GetPath}{wxfiledialoggetpath} for the others.
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxFileDialog::GetStyle}\label{wxfiledialoggetstyle}
|
|
|
|
|
|
|
|
\constfunc{long}{GetStyle}{\void}
|
|
|
|
|
|
|
|
Returns the dialog style.
|
|
|
|
|
|
|
|
\membersection{wxFileDialog::GetWildcard}\label{wxfiledialoggetwildcard}
|
|
|
|
|
|
|
|
\constfunc{wxString}{GetWildcard}{\void}
|
|
|
|
|
|
|
|
Returns the file dialog wildcard.
|
|
|
|
|
|
|
|
\membersection{wxFileDialog::SetDirectory}\label{wxfiledialogsetdirectory}
|
|
|
|
|
|
|
|
\func{void}{SetDirectory}{\param{const wxString\& }{directory}}
|
|
|
|
|
|
|
|
Sets the default directory.
|
|
|
|
|
|
|
|
\membersection{wxFileDialog::SetFilename}\label{wxfiledialogsetfilename}
|
|
|
|
|
|
|
|
\func{void}{SetFilename}{\param{const wxString\& }{setfilename}}
|
|
|
|
|
|
|
|
Sets the default filename.
|
|
|
|
|
|
|
|
\membersection{wxFileDialog::SetFilterIndex}\label{wxfiledialogsetfilterindex}
|
|
|
|
|
|
|
|
\func{void}{SetFilterIndex}{\param{int }{filterIndex}}
|
|
|
|
|
2002-12-04 09:11:26 -05:00
|
|
|
Sets the default filter index, starting from zero.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxFileDialog::SetMessage}\label{wxfiledialogsetmessage}
|
|
|
|
|
|
|
|
\func{void}{SetMessage}{\param{const wxString\& }{message}}
|
|
|
|
|
|
|
|
Sets the message that will be displayed on the dialog.
|
|
|
|
|
|
|
|
\membersection{wxFileDialog::SetPath}\label{wxfiledialogsetpath}
|
|
|
|
|
|
|
|
\func{void}{SetPath}{\param{const wxString\& }{path}}
|
|
|
|
|
|
|
|
Sets the path (the combined directory and filename that will be returned when the dialog is dismissed).
|
|
|
|
|
|
|
|
\membersection{wxFileDialog::SetStyle}\label{wxfiledialogsetstyle}
|
|
|
|
|
|
|
|
\func{void}{SetStyle}{\param{long }{style}}
|
|
|
|
|
2004-09-30 07:15:59 -04:00
|
|
|
Sets the dialog style. See \helpref{wxFileDialog::wxFileDialog}{wxfiledialogctor} for details.
|
1998-05-20 10:25:30 -04:00
|
|
|
|
|
|
|
\membersection{wxFileDialog::SetWildcard}\label{wxfiledialogsetwildcard}
|
|
|
|
|
|
|
|
\func{void}{SetWildcard}{\param{const wxString\& }{wildCard}}
|
|
|
|
|
2001-04-25 07:06:38 -04:00
|
|
|
Sets the wildcard, which can contain multiple file types, for example:
|
|
|
|
|
|
|
|
``BMP files (*.bmp)|*.bmp|GIF files (*.gif)|*.gif"
|
1998-05-20 10:25:30 -04:00
|
|
|
|
2003-01-11 09:36:25 -05:00
|
|
|
Note that the native Motif dialog has some limitations with respect to
|
|
|
|
wildcards; see the Remarks section above.
|
|
|
|
|
1998-05-20 10:25:30 -04:00
|
|
|
\membersection{wxFileDialog::ShowModal}\label{wxfiledialogshowmodal}
|
|
|
|
|
|
|
|
\func{int}{ShowModal}{\void}
|
|
|
|
|
2000-07-15 15:51:35 -04:00
|
|
|
Shows the dialog, returning wxID\_OK if the user pressed OK, and wxID\_CANCEL
|
1998-05-20 10:25:30 -04:00
|
|
|
otherwise.
|
|
|
|
|
|
|
|
|