DIRECTORY Rope USING [ROPE]; MenuSystem: CEDAR DEFINITIONS = BEGIN ROPE: TYPE ~ Rope.ROPE; MenuSystem: TYPE ~ REF MenuSystemRec; --The actual network of menus, etc. MenuSystemRec: TYPE; --Details private, and subject to change. Menu: TYPE ~ RECORD [ title: ROPE, --May be NIL for no title, iff not referenced by other menus options: LIST OF ROPE, defaultSelection: CARDINAL _ 0, --See PopUpMenu.mesa sticky: BOOLEAN _ FALSE --See discussion of this bit at Select[]. ]; CreateMenuSystem: PROC RETURNS [ms: MenuSystem]; InstallMenu: PROC [ms: MenuSystem, menu: Menu]; InstallRefMenu: PROC [ms: MenuSystem, menu: REF Menu]; RemoveMenu: PROC [ms: MenuSystem, title: ROPE]; InstallAction: PROC [ms: MenuSystem, title: ROPE, action: REF]; Select: PROC [ms: MenuSystem, title: ROPE _ NIL] RETURNS [action: REF]; CallUnderLock: PROC [proc: PROC]; END. šMenuSystem.mesa Copyright c 1985, Xerox Corporation. All rights reserved. Provides a client interface to establish a network of pop-up menus. by Eric Nickell, March 22, 1985 10:16:38 pm PST Last edited by Eric Nickell, March 25, 1985 5:18:20 pm PST Lets the MenuSystem know about the menu. If already existing, then replaces old definition. Same as above, except that the client can hold onto the REF himself, and fiddle with all the parameters. It becomes the client's responsibility to avoid munching on the data at the same time that the menu system is being used. (See CallUnderLock below.) Changing the title is dangerous. Also removes Actions. This provides an association between a terminal branch of a menu network, and some REF of the user's choice. Note that installing an action will overwrite a menu with the same title. Brings up the Pop-up menu whose title is title, and lets the user make a selection. If the user's selection (the ROPE, that is) is the title of another menu, that menu is brought up, and the cycle repeats itself. If the user's selection (the ROPE) has had an action installed for it, then the action is returned. Otherwise, the ROPE itself is returned. If no title is passed (i.e., = NIL), then MenuSystem will attempt to guess the best menu to bring up. This will be the most recent menu displayed whose sticky bit is TRUE. Calls the requested procedure under monitor lock. ΚΣ˜title™Icodešœ Οmœ/™:L™CL™/L™:L™—šΟk ˜ Lšœžœžœ˜J˜—šœ žœž œž˜%L˜Lšžœžœžœ˜L˜Lšœ žœžœΟc#˜ILšœžœŸ)˜@L˜šœžœžœ˜LšœžœŸ<˜JLšœ žœžœžœ˜LšœžœŸ˜4LšœžœžœŸ)˜ALšœ˜—L˜šΟnœžœžœ˜0L™—š  œžœ˜/L™\L™—š œžœžœ˜6Lšœ8žœζ™‘L™—š  œžœžœ˜/L™L™—š  œžœžœ žœ˜?L™·L™—š  œžœžœžœžœ žœ˜GL™ΥL™ŒL™¬L™—š  œžœžœ˜!L™1L™L™L™—Lšžœ˜——…—V Γ