DESCRIPTION

The module contains widgets for file and drive selection, and also standard open file, save file, and change directory dialogs.

Prima::DirectoryListBox

A directory listing list box. Shows the list of subdirectories and upper directories, hierarchy-mapped, with the folder images and outlines.

Properties

closedGlyphs INTEGER

Number of horizontal equal-width images, contained in closedIcon property.

Default value: 1

closedIcon ICON

Provides an icon representation for the directories, contained in the current directory.

indent INTEGER

A positive integer number of pixels, used for offset of the hierarchy outline.

Default value: 12

openedGlyphs INTEGER

Number of horizontal equal-width images, contained in openedIcon property.

Default value: 1

openedIcon OBJECT

Provides an icon representation for the directories, contained in the directories above the current directory.

path STRING

Runtime-only property. Selects a file system path.

showDotDirs BOOLEAN

Selects if the directories with the first dot character are shown the view. The treatment of the dot-prefixed names as hidden is traditional to unix, and is of doubtful use under win32.

Default value: 1

Methods

files [ FILE_TYPE ]

If FILE_TYPE value is not specified, the list of all files in the current directory is returned. If FILE_TYPE is given, only the files of the types are returned. The FILE_TYPE is a string, one of those returned by Prima::Utils::getdir ( see "getdir" in Prima::Utils.

Prima::DriveComboBox

Provides drive selection combo-box for non-unix systems.

Properties

firstDrive DRIVE_LETTER

Create-only property.

Default value: 'A:'

DRIVE_LETTER can be set to other value to start the drive enumeration from. Some OSes can probe eventual diskette drives inside the drive enumeration routines, so it might be reasonable to set DRIVE_LETTER to C: string for responsiveness increase.

drive DRIVE_LETTER

Selects the drive letter.

Default value: 'C:'

Prima::FileDialog

Provides a standard file dialog, allowing to navigate by the file system and select one or many files. The class can operate in two modes - 'open' and 'save'; these modes are set by Prima::OpenDialog and Prima::SaveDialog. Some properties behave differently depending on the mode, which is stored in openMode property.

Properties

createPrompt BOOLEAN

If 1, and a file selected is nonexistent, asks the user if the file is to be created.

Selects the file extension, appended to the file name typed by the user, if the extension is not given.

Default value: ''

directory STRING

Selects the currently selected directory.

fileMustExist BOOLEAN

If 1, ensures that the file typed by the user exists before closing the dialog.

Default value: 1

fileName STRING, ...

For single-file selection, assigns the selected file name, For multiple-file selection, on get-call returns list of the selected files; on set-call, accepts a single string, where the file names are separated by the space character. The eventual space characters must be quoted.

filter ARRAY

Contains array of arrays of string pairs, where each pair describes a file type. The first scalar in the pair is the description of the type; the second is a file mask.

Default value: [[ 'All files' => '*']]

filterIndex INTEGER

Selects the index in filter array of the currently selected file type.