CallMenu
handles options to call different Ox functions, including submenusParamMenu
handles a list of parameters to send to a functionCallMenu
an item is array of two things: prompt and either a functions to run or submenu to enter.ParamMenu
an item is a prompt and a default value of the parameter.k=val
where k
is the index, "=" is the equal sign and val
is either an integer, double or a string containing elements of a matrix parameter to be scanned in using the "%M" formatting code.
Output
Public fields | ||
help_text | string printed if HELP selected. | |
IamMain | TRUE if top menu. | |
Public methods | ||
add | Add an item to the Callmenu. | |
CallMenu | Create a new CallMenu object. | |
CmdLine | Run options from command line if any, otherwise go interactive. | |
make_the_call | Call the function or enter the submenu selected. | |
Run | Run the menu. |
Public fields | ||
items | array containing menu. | |
keeplog | log calls from this menu. | |
logdir | static | Folder for logs. |
name | string: menu name. | |
sep | static const | |
Public methods | ||
add | virtual | |
CmdLine | virtual | |
itemparse | static | Find the menu item corresponding to the token. |
Menu | Create a new menu object. | |
SetLogDir | static | Set the static folder to place logs of calls for all menus. |
~Menu | ||
Enumerations | ||
Anonymous enum 1 | ||
Anonymous enum 2 |
Public fields | ||
pars | ||
Public methods | ||
add | add parameters to the list. | |
CmdLine | Set parameter values from the command line. | |
ParamMenu | ||
SetPars | Set Parameters. | |
Enumerations | ||
Anonymous enum 1 |
... | list of items, each an array of size ItemSize
The first element of an item is a prompt string. The second is either a static function of the form
func() . Or, it is another menu object that is a submenu. One way to organize submenus is
to write a function that creates and returns the submenu object then call it and return its value as the
call item as shown below.
|
name | string, name of menu |
keeplog | FALSE[default] do not open a log file for each call TRUE open a log file |
IamMain | TRUE, the highest level menu [default] FALSE, sub menu |
arg | integer [default=1] the first command line argument to treat as a menu option. This
means non-OxMenu options must appear first on the command line. an array of options to execute as if entered from the keyboard. If the array is empty or if the arglist is shorter than the initial value the menu enters interactive mode by calling Run(). Thus, using CmdLine does not require
command line options.
oxl main opt1 [sub1 ...] opt menu->CmdLine |
item | menu item |
logoutput | TRUE: create a logfile for this run. |
Enumerations | ||
Anonymous enum 1 | prompt, call, ItemSize | |
Anonymous enum 2 | EXIT, HELP, QUIT, DOALL, CHOICE |
token | a string prompt or an integer index |
items | a list of menu items. |
name | string, name of menu |
keeplog | FALSE[default] do not open a log file for each call TRUE open a log file |
folder | string, a path. Default is "./" |
Enumerations | ||
Anonymous enum 1 | RESET, SEND, Value |
... | list of parameters each an array of size ItemSize The first element of an item is a prompt string. The second is the default value of the parameter, which can be an integer, double or matrix. The dimensions of the matrix determines the shape to be read in (dimensions are fixed). |
logoutput | TRUE: create a logfile for this run. |