DIRECTORY Imager USING [Context], Menus USING [Entry, MenuEntryTrigger], Process USING [Milliseconds], Rope USING [ROPE], TIPUser USING [TIPScreenCoords], ViewerClasses USING [NotifyProc, Viewer]; MenusPrivate: CEDAR DEFINITIONS = BEGIN Viewer: TYPE = ViewerClasses.Viewer; ROPE: TYPE = Rope.ROPE; menuHLeading: INTEGER = 5; -- white space before first entry menuHSpace: INTEGER = 12; -- white space between entries InternalFormatMenuRef: TYPE = REF InternalFormatMenu; InternalFormatMenu: TYPE = RECORD[ name: ROPE, beginsActive: BOOLEAN _ TRUE, breakBefore: BOOLEAN _ TRUE, breakAfter: BOOLEAN _ TRUE, notify: ViewerClasses.NotifyProc _ NIL, entries: LIST OF EntryRef _ NIL ]; EntryRef: TYPE = REF Menus.Entry; ViewerMenus: TYPE = REF ViewerMenusRec; ViewerMenusRec: TYPE = RECORD [ x: INTEGER _ 0, -- lower-left hand corner of entire menu area of viewer y: INTEGER _ 0, -- the x and y are RELATIVE to the viewer. w: INTEGER _ 0, -- width of entire menu area of viewer h: INTEGER _ 0, -- height list: LIST OF ViewerMenu _ NIL, inverted: EntryState _ NIL ]; ViewerMenu: TYPE = REF ViewerMenuRec; ViewerMenuRec: TYPE = RECORD [ commonData: InternalFormatMenuRef , -- data common to all instances of the menu entries: LIST OF EntryState _ NIL, active: BOOLEAN _ TRUE ]; EntryState: TYPE = REF EntryStateRec; EntryStateRec: TYPE = MONITORED RECORD [ width: INTEGER _ 0, xPos: INTEGER _ 0, yPos: INTEGER _ 0, greyed: BOOL _ FALSE, guardState: GuardState _ armed, commonData: EntryRef _ NIL ]; GuardState: TYPE = { guarded, arming, armed }; armingTime: Process.Milliseconds = 100; -- cover removal time. armedTime: Process.Milliseconds = 5000; -- unguarded interval. MarkMenu: PROC [menus: ViewerMenus, parent: Viewer, mousePos: TIPUser.TIPScreenCoords]; HitMenu: PROC [menus: ViewerMenus, parent: Viewer, mousePos: TIPUser.TIPScreenCoords, trigger: Menus.MenuEntryTrigger] ; ClearMenu: PROC [menus: ViewerMenus, parent: Viewer, paint: BOOL _ TRUE] ; DrawMenu: PROC [v: Viewer, menus: ViewerMenus, context: Imager.Context, whatChanged: REF ANY _ NIL]; ViewerlessAddMenu: PROC [name: ROPE, addBefore: ROPE _ NIL, paint: BOOL _ TRUE]; ReComputeMenus: PROC [v: Viewer] RETURNS[heightDelta: INTEGER]; ReComputeWindowMenus: PROC [v: Viewer, guard: BOOL, color: BOOL]; Debug: PROC [msg: ROPE, waitForLeftShift: BOOL _ TRUE, level: INTEGER _ 1]; AlterDebuggingLevel: PROC [amount: INTEGER, relative: BOOL _ TRUE]; END. MenusPrivate.mesa; Written by S. McGregor Edited by McGregor on July 21, 1983 10:43 am Last Edited by: Maxwell, December 17, 1982 9:59 am Last Edited by: Pausch, August 17, 1983 4:38 pm Implementor private stuff This data structure is used internally because pointers to the Entry fields are needed for the common representation to be accessed by the different menus that reference it. When a user registers a menu, a data structure of this type is created, differing only in that 'entries' is a LIST OF EntryRef, not a list of Entry. to be called when the mouse is pressed down over a menu, the proper inverse-video stuff is done. provided for convenience of BuildWindowMenus in WindowManagerImpl this will reset all fields in the data structure, including position and size of each entry. Κλ– "cedar" style˜JšΟc)™)Jš,™,Jšœ2™2J™/šΟk ˜ Jšœžœ ˜Jšœžœ˜&Jšœžœ˜Jšœžœžœ˜Jšœžœ˜ Jšœžœ˜)J˜—šœžœž œž˜'Jšœžœ˜$Jšžœžœžœ˜J˜—Jš™J˜Jšœžœ!˜Jšœ(˜>J˜J˜šΟnœžœI˜WJšœ`™`J˜—š œžœk˜xJ˜—Jš  œžœ-žœžœ˜JJ˜š  œžœGžœžœžœ˜dJ˜J˜—š œžœžœ žœžœ žœžœ˜PJšœA™AJ˜—Jš œžœ žœžœ˜?J˜š œžœžœ žœ˜AJšœ\™\—J˜Jš  œžœžœžœžœ žœ˜KJ˜Jš  œžœ žœ žœžœ˜CJ˜Jšžœ˜J˜J˜—…— ˆ‘