draw dropmenu number xpos ypos width height text_list
Draws a drop menu with the following attributes:
number
menu number, 0 - 64xpos
x center of the menu base in page coordinates (inches)ypos
y center of the menu base in page coordinates (inches)width
width (x) of the menu base (inches)height
height (y) of the menu base (inches)text_list
the contents of the menu, seperated by vertical bars (|)
set dropmenu
command.
text_list
that will spawn a new
dropmenu should have ">num>"
appended, where
num
will be the number assigned to the spawned
dropmenu. This new dropmenu is then defined with the following syntax:
draw dropmenu num cascade new_text_list
There can be up to three levels of nested cascading dropmenus launched from the main dropmenu. The 2nd example below illustrates how to implement cascading dropmenus.
q pos
reference page have
more information on using dropmenus.
'clear' 'reset events' 'set rgb 90 100 100 100' 'set rgb 91 150 150 150' 'set rgb 92 200 200 200' 'set dropmenu 1 91 90 92 0 91 92 90 1 91 90 92 92 90 6' 'draw dropmenu 1 1 8 1.5 0.5 Select a Variable | Wind | Temperature | Height | SLP ' noselect = 1 while (noselect) 'q pos' menunum = subwrd(result,7) menuitem = subwrd(result,8) if (menunum = 1) if menuitem = 1 ; newbase = 'Variable = Wind' ; endif if menuitem = 2 ; newbase = 'Variable = Temp' ; endif if menuitem = 3 ; newbase = 'Variable = Height' ; endif if menuitem = 4 ; newbase = 'Variable = SLP' ; endif 'draw dropmenu 1 1 8 1.5 0.5 'newbase' | Wind | Temperature | Height | SLP ' noselect = 0 endif endwhile
'clear' 'reset events' 'set rgb 90 100 100 100' 'set rgb 91 150 150 150' 'set rgb 92 200 200 200' 'set button 1 91 -1 -1 1 91 90 92 12' 'draw button 1 1 8 1 0.5 quit' 'set dropmenu 1 91 -1 -1 1 91 90 92 1 91 90 92 90 92 6' 'draw dropmenu 1 1.5 7.5 2 0.5 Menu Base | Space | Earth >05> | Sun | Moon' 'draw dropmenu 5 cascade Ocean | Land | Atmosphere >11> | Biosphere' 'draw dropmenu 11 cascade Snow | Rain | Mist | Tornado ' while (1) 'q pos' say result ev = subwrd(result,6) if (ev!=3); break; endif; endwhile