Curses-UI
view release on metacpan or search on metacpan
lib/Curses/UI/Widget.pm view on Meta::CPAN
=pod
=head1 NAME
Curses::UI::Widget - The base class for all widgets
=head1 CLASS HIERARCHY
Curses::UI::Widget - base class
=head1 SYNOPSIS
This class is not used directly by somebody who is building an application
using Curses::UI. It's a base class that is expanded by the Curses::UI widgets.
See WIDGET STRUCTURE below for a basic widget framework.
use Curses::UI::Widget;
my $widget = new Curses::UI::Widget(
-width => 15,
-height => 5,
-border => 1,
);
=head1 STANDARD OPTIONS
The standard options for (most) widgets are the options that are enabled
by this class. So this class doesn't really have standard options.
=head1 WIDGET-SPECIFIC OPTIONS
=head2 GENERAL:
=over 4
=item * B<-parent> < OBJECTREF >
This option specifies parent of the object. This parent is
the object (Curses::UI, Window, Widget(descendant), etc.)
in which the widget is drawn.
=item * B<-intellidraw> < BOOLEAN >
If BOOLEAN has a true value (which is the default), the
B<intellidraw> method (see below) will be suported. This
option is mainly used in widget building.
=item * B<-userdata> < SCALAR >
This option specifies a user data that can be retrieved with
the B<userdata>() method. It is useful to store application's
internal data that otherwise would not be accessible in callbacks.
=item * B<-border> < BOOLEAN >
Each widget can be drawn with or without a border. To enable
the border use a true value and to disable it use a
false value for BOOLEAN. The default is not to use a border.
=item * B<-sbborder> < BOOLEAN >
If no border is used, a square bracket border may be used.
This is a border which is constructed from '[' and ']'
characters. This type of border is especially useful for
single line widgets (like text entries and popup boxes).
A square bracket border can only be enabled if -border
is false. The default is not to use a square bracket border.
=back
=head2 POSITIONING:
+---------------------------------------------------+
| parent ^ |
| | |
| y |
| | |
| v |
| ^ |
| | |
| padtop |
| | |
| v |
| +- TITLE -------+ |
| | widget ^ | |
| | | | |
| | | | |
|<--x--><--padleft-->|<----width---->|<--padright-->|
| | | | |
| | | | |
| | height | |
| | v | |
| +---------------+ |
| ^ |
| | |
| padbottom |
| | |
| v |
+---------------------------------------------------+
=over 4
=item * B<-x> < VALUE >
The x-position of the widget, relative to the parent. The default
is 0.
=item * B<-y> < VALUE >
( run in 1.374 second using v1.01-cache-2.11-cpan-39bf76dae61 )