Loading...
 

PopupMenu

PopupMenu

PopMenu(windowID, menuID), PopupMenu(, menuID)

parameters: Identifier of a Windows and a menu item

Stack
Stack Position Description
Stack(In) Top -
Stack(Out) Top -

The identifier menuID is used to specify an item from a menu or ContextMenuList whose submenu is opened as a context menu (popup menu) on the widget (windowID or Current) at the mouse cursor position. The focus goes to the popup menu, which releases it only after selecting a menu item or pressing the (Escape) key or clicking with the left mouse button outside the menu (also aborts).
If a menu item is selected, it is executed in the same way as from the main menu. Additionally you can determine from which window object the menu point was called via ContextMenu by executing SELECT to the corresponding item with GetCurrentWidget. With a call from the main menu GetCurrentWidget returns NULL.

PopupMenu allows you to open a menu by instruction from InstantView®. It competes with the window object flag CONTEXTMENU, which can be used to specify a menu to be called up automatically. Only one method of calling up the menu at a time may be used. If MOUSE_CLICK_R is to open exactly one pop-up menu, the flag method is preferable. The call of PopupMenu on the other hand allows a differentiated decision about opening a menu. For example, depending on the context (selected element in a list), a different menu could appear in each case.

If the referenced item contains no subordinate items, it is treated as empty. In order to visualise this, a pop-up menu with a virtual item appears nevertheless, which is called "(empty)" with the German language setting. This empty text is changed to the respective language when the language is changed.