NAME
TUI::ColorSel::ColorDialog - Common dialog box for selecting colors
HIERARCHY
TObject
TView
TDialog
TColorDialog
SYNOPSIS
use TUI::ColorSel::ColorGroup;
my $groups =
TColorGroup->new('Calendar')
+ TColorItem->new('Frame passive', 16)
+ TColorItem->new('Frame active', 17)
+ TColorItem->new('Normal text', 21)
+ TColorItem->new('Current day', 22);
my $dialog = TColorDialog->new(
pal => $palette,
groups => $groups,
);
if ( $deskTop->execView($dialog) == cmOK ) {
my @data;
$dialog->getData(\@data);
my $newPalette = $data[0];
...
}
DESCRIPTION
TColorDialog implements the standard TUI::Vision color selection dialog.
The dialog presents a list of color groups and their associated color items. The selected item can be modified using foreground and background color selectors or, when running in monochrome mode, through a monochrome attribute selector.
The dialog operates on a copy of the supplied palette. The modified palette can be retrieved through the standard Perl data transfer mechanism.
The dialog contains the following visual components:
Color group list
Displays the available color groups.
Color item list
Displays the items belonging to the selected group.
Foreground selector
Selects the foreground color attribute.
Background selector
Selects the background color attribute.
Monochrome selector
Used when monochrome attributes are edited.
Color display
Preview area showing the currently selected color.
CONSTRUCTOR
new
my $dlg = TColorDialog->new(
pal => $palette | undef,
groups => $groups | undef,
);
Constructs a color selection dialog.
Parameters:
palOptional palette object (TPalette). When supplied, the palette is cloned and edited locally within the dialog.
groupsA TColorGroup hierarchy describing the available color groups and items that may be edited.
new_TColorDialog
my $dlg = new_TColorDialog( $palette | undef, $groups | undef);
Compatibility constructor corresponding to the original Borland Turbo Vision interface.
ATTRIBUTES
pal
The palette currently being edited (TPalette or undef).
A clone of the palette provided to the constructor is maintained by the dialog.
groups
The color group hierarchy displayed by the dialog (TColorGroupList).
METHODS
dataSize
my $size = $dlg->dataSize();
Returns the size of the data record used by the dialog.
getData
$dlg->getData(\@record);
Copies the current palette into the supplied record.
setData
$dlg->setData(\@record);
Initializes the dialog from the supplied record.
handleEvent
$dlg->handleEvent($event);
Handles TUI::Vision events and updates the preview display when the currently selected color item changes.
SEE ALSO
TColorGroup, TColorItem, TColorSelector, TMonoSelector, TDialog
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).