The ApplMenu module reads a menu description file and creates an AVS
menu that conforms to this description. It also controls this menu
and issues the appropriate CLI commands when various menu choices
are made by a user.
PARAMETERS
MenuFile (string - filename)
The Menu File is the file name of the menu description file
to be used by ApplMenu. The menu may be reloaded at any time,
old menu items will be removed and the new menu will be created.
MenuChoice (string - no widget)
The Menu Choice is a hidden parameter used to recieve the menu
pick number. Users never need to worry about this parameter.
MENU DESCRIPTION FILE SYNTAX
A Menu File has a simple format. All lines are either blank, a
comment (any line that begins with a #), or a command.
All command lines have the same syntax:
Command_Name : Command_Action
There are only 5 Command_Name's that are recognized in a menu file:
Init : cli command
Menu : Pulldown menu name
Action : Menu item name (initially enabled).
ActionD: Menu item name (initially disabled).
Cmd : cli command
The colons are mandatory to seperate the Command_Name and the
Command_Action. However, spacing and indenting makes no difference.
The Init command will cause the CLI command following to be executed
once when the menu is loaded for the Menu File.
The Menu command will cause a new pulldown menu to be created with
the name given as the Command_Action. All Action commands following
a Menu will be part of that pulldown (until the next Menu command).
The Action command will cause a new menu entry to be added to the
current pulldown Menu. All Cmd commands following an Action will
be part of that Action.
The Cmd command will cause the CLI command following to be executed
when the associated Action is selected from the menu.
For simple actions, the Cmd may just be a single CLI command, but
usually, there will be a script of CLI commands which will be sourced
when the menu button is choosen. These may be any commands recognized
by the AVS CLI interpreter.
Often, commands will come in pairs, one to take some action and one
to undo that action. In this case there will also be commands to
disable the current option and to enable it's partner option.
Currently, ApplMenu has the following limitations:
Max. number of menu items (Action's) = 50 seperate menu buttons
Max. length of a Menu or Action name = 30 characters
Max. total size for all CLI Cmd's for 1 Action = 400 characters.
Note: The above are simply constants that may be changed in the source.