Line 13: |
Line 13: |
| ! Parameter !! Type !! Description | | ! Parameter !! Type !! Description |
| |- | | |- |
− | | <u>menuStructure</u> || (multi-level)-table || Table describing the name of each tool box, the menus that appear in each tool box, and the function to call when the user invokes the menu item | + | | <u><center>menuStructure</center></u> || (multi-level)-table || Table describing the name of each tool box, the menus that appear in each tool box, and the function to call when the user invokes the menu item |
| | | |
| |} | | |} |
Line 21: |
Line 21: |
| The script app uses this routine to register its tool palette with the Nspire framework. | | The script app uses this routine to register its tool palette with the Nspire framework. |
| | | |
− | <syntaxhighlight>menu = { | + | <syntaxhighlight> |
− |
| + | |
− | {“Mode”, -- Tool box “Mode” | + | function setDec() |
− | {“Decimal”, setDec}, -- Menu item “Decimal” calls function setDec() | + | ... |
− | {“Hexadecimal”, setHex}, | + | end |
− | {“Octal”, setOct}, | + | |
− | {“Binary”, setBin}, | + | -- All your functions defined in the menu -- |
− | “-“, -- Section divider | + | |
− | {“Signed”, setSigned}, | + | menu = { |
− | {“Unsigned”, setUnsigned}, | + | |
| + | {"Analysis", -- Tool box "Mode" |
| + | {"Decimal", setDec}, -- Menu item "Decimal" calls function setDec() |
| + | {"Hexadecimal", setHex}, |
| + | {"Octal", setOct}, |
| + | {"Binary", setBin}, |
| + | "-", -- Section divider |
| + | {"Signed", setSigned}, |
| + | {"Unsigned", setUnsigned}, |
| }, | | }, |
− | {“Boolean”, | + | {"Boolean", |
− | {“And”, binopAnd}, | + | {"And", binopAnd}, |
− | {“Or”, binopOr}, | + | {"Or", binopOr}, |
− | {“XOr”, binopXor}, | + | {"XOr", binopXor}, |
− | {“Not”, unopNot}, | + | {"Not", unopNot}, |
| } | | } |
− | | + | |
| } | | } |
− | | + | |
| toolpalette.register(menu)</syntaxhighlight> | | toolpalette.register(menu)</syntaxhighlight> |
| | | |