NAME

TUI::Gadgets::Table - ASCII table view for character selection

HIERARCHY

TObject
  TView
    TTable

SYNOPSIS

use TUI::Objects;
use TUI::Gadgets;

my $table = TTable->new(
  bounds => TRect->new( ax => 1, ay => 1, bx => 33, by => 9 ),
);
$window->insert( $table );

DESCRIPTION

TTable displays the 256 characters of the character set as a grid of 32 columns and 8 rows. The character at column x and row y has the code x + 32 * y.

The cursor can be moved with the cursor keys, Home and End. Typing a character key moves the cursor to that character's position. A mouse click moves the cursor to the clicked cell.

Each time the cursor moves, the view broadcasts a cmCharFocused message to its owner. The message command is cmAsciiTableCmdBase + cmCharFocused and the message infoPtr is the code of the focused character. This allows a companion view such as TReport to display the selected character.

CONSTRUCTOR

new

my $table = TTable->new( bounds => $bounds );

Creates a new ASCII table view.

bounds

Bounding rectangle defining the position and size of the view (TRect). The view is designed for a size of 32 x 8.

new_TTable

my $table = new_TTable( $bounds );

Factory-style constructor using a positional bounds argument.

METHODS

draw

$table->draw();

Draws all 256 characters of the grid and shows the cursor.

charFocused

$table->charFocused();

Broadcasts the code of the currently focused character to the owner.

handleEvent

$table->handleEvent( $event );

Processes mouse clicks and keyboard input for cursor movement and character selection.

SEE ALSO

TAsciiChart, TReport, TView

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).