NAME

TUI::StdDlg::FileList - list box view for file and directory entries

HIERARCHY

TObject
  TView
    TGroup
      TListBox
        TSortedListBox
          TFileList

SYNOPSIS

use TUI::StdDlg;

my $list = new_TFileList(
  $bounds,
  $scrollBar
);

DESCRIPTION

TFileList implements a specialized list box used by standard Turbo Vision file dialogs to display directory contents.

The list presents files and directories obtained from a TFileCollection instance and supports keyboard and mouse navigation, selection, and activation of entries.

This class extends TListBox with file-specific behavior and integrates tightly with other standard dialog components.

TFileList is typically managed by TFileDialog and not used directly by application code.

The list view relies on TFileCollection for sorting and filtering file entries and reflects changes immediately when a new collection is assigned.

This class extends the generic list box behavior with file-specific logic such as directory scanning, filename display formatting, and hotkey extraction.

VARIABLES

The following global variable defines the error message used by TFileList.

$tooManyFiles

Message text displayed when the number of files exceeds the supported limit.

CONSTRUCTOR

new

my $list = TFileList->new(
  bounds     => $bounds,
  vScrollBar => $scrollBar | undef
);

Creates a new file list view.

bounds

Bounding rectangle defining the position and size of the list box (TRect).

vScrollBar

Optional vertical scroll bar associated with the list box (TScrollBar).

new_TFileList

my $list = new_TFileList($bounds, $scrollBar | undef);

Factory-style constructor using positional arguments.

METHODS

dataSize

my $size = $list->dataSize();

Returns the number of scalar values transferred via getData and setData.

For file lists, this value is always 1.

focusItem

$list->focusItem($index);

Moves the focus to the specified item index.

getData

$list->getData(\@record);

Stores the current selection state into the supplied record.

getKey

my $key = $list->getKey($string);

Extracts and returns the hotkey associated with a file list entry.

getText

$list->getText(\$dest, $item, $maxChars);

Retrieves the display text for the specified list item.

list

my $collection = $list->list();

Returns the TFileCollection currently backing the list.

newList

$list->newList($collection);

Assigns a new file collection to the list and refreshes its contents.

readDirectory

$list->readDirectory($dir | undef, $wildCard | undef);

Reads the contents of the specified directory and populates the file list.

If no directory is specified, the current working directory is used.

selectItem

$list->selectItem($index);

Selects the specified item index.

setData

$list->setData(\@record);

Restores the selection state from external input.

SEE ALSO

TUI::StdDlg::FileDialog, TUI::StdDlg::FileCollection, TUI::Views::ListBox, TUI::Views::ScrollBar

AUTHORS

Borland International (original Turbo Vision design)
J. Schneider <brickpool@cpan.org> (Perl implementation and maintenance)

COPYRIGHT AND LICENSE

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

Copyright (c) 2021-2026 the "AUTHORS" as listed above.

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