NAME
TUI::ColorSel::MonoSelector - monochrome attribute selector control
HIERARCHY
TObject
TView
TCluster
TMonoSelector
SYNOPSIS
use TUI::ColorSel;
use TUI::Objects;
my $bounds = TRect->new(
ax => 0,
ay => 0,
bx => 20,
by => 5
);
my $selector = TMonoSelector->new(
bounds => $bounds
);
$dialog->insert( $selector );
DESCRIPTION
TMonoSelector implements a monochrome attribute selector based on the standard TCluster control.
The selector presents a fixed set of monochrome display attributes and allows the user to choose between them. The available selections correspond to the classic Turbo Vision monochrome display modes.
Whenever the selected attribute changes, the selector broadcasts the corresponding foreground and background colors so that related controls may update themselves automatically.
Commonly Used Features
Applications typically create a TMonoSelector, insert it into a dialog, and allow the dialog event loop to manage user interaction.
The control synchronizes itself with cmColorSet broadcasts and emits cmColorForegroundChanged and cmColorBackgroundChanged messages when the selected monochrome attribute changes.
VARIABLES
The following global variables define the labels and visual appearance of the selector.
$button
Defines the marker pattern (Str) used when drawing an item.
$normal
Label used for the normal attribute entry (Str).
$highlight
Label used for the highlight attribute entry (Str).
$underline
Label used for the underline attribute entry (Str).
$inverse
Label used for the inverse attribute entry (Str).
CONSTRUCTOR
new
my $selector = TMonoSelector->new( bounds => $bounds );
Creates a new monochrome selector.
- bounds
-
Bounding rectangle defining the position and size of the selector (TRect).
new_TMonoSelector
my $selector = new_TMonoSelector( $bounds );
Factory-style constructor using positional arguments.
METHODS
draw
$selector->draw();
Draws the monochrome selector using the standard cluster layout.
handleEvent
$selector->handleEvent( $event );
Handles broadcast events.
The selector responds to cmColorSet broadcasts and updates its current attribute accordingly.
mark
my $bool = $selector->mark( $item );
Returns true if the specified item corresponds to the currently selected monochrome attribute.
movedTo
$selector->movedTo( $item );
Updates the selected attribute when the selection cursor moves to a different item.
newColor
$selector->newColor();
Broadcasts the foreground (cmColorForegroundChanged) and background (cmColorBackgroundChanged) colors corresponding to the currently selected monochrome attribute.
press
$selector->press( $item );
Selects the specified monochrome attribute.
SEE ALSO
TColorDialog, TCluster, TColorSelector
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).