pre-release 0.2 Edited By Dr Phibes
STOS Manual 9: MENU COMMANDS
Creating A Menu
Before you can incorporate a menu into a program, you first need to define
the menu titles which will be displayed on the screen. This is done as
follows: MENU$(x)=title$[,paper,pen] Title$ contains the title of the menu,
and paper and pen are the colours of each heading and background. The value
of x denotes the number of the menu. These menus are numbered from 1 to
10 starting from the left hand corner of the screen.
MENU$(x,y)=OPTION$[,paper,pen]
The variables x,y in this instruction refer to the title number, and the
option number of the menu line. The string OPTION$ represents the menu
text. You can however use any string you like.
MENU ON [,border][,mode]
border can range from 1 to 16mode is either 1 for a drop down menu or 2
for a pull down menu.
MENU OFF
Switches off the entire menu and clears the menu from memory.
MENU FREEZE
Temporarily freezes the menu action. Switch back on with MENU ON.
MENU$(title,option)OFF
Disables one of the list of menu items under title.
MENU$(title,option)ON
Reverses the above instruction.STOS stores all your menus in bank 15. This
bank should therefore only be reserved when these menus are not required
in your program.
Making A Selection
MNBAR
Holds a number denoting the menu title you have chosen.
MNSELECT
Contains the number of the specific option you have highlighted.
ON MENU GOTO line1[,line2]
This procedure causes program flow to jump to a line chosen by the menu
title on the screen when a selection is made. Unlike MNBAR it is driven
by interrupts. This allows the program to execute another task while the
menus are being tested. To use the ON MENU command, after defining the
menu an instruction ON MENU ON should be used, the ON MENU function will
not work without this instruction. The function can be switched of with
the ON MENU OFF command which stops the interrupt from checking the state
of the menu.
Icons
ICONS can be used instead of text in the menus. eg.
MENU$(1)=ICON$(2)
Loads the title number with icon 2.
MENU$(2,1)=ICON$(3)
associates icon 3 with option 1 of title 2.
Troubleshooting
problem:
The menu flickers and dies every time you try to call it with the mouse.
solution:
You have ordered a menu out of sequence. Check the menu definitions
problem:
The menu doesn't appear in your program.
solution:
You may have forgotten to use the MENU ON command
problem:
ON MENU doesn't work
solution:
Check whether there is an ON MENU ON statement.
Also make sure the program isn't attempting to perform input or output
to the screen while ON MENU is active.