NAME

TUI::StdDlg::FileDialog - common file selection dialog

HIERARCHY

TObject
  TView
    TGroup
      TWindow
        TDialog
          TFileDialog

SYNOPSIS

use TUI::StdDlg;
use TUI::MsgBox;

my @fileName = ('*.*');

my $dialog = TFileDialog->new(
  wildCard  => $fileName[0],
  title     => 'Open File',
  inputName => '~F~ile Name',
  options   => fdOpenButton,
  histId    => 1,
);

if ( $application->executeDialog($dialog, \@fileName) != cmCancel ) {
  messageBox( "'$fileName[0]' was entered", mfOkButton );
}

DESCRIPTION

TFileDialog implements the standard TUI::Vision file dialog used for opening, replacing, or selecting files.

The dialog combines several specialized views, including a file list, an input line for file names, and an information pane displaying details about the currently focused file. It manages directory navigation, wildcard filtering, and user interaction through keyboard and mouse input.

VARIABLES

The following global variables define the default labels and messages used by TFileDialog.

$filesText

Label text for the files list section.

$openText

Label text for the open action.

$okText

Label text for the confirmation button.

$replaceText

Label text for the replace action.

$clearText

Label text for the clear action.

$cancelText

Label text for the cancel action.

$helpText

Label text for the help command.

$invalidDriveText

Message text displayed for an invalid drive or directory.

$invalidFileText

Message text displayed for an invalid file name.

ATTRIBUTES

The following attributes are part of the public dialog state and may be queried or updated during dialog execution.

fileName

The currently selected file name (Str).

fileList

Reference to the file list view used by the dialog (TFileList).

wildCard

Current wildcard filter applied to the file list (Str).

directory

Current directory shown by the dialog (Str).

CONSTRUCTOR

new

my $dlg = TFileDialog->new(
  wildCard  => $wildCard,
  title     => $title,
  inputName => $inputName,
  options   => $options,
  histId    => $histId
);

Creates a new file dialog.

wildCard

Wildcard pattern used to filter displayed files (Str).

title

Dialog window title (Str).

inputName

Initial file name shown in the input line (Str).

options

Dialog option flags controlling behavior and appearance (Int).

histId

History identifier used for filename input history (Int).

new_TFileDialog

my $dlg = new_TFileDialog(
  $wildCard,
  $title,
  $inputName,
  $options,
  $histId
);

Factory-style constructor using positional arguments.

METHODS

getData

$dlg->getData(\@record);

Stores the dialog result into the supplied record.

getFileName

my $name = $dlg->getFileName($string);

Returns the selected file name.

handleEvent

$dlg->handleEvent($event);

Processes keyboard and command events for dialog interaction.

setData

$dlg->setData(\@record);

Restores dialog state from external input.

shutDown

$dlg->shutDown();

Releases dialog resources during shutdown.

valid

my $bool = $dlg->valid($command);

Checks whether the dialog should accept the specified command.

SEE ALSO

TUI::StdDlg::FileList, TUI::StdDlg::FileInputLine, TUI::StdDlg::FileInfoPane, TUI::Dialogs::Dialog

AUTHORS

  • Borland International (original Turbo Vision design)

  • J. Schneider <brickpool@cpan.org> (Perl implementation and maintenance)

CONTRIBUTORS

  • Eric Woodruff

COPYRIGHT AND LICENSE

Copyright (c) 1990-1994, 1997 by Borland International

Copyright (c) 1995, 2026 the "AUTHORS" and "CONTRIBUTORS" as listed above.

This software is licensed under the MIT license (see the LICENSE file, which is part of the distribution).