NAME
TUI::Dialogs::HistoryViewer - list viewer for dialog input history
HIERARCHY
TObject
TView
TListViewer
THistoryViewer
SYNOPSIS
use TUI::Dialogs;
my $viewer = TUI::Dialogs::HistoryViewer->new(
bounds => $bounds,
hScrollBar => $hBar,
vScrollBar => $vBar,
historyId => 1
);
DESCRIPTION
THistoryViewer implements the list viewer used to display input history entries managed by THistory. It is responsible for presenting the stored history values in a scrollable list and handling user interaction with that list.
The history viewer is normally created indirectly by a THistory object when the history control is activated. Application code rarely needs to instantiate or interact with THistoryViewer directly.
The viewer displays the history entries associated with a specific history identifier. Input fields that share the same history ID also share the same history list.
ATTRIBUTES
The following attributes are managed internally and exposed as read-only accessors.
historyId
Numeric identifier selecting which history list is displayed (PositiveOrZeroInt).
CONSTRUCTOR
new
my $viewer = THistoryViewer->new(
bounds => $bounds,
hScrollBar => $hScrollBar,
vScrollBar => $vScrollBar,
historyId => $historyId
);
Creates a new history viewer for displaying a specific history list.
- bounds
-
Bounding rectangle of the list viewer (TRect).
- hScrollBar
-
Horizontal scroll bar associated with the viewer (TScrollBar).
- vScrollBar
-
Vertical scroll bar associated with the viewer (TScrollBar).
- historyId
-
Numeric identifier of the history list to display.
new_THistoryViewer
my $viewer = new_THistoryViewer(
$bounds,
$hScrollBar,
$vScrollBar,
$historyId
);
Factory-style constructor using positional arguments.
This constructor is equivalent to calling new with named parameters and is provided for compatibility with traditional Turbo Vision construction patterns.
METHODS
getPalette
my $palette = $viewer->getPalette();
Returns the color palette used to draw the history viewer.
getText
$viewer->getText(\$dest, $item, $maxChars);
Retrieves the history entry at the specified index and writes it into $dest. The returned string is truncated to at most $maxChars characters.
handleEvent
$viewer->handleEvent($event);
Handles mouse and keyboard events directed at the history viewer.
historyWidth
my $width = $viewer->historyWidth();
Returns the width of the longest entry in the history list.
SEE ALSO
THistory, TInputLine, TListViewer
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).