Menu library MenuEnable() MenuScroll()
Programming guideline of WinDom

MenuPopUp()

NAME

MenuPopUp - Display and handle a menu popup.

PROTOTYPAGE

int MenuPopUp( void *data, int xpos, int ypos, int size, int seen, int item, int mode);

PARAMETERS

data:
address of a valid object tree or a list of entries (see P_LIST mode),

xpos, ypos:
menu popup position in the desktop,

size:
if P_LIST is used, indicates the number of entries data,

seen:
if P_LIST is used, indicated the maximum of entries seen in the popup.

item:
the popup position is adjusted in order to match the item entry with the x, y coordinates,

mode:
a bit field on:

P_RDRW
this bit means that a simple redraw message will be sent to screen to redraw the area hiding by the popup instead of save the area in a buffer. This mode can be used if the popup is called from a window. With the P_WNDW mode, this mode is always used,

P_WNDW
the popup will be drawn in a window instead of a classic formular. This mode allows to not stop the AES events. It should not be used when the popup is call from a classic formular,

P_LIST
This mode means that data parameter points to list of entries. A list of entries is a array of string. Each string is a label in the popup menu. It allows to creating popup without use object tree.

P_CHCK
The item entry will be checked.

return:
index of item selected in the popup or -1 if no selection.

DESCRIPTION

If P_WNDW mode is set, it can be disabled by the user if the windom.popup.window variable in the WinDom configuration file is set to FALSE. This mode should be used always be used when it is possible (a call of MenuPopup over a window) because the user has the choice to enable or disable this feature.

A list of entries is a pointer such as "char *ptxt[]". If the seen parameter is used, the popup is displayed with a slider and contains seen items.

Keyboards can be used to naviguate in the popup (up and down arrow) and validate an entry (RETURN or ENTER keys).

If you use mode P_WNDW, MenuPopUp() can be displayed in a window. This mode allows MenuPopup() to not stop AES events. It is very usefull with a multitasking system. If you call MenuPopUp() form a classic dialog box, this mode should never be used. In other case, this mode should always be used because it can be disabled or enabled by the user using the WinDom configuration file (see windom.popup.window variable).

With a P_LIST mode, the menu popup look can be defined by the user from the WinDom configuration file (see windom.popup variables).

The P_RGHT mode is now obsolet.

SEE ALSO

windom.popup