NAME

UI::Various::RichTerm::Input - concrete implementation of UI::Various::Input

SYNOPSIS

# This module should never be used directly!
# It is used indirectly via the following:
use UI::Various::Input;

ABSTRACT

This module is the specific implementation of UI::Various::Input using the rich terminal UI.

DESCRIPTION

The documentation of this module is only intended for developers of the package itself.

METHODS

_prepare - prepare UI element

($width, $height, $active) = $ui_element->_prepare($content_width);

example:

my ($w, $h, $active) = $_->_prepare($content_width);
$width < $w  and  $width = $w;
$height += $h;

parameters:

$content_width      preferred width of content

description:

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::Curses container elements!

returns:

width and height the UI element will require or need when printed

_show - return formatted UI element

$string = $ui_element->_show($prefix, $width, $height,
                             $full_width, $full_height);

example:

my ($w, $h) = $_->_prepare($content_width);
...
$_->_show('    ', $w, $h, $my_width, 0);

parameters:

$prefix             text in front of first line
$width              the width returned by _prepare above
$height             the height returned by _prepare above

description:

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!

returns:

the rectangular text box for UI element

_process - handle action of UI element

$ui_element->_process;

description:

Handle the action of the UI element aka the input has been selected.

SEE ALSO

UI::Various, UI::Various::Input

LICENSE

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.

AUTHOR

Thomas Dorner <dorner@cpan.org>