NAME

TUI::StdDlg::DirListBox - list box view for directory entries

HIERARCHY

TObject
  TView
    TGroup
      TListBox
        TDirListBox

SYNOPSIS

use TUI::StdDlg;

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

DESCRIPTION

TDirListBox implements a specialized list box used by standard Turbo Vision dialogs to display and navigate directory entries.

The list box presents directory items backed by a TDirCollection and operates on directory entry records of type TDirEntry. It supports keyboard and mouse navigation, selection, and directory changes.

This view is primarily used by TChDirDialog.

VARIABLES

The following global variables define the visual layout and labels used by TDirListBox.

$pathDir

Defines the character sequence used to display the path directory prefix. The default value uses CP437 line-drawing characters.

$firstDir

Defines the characters used to display the first directory entry in a directory tree (CP437).

$middleDir

Defines the characters used for intermediate directory entries in the directory tree (CP437).

$lastDir

Defines the characters used for the last directory entry in the directory tree (CP437).

$drives

Label text used for the drives list.

$graphics

Defines additional line-drawing characters used for directory tree rendering (CP437).

CONSTRUCTOR

new

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

Creates a new directory list box.

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_TDirListBox

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

Factory-style constructor using positional arguments.

METHODS

The following methods operate on directory entry objects (TDirEntry).

getText

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

Retrieves the display text for the specified directory entry.

isSelected

my $bool = $list->isSelected($item);

Returns true if the specified directory entry is currently selected.

list

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

Returns the directory collection backing this list box (TDirCollection).

newDirectory

$list->newDirectory($path);

Updates the list box to display the contents of the specified directory.

selectItem

$list->selectItem($item);

Selects the specified directory entry.

setState

$list->setState($state, $enable);

Updates the list box state and refreshes the display if necessary.

SEE ALSO

TUI::StdDlg::ChDirDialog, TUI::StdDlg::DirCollection, TUI::StdDlg::DirEntry, TUI::Views::ListBox

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) 2026 the "AUTHORS" as listed above.

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