Chapter Contents |
Previous |
Next |
POPMENU |
Category: | List |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
index=POPMENU(list-id<,max-popup<,row,column>>); |
Type: Numeric
Type: Numeric or List
Lists may contain sublists as items. These list items must include one or more of the following named items to be valid:
Type: Character
Type: Character
Type: Numeric
Type: Character
Type: Character
Type: Character
Type: Numeric
Type: Numeric
Type: Numeric
Details |
If the list contains too many items to fit in a pop-up menu, POPMENU displays the choices in a list box that includes scrollbars. If no display window is available, POPMENU always puts the menu in a list box.
An item in the list that has the INACTIVE attribute cannot be selected and is grayed on devices that support graying. However, it is still displayed in the menu. You can use SETLATTR to assign the INACTIVE attribute to an item or to restore the item to an ACTIVE state.
If the pop-up menu is displayed in a list box, inactive items are marked with a dash, indicating that they may not be selected.
To display a separator on the pop-up menu, insert a dash as a character item in the list where you would like the separator to appear.
To display a dash, add a space before or after the dash to prevent the text from being interpreted as a separator.
POPMENU returns 0 if
In the last three cases, the pop-up menu is not displayed.
If row and column are specified and either is outside the boundaries of the current window, the pop-up menu is positioned elsewhere on the window.
Note: Some window systems do not allow row and column positioning
of pop-up menus. They may appear at the position where the pointing device
was last clicked.
Example |
Display a pop-up menu when the user presses enter. Initialize
the pop-up menu with three menu items: Select 1
, Numeric
, and Character
. Define
a separator between Select 1
and Numeric
.
init: dcl list ; control enter; list = { {text='Select 1', helpText='This is a selection.', mnemonic='S', classifier = 107}, "-", "Numeric", "Character"}; return; main: rc= popmenu (list); put rc=; return; term: /* Delete the list recursively to avoid memory leak */ rc = dellist ( list, 'y;); return;
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.