UI::Various::RichTerm::Listbox - concrete implementation of UI::Various::Listbox
# This module should never be used directly! # It is used indirectly via the following: use UI::Various::Listbox;
This module is the specific implementation of UI::Various::Listbox using the rich terminal UI.
The documentation of this module is only intended for developers of the package itself.
Note that RichTerm's listboxes can only page forward
_Entry is an internal helper class used to access the currently selectable entries of the listbox.
_Entry
my @active = $ui_element->_additional_active;
Return a list of _Entry helper class elements for each visible line of the listbox (the listbox's height in total).
_Entry helper class
Note that those are in addition to the one of the listbox itself, which is used to page forward.
Also note that empty entries (when the height is greater than the amount of visible listbox entries) are silently ignored during processing in _process
_process
helper array of active entries
($width, $height) = $ui_element->_prepare($content_width);
my ($w, $h) = $_->_prepare($content_width); $width < $w and $width = $w; $height += $h;
$content_width preferred width of content
Prepare output of the UI element by determining and returning the space it wants or needs. The method should only be called from UI::Various::RichTerm container elements!
UI::Various::RichTerm
width and height the UI element will require or need when printed
$string = $ui_element->_show($prefix, $width, $height, $pre_active);
my ($w, $h) = $_->_prepare($content_width); ... $_->_show('<1> ', $w, $h, $pre_active);
$prefix text in front of first line $width the width returned by _prepare above $height the height returned by _prepare above $pre_active format string for prefixes
Return the formatted (rectangular) text box of the UI element. Its height will be exactly as specified, unless there hasn't been enough space. The weight is similarly as specified plus the width needed for the prefix. The method should only be called from UI::Various::RichTerm container elements!
the rectangular text box for UI element
$ui_element->_process;
Handle the action of the UI element (aka select one of the radio buttons).
UI::Various, UI::Various::Listbox
Copyright (C) Thomas Dorner.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See LICENSE file for more details.
Thomas Dorner <dorner (at) cpan (dot) org>
To install UI::Various, copy and paste the appropriate command in to your terminal.
cpanm
cpanm UI::Various
CPAN shell
perl -MCPAN -e shell install UI::Various
For more information on module installation, please visit the detailed CPAN module installation guide.