wmenu(_c)
status.i4.v = wmenu(top_row.i2.r, left_column.i2.r, num_items.i2.r,
num_chars.i2.r, item_text.i1a.r, title.i1a.r,
item.i2.r [,num_columns.i2.r] [,user_funcs.fa.r]
[,func_data.ga.r] [,enabl_entries.i1a.r]
[,help_info.sa.r])
status.i4.v = wmenu_c(top_row.i4.v, left_column.i4.v, num_items.i4.v,
num_chars.i4.v, item_text.i1a.r, title.i1a.r,
item.i2.r [,num_columns.i4.v] [,user_funcs.fa.r]
[,func_data.ga.r] [,enabl_entries.i1a.r]
[,help_info.sa.r])
This routine will prompt the user to select one item out of list of
possibities by creating a window on the color TV and displaying the
available choices. It then waits until the user clicks under
one of the choices (or somewhere else), deletes the window, and returns
the item number selected to the caller. The routine automatically
determines the window size. The menu item which the cursor is under
is highlighted with a blue background. A value of TRUE will be
returned if a valid selection is made. Otherwise, a value of FALSE
will be returned.
top_row top row of menu (use WMNGR_CENTER for centering
or WINDOW_xxx_COORD macros in macro for special
positioning) (Note: wmenu_c can use all of these
macros, but wmenu can only use the WMNGR_CENTER_IT
macro.)
left_column left column of menu (use WMNGR_CENTER for centering
or WINDOW_xxx_COORD macros in macro for special
positioning) (Note: wmenu_c can use all of these
macros, but wmenu can only use the WMNGR_CENTER_IT
macro.)
num_items number of menu items
num_chars number of characters in a menu item
(If a value of zero is passed for this argument,
the routine will assume that all of the menu text is
contained in a single null terminated or descriptor
described string and will automatically determine the
length of a single menu item by dividing the total
string length by the number of items.)
item_text menu item text ("num_chars" characters per entry)
title a null-terminated text string (ie. a quoted literal)
to be written to the top line of the window (It may
be no longer than ("num_chars" + 3) * "num_columns" - 3
characters in length.)
item number of selected item (or unchanged if no selection
was made). Upon entry the text for menu item = "item"
will be displayed in yellow. All other item text will
be displayed in white. Upon return, "item" will be set
to the number of the item which the user clicked under.
If the cursor was not under a item, "item" will be
unchanged. Valid items start at 1.
[num_columns] number of menu columns (default is 1)
[user_funcs] pointers to functions to be called by the menu
(If this is specified, the function corresponding to
a given entry is called when that entry is selected.)
(default is NULL)
(called as follows:
user_func(func_data.g.v, item.i4.v, item_text.i1a.r))
[func_data] pointers to data to be passed to "funcs"
(default is NULL)
[enabl_entries] array of logical flags indicating which menu entries
are enabled/active (default is NULL which enables
all menu entries)
(MENU_ENABLED_ENTRY -> enabled entry (default),
MENU_DISABLED_ENTRY -> disabled entry,
MENU_SEPARATOR -> separator entry)
[help_info] entry by entry help callback information
(array of HELP_CALLBACK_DATA structures)
(default is NULL)
This function returns status values as follows:
CBS_INVARG invalid number of items
CBS_WINDOW_TOO_BIG menu won't fit on the screen
TRUE user made a valid menu selection
FALSE user interrupted outside of menu
This function requires the following include files:
cnsparam_h, clib_h, cbslib_h, macro_h, acnet_errors_h
Related functions:
popup_menu(_c), scroll_menu(_c), menu_create(_c),
combo_menu_c, logical_scroll_menu(_c), logical_combo_menu_c,
build_menu_text, menu_setup_c, window_restore_hint_c
C/C++ usage:
static const char item_text[NUM_ITEMS][NUM_CHARS] =
{"Entry 1", "Entry 2", "Entry 3", "Entry 4", "Entry 5", "Entry 6"};
static const char title[] = "Title";
char *enabled_entries = (char *) NULL;
char *header_line = (char *) NULL;
short item = 0;
int status;
int top_row = WMNGR_CENTER;
int left_column = WMNGR_CENTER;
int num_items = NUM_ITEMS;
int num_chars = NUM_CHARS;
int num_columns = 1;
int padding_chars = 1;
popup_menu_function *user_funcs = (popup_menu_function *) NULL;
void **func_data = (void **) NULL;
HELP_CALLBACK_DATA *help_info = (HELP_CALLBACK_DATA *) NULL;
status = wmenu_c(top_row,left_column,num_items,num_chars,
(char *) item_text,title,&item,num_columns,
user_funcs,func_data,enabled_entries,help_info);