SIMPOL Documentation

wxfiledialog()

Description

Displays a dialog (normally an OS common dialog) to allow the selection or the entering of a file name. The same function is used for both files being selected for opening as well as for saving. The behavior of the dialog is dependent on the values passed.

Prototype

wxfiledialog ( type(wxdialogparent) parent, string message, string defaultdirectory, string defaultfilename, string wildcard, string style, string filename, string result )

Parameters

ParameterDefault valueType nameDescription
parent.nultype(wxdialogparent) Gives the parent of the common dialog, if any.
message""string The text shown in the title bar of the common dialog.
defaultdirectory""string

The directory in which the dialog first starts. If this is "" then where it will start is dependent on the operating system. On Windows 2000, XP and later:

  1. If the defaultfilename parameter contains a path, then that path will be the starting directory.

  2. Otherwise if the defaultdirectory parameter contains a path, then that path will be the starting directory.

  3. If neither is specified and the application (in this case the program used to run the SIMPOL program) has been run in the past and used this function before, then the most recently used path will be the starting directory (if much time has passed, then the path may have been discarded).

  4. If the defaultdirectory parameter is empty and the current directory contains any files matching any of the types specified in the wildcard parameter, then the starting directory is the current directory.

  5. Otherwise the starting directory will be the personal files directory (if defined) of the current user.

  6. Otherwise the starting directory will be the desktop folder of the current user.

On Windows 98 and Me:

  1. If the defaultdirectory parameter contains a path, then that path will be the starting directory.

  2. If the defaultdirectory is empty and the defaultfilename parameter contains a path, then that path will be the starting directory.

  3. Otherwise if the current directory contains any files matching any of the types specified in the wildcard parameter, then the starting directory is the current directory.

  4. Otherwise the starting directory will be the personal files directory of the current user.

On earlier versions of Windows and Windows NT:

  1. If the defaultdirectory parameter contains a path, then that path will be the starting directory.

  2. If the defaultdirectory is empty and the defaultfilename parameter contains a path, then that path will be the starting directory.

  3. Otherwise the current directory is the starting directory.

defaultfilename""string The default value that will be shown for the file name.
wildcard""string This allows the showing of various categories of files, such as *.sma. The wildcard may be a specification for multiple types of file with a description for each, such as: "BMP and GIF files (*.bmp;*.gif)|*.bmp;*.gif|PNG files (*.png)|*.png".
styleopen,mustexiststring This is a comma delimited list of one of either open or save and any of: mustexist,overwriteprompt,multiple. Commonly open is associated with mustexist and save with overwriteprompt but there are cases that are exceptions.
filename.nulstring The selected file name(s) will be returned in the string object passed as this parameter. It must be an existing (preinitialized) object. If using the multiple style and multiple names are selected, the fully-qualified path and file names will be returned in a character "{0}" delimited string, i.e. "foo.txt{0}foobar.txt{0}foobar2.txt" where the string "{0}" represents the single character with the value 0.
result.nulstring The result (either "ok" or "cancel") will be returned in the string object passed as this parameter. It must be an existing (preinitialized) object.