CFileDlg Class Description


The CFileDlg class provides an interface for using the standard Open and Save file dialogs. Various properties can be configured, including user-defined title, "file type" filter, and other properties. The Open dialog can select multiple files and the class provides methods for iterating through the list of returned file names. The Open and Save dialogs do not open and save files; rather, they allow you to select file names that may be used for opening and saving files.

Usage

Construction

Object = CFileDlg:new()

Destruction

Object:delete()

Data Members

Several class properties (data members) are available for customizing the Open and Save dialogs. These dialogs can be used with default settings. Alternatively, to customize them, each property must be "unlocked" by setting a property flag to true. By default, the new constructor sets all property flags to false so that default values will be used. Set the property flags between the point of using new and either Open or Save.

Values Set before Calling the Open or Save Methods

bSetOpenTitle

Set true to specify the title for the Open dialog. You also can set the title simply by passing the title as the parameter of the Open method.

sOpenTitle

Specify the title used for the Open dialog.

bSetSaveTitle

Set true to specify the title for the Save dialog.

sSaveTitle

Specify the title used for the Save dialog.

bSetFilterList

Set true to specify the list of file filters.

sFilterList

Specify the filter list. See description under the Open method.

bSetFilterIndex

Set true to specify the starting index in the list of file filters.

nFilterIndex

The filter index to be selected when the dialog opens, starting at 1.

bSetMaxFiles

Set true to specify the maximum number of file names to return.

nMaxFiles

The maximum number of files to select. The default value is 1.

bSetUseImageSet

Set true to check the "Use Image Set" option in the Open dialog.

bUseImageSet

Sets the value of the "Use Image Set" option to true or false in the Open dialog.

bSetFlipFitsFiles

Set true to check the "Flip FITS Files" option in the Open dialog.

bFlipFitsFiles

Sets the value of the "Flip FITS Files" option to true or false in the Open dialog.

Values Returned by the Open and Save Methods

bUseImageSet

The value of the "Use Image Set" option selected in the Open dialog.

bFlipFitsFiles

The value of the "Flip FITS Files" option selected in the Open dialog.

sExt

The file extension selected in the Open or Save dialog. If more than 1 file is selected, this string is empty.

nFilterIndex

The index of the file extension in the Filter List that was selected in the Open or Save dialog.

sFileName

If 1 file is selected, this is the name of the file that was selected. If more than 1 file is selected, this specifies the path to the selected files.

Methods

Construction

new

Creates a new instance of a CFileDlg object.

delete

Deletes the instance of the CFileDlg object.

Operations

Open

Creates an Open dialog for selecting file names.

Save

Creates a Save dialog for selecting file names.

Start

Initializes the list of file names that were selected. Use Next to select each file in turn.

Next

Selected the next file in the internal list of files that were selected. Returns nil when the end of the list is reached.

Related Topics

CFindFiles class, GetFileName, GetFolder