Prima::FileDialog - File system related widgets and dialogs.
# open a file use Prima qw(Application); use Prima::StdDlg;
my $open = Prima::OpenDialog-> new( filter => [ ['Perl modules' => '*.pm'], ['All' => '*'] ] ); print $open-> fileName, " is to be opened\n" if $open-> execute; # save a file my $save = Prima::SaveDialog-> new( fileName => $open-> fileName, ); print $save-> fileName, " is to be saved\n" if $save-> execute; # open several files $open-> multiSelect(1); print $open-> fileName, " are to be opened\n" if $open-> execute;
The module contains widgets for file and drive selection, and also standard open file, save file, and change directory dialogs.
A directory listing list box. Shows the list of subdirectories and upper directories, hierarchy-mapped, with the folder images and outlines.
Number of horizontal equal-width images, contained in closedIcon property.
Default value: 1
Provides an icon representation for the directories, contained in the current directory.
A positive integer number of pixels, used for offset of the hierarchy outline.
Default value: 12
Number of horizontal equal-width images, contained in openedIcon property.
Provides an icon representation for the directories, contained in the directories above the current directory.
Runtime-only property. Selects a file system path.
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 and os2.
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::Utils::getdir
Provides drive selection combo-box for non-unix systems.
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.
C:
Selects the drive letter.
Default value: 'C:'
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.
If 1, and a file selected is nonexistent, asks the user if the file is to be created.
Only actual when openMode is 1.
Default value: 0
Selects the file extension, appended to the file name typed by the user, if the extension is not given.
Default value: ''
Selects the currently selected directory.
If 1, ensures that the file typed by the user exists before closing the dialog.
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.
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' => '*']]
Selects the index in filter array of the currently selected file type.
Selects whether the user can select several ( 1 ) or one ( 0 ) file.
See also: fileName.
If 1, fails to open a file when it is read-only.
Only actual when openMode is 0.
If 0, tests if a file selected can be created.
If 1, asks the user if the file selected is to be overwrittten.
Selects whether the dialog operates in 'open' ( 1 ) mode or 'save' ( 0 ) mode.
If 1, ensures that the path, types by the user, exists before closing the dialog.
Selects if the directories with the first dot character are shown the files view.
Create-only property. If 1, 'Help' button is inserted in the dialog.
Selects whether the file list appears sorted by name ( 1 ) or not ( 0 ).
Default value : 1
Create-only property. If set to 1, Prima::FileDialog returns instance of Prima::sys::XXX::FileDialog system-specific file dialog, if available for the XXX platform.
Prima::FileDialog
Prima::sys::XXX::FileDialog
system knows only how to map FileDialog, OpenDialog, and SaveDialog classes onto the system-specific file dialog classes; the inherited classes are not affected.
system
FileDialog
OpenDialog
SaveDialog
Re-reads the currently selected directory.
Descendant of Prima::FileDialog, tuned for open-dialog functionality.
Descendant of Prima::FileDialog, tuned for save-dialog functionality.
Provides standard dialog with interactive directory selection.
Selects the directory
Selects if the directories with the first dot character are shown the view.
Dmitry Karasik, <dmitry@karasik.eu.org>.
Prima, Prima::Window, Prima::Lists, examples/drivecombo.pl, examples/launch.pl.
To install Prima, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Prima
CPAN shell
perl -MCPAN -e shell install Prima
For more information on module installation, please visit the detailed CPAN module installation guide.