Skip to content

Items Numbered_Menu

ggodart edited this page Jan 5, 2021 · 2 revisions

Numbered_Menu

See original

SYNOPSIS

Read in .menu files with menu_parse (see menu.pl for examples), then select which menu to use with the first parameter, and the delay you want with the 2nd.

Example initialization:

  use Numbered_Menu;
  $NM = new Numbered_Menu('default', 2);

  $input_object->tie_items($NM);
  $NM->tie_items($output_object);

Constructor Parameters:

  ex. $x = new Numbered_Menu($y,$i);

  $x              - Reference to the class
  $y              - Menu Name
  $i              - Delay between outputing items from the menu.
                    -1 = Do not automatically advance to the next item
                     0 = Output all items without delay
                    >0 = Number of seconds of delay time

Input states:

  "start"     - Starts the menu code and listens to all other input states.
  "1","2",etc - Selects the numbered item
  "exit"      - Go to parent menu
  "repeat"    - Repeats current item
  "stop"      - Stops the menu code and ignores all input states except for start.
  "previous"  - Advances to the prior menu item.
  "next"      - Advances immediately to the next item in the menu.

Output states:

  "MENU:xxxxxx"   - Menu named xxxxx
  "ITEM:x:yyyy"   - Item number x with name yyyyyy (x is '-' at the end of the menu)
  "RESPONSE:xxxx" - Reponse xxxx from selected item if any
  <input states>  - All input states are echoed exactly to the output state as well.

For keyboard example, enable code/common/keyboard_numbered_menu.pl

INI PARAMETERS

DESCRIPTION

Module that navigates a specified menu using numbered selections.

INHERITS

Generic_Item

METHODS

AUTHOR

Jason Sharpee jason@sharpee.com

Special Thanks to:

Bruce Winter - MH
David Norwood - Audible_Menu.pm
Bill Sobel - Stargate.pm

SEE ALSO

None

Clone this wiki locally