tsc_FileOpenDialog

It is a class used to show the file open dialog for selecting files or selecting a folder.  It returns the name(s) of the selected files or folder, and supports multi-files selection.

Enumeration

enum tsc_FileOpenDialogType
{
    tsc_FileOpenDialogTypeSelectSingleFile = 0, // Allows the user to select a single file.
    tsc_FileOpenDialogTypeSelectMultiFile,      // Allows the user to select multiple files.
    tsc_FileOpenDialogTypeSelectFolder,         // Allows the user to select a folder.
    tsc_FileOpenDialogTypeSelectOrCreateFile,   // Allows the user to select a file or create an empty file for selection.
};

Static Method

static tsc_StringList Show (
            tsc_FileOpenDialogType type,
            const char* title = NULL,
            const char* filters = NULL,
            const char* rootDir = NULL,
            const char* defaultDir = NULL);

Displays a full-screen file open dialog.

It returns a tsc_StringList of the selected files or folder. Each string contains a full absolute path name. If nothing is selected, the string list is empty.

If title is NULL, a default title will be used; X_SelectFile for file and X_SelectFolder for folder.

If filters is NULL, all file types will be shown.

The format of the filters string is: "ext1a[,description];ext2a[,description] ..."

Some examples:

  *.txt,Text file
  *.txt
  *.txt,Text file;*.jpg;*.png;*.bmp

rootDir is the outermost directory to which the user can navigate. If the rootDir is NULL, the project folder $(ProjectRootDir) will be used.

defaultDir is the initial directory shown. If it is NULL, the project folder $(ProjectRootDir) will be used.

Note: If defaultDir is not within rootDir, then defaultDir is ignored and rootDir is displayed.