pulldown <file>
or
pulldown {
<menu_block>
}
Display and select from a pop-up menu pulled down from a button menu bar or other menu.
<file>
A text file containing
details of the menu options. The default file extension is .men. If this
parameter is not present, option details will be expected to appear in
a language block following the command line.
<menu_block>
A language block, each line providing details of menu title or options.
-bcol=<color>
The color of off bits in monochrome image menus. If omitted, white is used.
-cr=<file(s)>
Use images to display the options pictorially instead of via an alpha menu
(the default behavior). One or more image files may be specified. Multiple
files should be comma separated all enclosed within <
and >.
-fcol=<color>
The color of on bits in monochrome image menus. If omitted, white is used.
-h
Options should be displayed horizontally. The default behavior is to
display them vertically.
-th=<num>
Draw a line of thickness <num>
pixels around pictorial menu options. The color used is the menu other
color derived from the menu or menu bar from which the pulldown cascades.
-to
Make the menu a "tear-off" menu so that it can be separated
from its menu hierarchy to become a stand-alone menu. The default behavior
is for the menu not to have a tear-off capability. There are no tear-off
facilities on Windows systems.
The format of each line within <menu_block> or <file> is as follows:
<num> {,<num> ...} : { <message> } { ,-ch { ,-v=<num> } }
{ <command_block> }
where:
<num>
The option number. A value 0 will indicate a line or title. Any other
value will indicate an option number and should be unique within the block.
Indicating two or more values will equate two or more options.
<message>
The text to be
displayed in the tile line or menu option. This is always used for title
lines, but in menus is ignored for non-title lines because the option
descriptions are displayed pictorially.
-ch
Make the menu option a check (toggle) button instead of a push button
(the default behavior). After selection, its value can be retrieved
via the system numeric menu_switch.
-v=<num>
A numeric value (1 or 0) indicating whether the
toggle in the menu option is to be shown as on or off when the menu is
first displayed. The default is 0.
<command_block>
A block of commands to be executed when option <num>
is selected. The command block must be enclosed within braces. This can
be omitted in which case the option is treated as a label and is not selectable.
The menu will remain displayed until a valid option is picked, or until a click outside the menu is made.
Pulldown menus may be invoked in one of the following situations:
from a window button procedure (window.buttons)
from a window help procedure (window.help)
from a panel button procedure (panel.exec)
from the system help procedure (help)
but not from within a macro, stanza or function called from one of the above.
Colors for pulldown menu are inherited from the parent menu bar or menu.
When a command_block invoked by a pulldown menu contains another pulldown menu, that command block must contain only the pulldown command and no others. Any other commands present in the command block will not be executed.
Title lines are not displayed on image pulldown menus.
For alpha pulldowns, option text is left-justified. Title and label text are middle-justified. A label (an option without an executable command block) of just '-' produces a separating line across the full width of the menu.
Attach a pulldown menu to a button of a graphic window. Another pulldown is attached to a menu within the button procedure.
window grawin = wgraphic
grawin.button_labels[2] = 'Zoom/Pan'
grawin.buttons[2] {
args w=window
unless (w.view) {
bell; !Cannot do this on a perspective
}
else {
pulldown {
1: 'Blow' { blow -iw=w }
2: 'Shrink' { shrink -iw=w }
3: 'Pan {
# Note: pulldown is the only command in this block
pulldown {
1: 'Interactive' { pan -iw=w }
2: 'Left' { pan -iw=w,-l=0.5 }
3: 'Right' { pan -iw=w,-r=0.5 }
4: 'Up' { pan -iw=w,-u=0.5 }
}
}
}
}
}
|
Commands: |
|
|
Identifiers: |
menu_switch (numeric) |
|
Structures: |