RISC OS Open
A fast and easily customised operating system for ARM devices
ROOL
Home | News | Software | Bugs | Bounties | Forum | Documents | Photos | Contact us
Account

The Window Manager Menus

Programmer's Reference Manuals
» Part 7 - The Desktop
» The Window Manager
» Technical Details
» Menus

Overview

The Wimp provides a simple yet powerful menu system . Menus may be nested and the user can choose to keep menus open.

Opening a Menu

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.

Creating a Menu

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.

Mouse Clicks

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.

Mouse Button Differences

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.

See also

  • Mouse_Click
  • Wimp_CreateMenu
  • Wimp_DecodeMenu
  • Menu_Selection
  • Window Button Types

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.

Revised on January 27, 2010 14:03:09 by GavinWraith (26)? (127.0.0.1)
Edit | Back in time (3 revisions) | See changes | History | Views: Print | Source | Linked from: The Window Manager Technical Details, The Window Manager Dialog Boxes, Wimp_CreateMenu

Search the Wiki

Commercial use

For commercial enquiries, please contact the owners of RISC OS, Castle Technology Ltd.

ROOL Store

The official C/C++ Development kit and more here.

Donate! Why?

Help ROOL make things happen – please consider donating!

Navigation

  • Home Page
  • All Pages
  • Recently Revised
  • Authors
  • Feeds
Site design © RISC OS Open Limited 2011 except where indicated
The RISC OS Open Instiki theme is based on Insitki's default layout

Valid XHTML 1.0  |  Valid CSS

Instiki 0.19.1(MML+)
This site runs on Rails

Hosted by Arachsys