NAME
TUI::Dialogs::CheckBoxes - multi-item checkbox cluster control
HIERARCHY
TObject
TView
TCluster
TCheckBoxes
SYNOPSIS
use TUI::Dialogs;
use TUI::Objects;
my $bounds = TRect->new( ax => 3, ay => 5, bx => 35, by => 7 );
my $items = TSItem->new( value => '~C~ase sensitive',
next => TSItem->new( value => '~W~hole words only',
next => undef,
));
my $cb = TCheckBoxes->new( bounds => $bounds, strings => $items );
$dialog->insert( $cb );
DESCRIPTION
TCheckBoxes implements a multi-selection checkbox group where each item can be toggled independently. Each checkbox corresponds to a bit in an internal value mask, allowing multiple items to be selected at the same time.
The control inherits navigation, drawing, and event handling behavior from TCluster. Only the marking and toggle logic are specialized to support multi-state selection.
Commonly Used Features
Typical code creates a short TSItem chain, constructs TCheckBoxes, and inserts it into a dialog. The selected state is stored as a bitmask, so each checkbox corresponds to one bit in value. In practice you usually read and write that value through dialog data transfer, while mark and press are mainly useful when implementing or testing custom event behavior.
VARIABLES
The following global variable affects the visual rendering of TCheckBoxes.
$button
Defines the character pattern used to display a single checkbox item, for example [ ] .
CONSTRUCTOR
new
my $cb = TCheckBoxes->new(
bounds => $bounds,
strings => $items
);
Creates a new checkbox cluster.
- bounds
-
Bounding rectangle defining the position and size of the checkbox group (TRect).
- strings
-
Linked list of item descriptors used to populate the checkbox labels (TSItem).
new_TCheckBoxes
my $cb = new_TCheckBoxes($bounds, $items);
Factory-style constructor using positional arguments.
METHODS
draw
$cb->draw();
Draws the checkbox cluster using a checkbox-style marker.
mark
my $bool = $cb->mark($item);
Returns true if the bit corresponding to the specified item index is currently set.
press
$cb->press($item);
Toggles the bit assigned to the given item index in the internal value mask.
SEE ALSO
TUI::Dialogs::RadioButtons, TUI::Dialogs::Dialog, TUI::Views::Cluster
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).