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

Wimp_CreateMenu

Programmer's Reference Manuals
» Part 7 - The Desktop
» The Window Manager
» SWI Calls
» Wimp_CreateMenu

Wimp_ CreateMenu

(SWI &400D4)
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

Use

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.

Notes

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.

See also

  • Wimp_CreateSubMenu
  • Wimp_DecodeMenu
  • Wimp_GetPointerInfo
  • Wimp_Poll
  • Menu Block
  • MenuSelection
  • Menus
Created on June 5, 2009 02:06:13 by Alan Robertson (52)? (127.0.0.1)
Edit | Views: Print | Source | Linked from: The Window Manager SWI Calls, The Window Manager Menus, The Window Manager Dialog Boxes, The Window Manager Applications And Documents, Menu Block, Menu Items, Item Flags, Wimp_CreateSubMenu, Wimp_DecodeMenu, Menu_Selection, Message_MenusDeleted

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