Showing changes from revision #4 to #5:
Added | Removed | Changed
The Wimp provides a simple yet powerful menu system . Menus may be nested and the user can choose to keep menus open.
RISC OS reserves the middle mouse button for opening menus. Wherefore this button is called the Menu button. The Wimp issues the appropriate Mouse_Click event code upon registering a click of the menu button.
An application will usually respond to the event code and open a menu by calling Wimp_CreateMenu.
The Wimp passes a pointer to a data structure that describes a list of menu items, and each menu item may have further pointers to its submenus (if any).
Menus can also be made to open a window rather than simply another menu. The window can have icons, sprites and user defined data as required.
As the Wimp notifies the application when a menu is to be opened, the menu tree can be built dynamically at runtime. This allows for context-driven menus easily to be created. The window and icon handles passed by the Wimp give the necessary information for creating a menu relevant to the user.
Clicks of the menu button over a window are always reported by the Wimp regardless of the Window Button Types attribute.
When a user makes a selection within a menu (using any mouse button) the Wimp generates another event Menu_Selection. The application should then respond to this by decoding the selected menu item(s) and performing the required actions.
The Wimp provides the Wimp_DecodeMenu call to aid in calculating which menu item has been selected in which menu.
Select | The Select button selects the menu item under the mouse pointer and closes the menu. |
Adjust | The Adjust button selects the menu item but should keep the menu open to allow the user to make more selections. Some assistance from the application is required, however. See Wimp_CreateMenu for more details |
<br \>
h2(#writeable_icons). Writeable Icons
Menu items can also be made to handle text input. This allows for very easy input from the user while a menu is open.
RISC OS has many guidelines on the appropriate use of menus. For a complete detailed guide on menus please see the RISC OS Style Guide.