SAS Component Language Dictionary |
Category: | List |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
index=POPMENU(list-id<,max-popup<,row,column>>); |
specifies the index of the item to be selected by default when the pop-up menu appears. On return, index will be set to the index of the selected pop-up menu item.
is the identifier of the list that contains the character or list items to display in the pop-up menu. An invalid list-id produces an error condition.
Lists may contain sublists as items. These list items must include one or more of the following named items to be valid:
specifies whether a check should appear to the left of the item. Valid values are Yes|No (Default).
specifies the numeric representation of an icon to be associated with the menu item.
specifies whether the menu item should be grayed. Valid values are Yes|No (Default).
specifies the character that is used as a keyboard shortcut. The character must be one of the characters of the menu text.
is the maximum number of items to display in a pop-up menu window. If the list is longer than max-popup, the menu is displayed in a window with a scrollable listbox.
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 scroll bars. 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.
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: 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 |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.