CDPopUpMenus.mesa  (a ChipNDale module)
Copyright © 1986 by Xerox Corporation. All rights reserved.
Created by: Ch. Jacobi, September 18, 1984 3:24:53 pm PDT
Last edited by: Christian Jacobi, August 24, 1986 7:51:19 pm PDT
DIRECTORY
CD USING [Technology],
PopUpMenus USING [Menu],
Rope USING [ROPE];
CDPopUpMenus: CEDAR DEFINITIONS =
BEGIN
Access to pop up menus.
The following convention hold for menus implemented by this module:
If the returned ref is an Atom it is stuffed into CDSequencer,
using what ever locking method is registered with this atom.
The menu entry proc is called without aquiring any extra lock.
For callData a CDSequencer.Command is provided.
The list of ChipNDale global menus is not exported; it is extensible
and if an unknow menu is provided, the "garbage" menu is used.
UnknownMenu: SIGNAL;
--can be resumed
GetMenu: PROC [key: REF, check: BOOLFALSE] RETURNS [menu: PopUpMenus.Menu];
--Returns a ChipNDale global menu for some atoms
--if menu is not known, returns the "garbage" menu,
-- but raises UnknownMenu first if check=TRUE
MakeMenu: PRIVATE PROC [key: ATOM, header, doc: Rope.ROPE, tech: CD.Technology←NIL] RETURNS [menu: PopUpMenus.Menu];
--defines a menu and registers it as CDSequencer command
--key is used for both: the name of the menu, and the name of the command
--tech: (NIL for all technologies); used for command registration but not for GetMenu
END.