CDPopUpMenus.mesa  (a ChipNDale module)
Copyright © 1986, 1987 by Xerox Corporation. All rights reserved.
Created by: Christian Jacobi, September 18, 1984 3:24:53 pm PDT
Last edited by: Christian Jacobi, January 13, 1987 12:53:01 pm PST
DIRECTORY
CD USING [Technology],
PopUpMenus USING [Menu],
Rope USING [ROPE],
SymTab USING [Ref];
CDPopUpMenus: CEDAR DEFINITIONS =
BEGIN
Access to pop up menus.
Implement menus and menu entries.
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 since it is extensible.
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, raises UnknownMenu if check=TRUE; returns
-- the "garbage" menu on check=FALSE or on RESUME.
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
HandleMenuFile: PROC [fileName: Rope.ROPE, doneFiles: SymTab.Ref←NIL];
--Creates all the menu entries as described in the menu file "fileName".
--Most tools better do NOT use this mechanism for set up; it is more advantageous to have
-- entries in the default menu tables, so the tool need not be loaded previously. This
-- procedure has been made public for acess to set up of very peripheral tools only.
--doneFiles: Engine room feature: Files found in this SymTab are ignored.
END.