Curses-Devkit
view release on metacpan or search on metacpan
fulldemo/help/menu.help view on Meta::CPAN
</R>Purpose<!R>
The menu widget allows the programmer to create a pull-down menu widget.
Complete with sub-menu items.
</R>Construction Options<!R>
A menu widget is defined using the following syntax. The variable
</B>$menuObject<!B> contains a reference to the menu object.
<C></B>$menuObject = new Cdk::Menu ( options );
The options are defined in the following table.
</U>Option Default Value Type Purpose<!U>
Menulist Required Array Ref This is the menu title list.
Menuloc Required Array Ref This is the menu title location list.
Tattrib Reverse Scalar This is the attribute of the currently highlighted menu title.
SubTattrib Reverse Scalar This is the attribute of the currently highlighted menu item.
</R>Available Methods<!R>
</B>activate<!B>
Activation of an object means to make the object available for use. The
following example demonstrates how to activate a menu widget.
<C></B>$returnValue = $menuObject->activate ();
The variable </B>$returnValue<!B> is an integer value which represents the
selected item. The calculation of this value is determined as follows:
(100 * Current Title ) + Current Subtitle
To extract the correct menu item from this value use the following formula:
$menuList = int ( $returnValue / 100 );
$menuItem = ($returnValue % 100 );
You can then dereference the string value from the array using the above two
calculations.
</B>inject<!B>
This function injects a single character into the widget. The following
examples demonstrates how to call the inject method.
<C></B>$menuObject->inject ( options );
The options are defined in the following table.
</U>Option Default Value Type Purpose<!U>
Shadow Required Scalar The character to inject into the widget.
If you are injecting a special character into the widget, then you can
use a pre-defined value to represent the key.
<C><#UL><#HL(11)><#TT><#HL(14)><#UR>
<C><#VL></U>Key <#VL>Key Value <!U><#VL>
<C><#VL>Left Arrow <#VL>KEY_LEFT <#VL>
<C><#VL>Right Arrow <#VL>KEY_RIGHT <#VL>
<C><#VL>Up Arrow <#VL>KEY_UP <#VL>
<C><#VL>Down Arrow <#VL>KEY_DOWN <#VL>
<C><#VL>Delete <#VL>KEY_DELETE <#VL>
<C><#VL>Backspace <#VL>KEY_BACKSPACE <#VL>
<C><#VL>Page Up <#VL>KEY_PPAGE <#VL>
<C><#VL>Page Down <#VL>KEY_NPAGE <#VL>
<C><#VL>Home <#VL>KEY_HOME <#VL>
<C><#VL>End <#VL>KEY_END <#VL>
<C><#VL>Escape <#VL>KEY_ESC <#VL>
<C><#LL><#HL(11)><#BT><#HL(14)><#LR>
</B>bind<!B>
The bind method binds keys to events. The binding is specific to the individual
objects. The following example demonstrates how to call the bind method.
<C></B>$menuObject->bind ( options );
The options are defined in the following table.
</U>Option Default Value Type Purpose<!U>
Key Required Scalar This is the character to bind the
event to.
Function Required Scalar This is the name of the callback
function.
( run in 1.319 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )