Showing changes from revision #1 to #2:
Added | Removed | Changed
Entry | |
---|---|
R1 | Pointer to Menu Block or |
Window handle, or | |
–1 means close any active menu | |
R2 | X co-ordinate of top-left corner of top level menu |
R3 | Y co-ordinate of top-left corner of top level menu |
Exit | |
---|---|
R0 | Corrupt |
The purpose of this call is to create and display a menu structure. A menu window to open can be a traditional menu containing menu items or it can also be a window such as a dialog box.
Having used this call, applications should return to its normal polling loop. Further sub-menus are opened via Wimp_CreateSubMenu. The Wimp maintains the menu tree until a mouse click is detected. If the click was within a menu, then a Menu Menu_Selection event code is returned from Wimp_Poll, along with a list of selections. If the click was detected outside of a menu, then the Wimp closes all menus.
A menu is actually a window with its work area entirely covered by menu items. However, any window can be opened as a menu if R1 contains the window handle.
The Wimp will automatically display a vertical scroll bar if a menu is taller than the current screen mode
When a menu is closed, the caret is automatically given back to wherever it was before the window was opened.
Pressing the Return key while the caret is inside a writable menu item is equivalent to a mouse click.
It is conventional that menu items clicked with the Adjust button should keep the menu structure open so further selections can be made. For this to happen, the Wimp temporarily marks the menu tree when a selection is made. To confirm which mouse button was clicked, Wimp_GetPointerInfo should then be called. If the adjust button was clicked, then Wimp_CreateMenu should be called before returning to Wimp_Poll so that the menu tree to be re-opened as before. The menu structure can also be modified (if required) before re-opening.
To aid with identifying which menu item was selected by the user, the Wimp_DecodeMenu can be used.