DIRECTORY Menus USING [Menu, MenuEntryTrigger], MessageWindow USING [Append, Blink], ViewerClasses USING [Column, NotifyProc, Viewer], ViewerOps, ViewerSpecs, WindowManager USING [colorDisplayOn]; ViewerMenusImpl: CEDAR PROGRAM IMPORTS MessageWindow, ViewerOps, WindowManager SHARES ViewerClasses, ViewerOps = BEGIN windowDestroyMenu: Menu = [name: "windowDestroyMenu", beginsActive: TRUE, breakBefore: FALSE, breakAfter: FALSE, notify: ViewerMenuNotifier, entries: LIST[ ["Destroy", FALSE, "Destroy", LIST [ [LIST[all],LIST[$DestroyViewer],"Destroy the Viewer", "", NIL,NIL,NIL] ] ]; windowGuardedDestroyMenu: Menu = [name: "windowGuardedDestroyMenu", beginsActive: TRUE, breakBefore: FALSE, breakAfter: FALSE, notify: ViewerMenuNotifier, entries: LIST[ ["Destroy", TRUE, "Destroy", LIST [ [LIST[all],LIST[$DestroyViewer],"Destroy the Viewer", "Edits will be discarded...", NIL,NIL,NIL] ] ]; windowMovementMenu: Menu = [name: windowMovementMenu", beginsActive: TRUE, breakBefore: FALSE, breakAfter: FALSE, notify: ViewerMenuNotifier, entries: LIST[ ["Adjust", FALSE, "Adjust", LIST[ [LIST[all], LIST[$AdjustViewerSticky], "Adjust Viewer Size", "", NIL, NIL, NIL] ] ], ["Top", FALSE, "Top", LIST[ [LIST[all], LIST[$MoveViewerToTop], "Move Viewer To Top Of Column", "", NIL, NIL, NIL] ] ], ["Left", FALSE, "", LIST[ [LIST[shiftleftup, shiftmiddleupup, shiftrightup], LIST[$MoveViewerToLeftColumn, $GrowViewer], "Move To Left Column and Grow ", "", NIL, NIL, NIL], [LIST[all], LIST[$MoveViewerToLeft], "Move Viewer To Left Column", "", NIL, NIL, NIL] ] ], ["Right", FALSE, "", LIST[ [LIST[shiftleftup, shiftmiddleupup, shiftrightup], LIST[$MoveViewerToRightColumn, $GrowViewer], "Move To Right Column and Grow ", "", NIL, NIL, NIL], [LIST[all], LIST[$MoveViewerToRight], "Move Viewer To Right Column", "", NIL, NIL, NIL] ] ] ] ]; windowColorMenu: Menu = [name: "windowColorMenu", beginsActive: FALSE, breakBefore: FALSE, breakAfter: FALSE, notify: ViewerMenuNotifier, entries: LIST[ ["Color", FALSE, "Color", LIST[ [LIST[shiftleftup, shiftmiddleupup, shiftrightup], LIST[$MoveViewerToColorColumnAndGrow], "Move To Color Display and Grow ", "", NIL, NIL, NIL], [LIST[all], LIST[$MoveViewerToColorColumn], "Move Viewer To Color Display", "", NIL, NIL, NIL] ] ] ] ]; windowSizeMenu: Menu = [name: "windowSizeMenu", beginsActive: FALSE, breakBefore: FALSE, breakAfter: FALSE, notify: ViewerMenuNotifier, entries: LIST[ ["Grow", FALSE, "Grow", LIST[ [LIST[all],LIST[$GrowViewer],"Grow the Viewer", "", NIL,NIL,NIL] ] ], ["Close", FALSE, "Close", LIST[ [LIST[all],LIST[$CloseViewer],"Close the Viewer", "", NIL,NIL,NIL] ] ], ] ]; ViewerMenuNotifier: ViewerClasses.NotifyProc = { FOR current: LIST OF REF ANY _ input, current.rest UNTIL current = NIL DO SELECT current.first FROM $DestroyViewer => Destroy[self]; $CloseViewer => ViewerOps.CloseViewer[self]; $GrowViewer => ViewerOps.GrowViewer[self]; $MoveViewerToTop => ViewerOps.TopViewer[self]; $AdjustViewer => ViewerOps.Adjust[self]; $MoveViewerToLeftColumn => ViewerOps.ChangeColumn[self, left]; $MoveViewerToRightColumn => ViewerOps.ChangeColumn[self, right]; $MoveViewerToColorColumn => MoveToColorColumn[viewer: self, doGrow: FALSE]; $MoveViewerToColorColumnAndGrow => MoveToColorColumn[viewer: self, doGrow:TRUE]; ENDCASE => ERROR; ENDLOOP; }; Destroy: PROC[viewer: ViewerClasses.Viewer] = { IF ~viewer.inhibitDestroy THEN ViewerOps.DestroyViewer[viewer] ELSE {MessageWindow.Append["Sorry, this viewer can not be destroyed.", TRUE]; MessageWindow.Blink[]}; }; MoveToColorColumn: PRIVATE PROC[viewer: ViewerClasses.Viewer, doGrow: BOOL _ FALSE] = { IF WindowManager.colorDisplayOn THEN { ViewerOps.ChangeColumn[viewer, color]; IF doGrow THEN ViewerOps.GrowViewer[viewer]} ELSE BEGIN MessageWindow.Append["Sorry, the color display is not available.", TRUE]; MessageWindow.Blink[]; END; }; END. ζViewerMenusImpl.mesa; Written by S. McGregor Edited by McGregor on July 14, 1983 1:22 pm Last Edited by: Maxwell, June 6, 1983 12:11 pm Last Edited by: Pausch, August 12, 1983 12:21 pm [self: Viewer, input: LIST OF REF ANY] Κ€– "cedar" style˜JšΟc,™,Jš+™+Jšœ.™.J™0šΟk ˜ Jšœžœ˜%Jšœžœ˜$Jšœžœ˜1J˜ J˜ Jšœžœ˜%J˜—Jšœžœž˜J˜Jšžœ(˜/Jšžœ˜!J˜Jšžœ˜J˜šœ˜šœ˜Jšœžœ˜Jšœ žœ˜Jšœ žœ˜Jšœ˜šœ žœ˜šœ žœžœ˜%Jš œžœžœ+žœžœžœ˜GJ˜—J˜—J˜—J˜—šœ"˜"šœ#˜#Jšœžœ˜Jšœ žœ˜Jšœ žœ˜Jšœ˜šœ žœ˜šœ žœžœ˜$Jš œžœžœEžœžœžœ˜aJ˜—J˜—J˜—J˜—šœ˜šœ˜Jšœžœ˜Jšœ žœ˜Jšœ žœ˜Jšœ˜šœ žœ˜šœ žœ žœ˜!Jš œžœžœ2žœžœžœ˜PJ˜—šœžœ žœ˜Jš œžœžœ9žœžœžœ˜XJ˜—šœ žœžœ˜šœžœ-˜2JšžœNžœžœžœ˜a—Jš œžœžœ8žœžœžœ˜VJ˜—šœ žœžœ˜šœžœ-˜2JšžœPžœžœžœ˜c—Jš œžœžœ:žœžœžœ˜XJ˜—J˜—J˜—J˜—šœ˜šœ˜Jšœžœ˜Jšœ žœ˜Jšœ žœ˜Jšœ˜šœ žœ˜šœ žœ žœ˜šœžœ-˜2JšžœKžœžœžœ˜^—Jš œžœžœAžœžœžœ˜_J˜—J˜—J˜—J˜—šœ˜šœ˜Jšœžœ˜Jšœ žœ˜Jšœ žœ˜Jšœ˜šœ žœ˜šœ žœ žœ˜Jš œžœžœ%žœžœžœ˜AJ˜—šœ žœ žœ˜Jš œžœžœ'žœžœžœ˜CJ˜—J˜—˜J˜—J˜——˜0Jšœ&™&šžœ žœžœžœžœžœ žœž˜Išžœž˜J˜ Jšœ,˜,Jšœ*˜*Jšœ.˜.Jšœ(˜(Jšœ>˜>Jšœ@˜@JšœDžœ˜KJšœJžœ˜PJšžœžœ˜—Jšžœ˜—˜J˜——šΟnœžœ"˜/Jšžœžœ ˜>šžœCžœ˜MJ˜—Jšœ˜J˜—J˜šŸœž œ'žœžœ˜Wšžœžœ˜&Jšœ&˜&Jšžœžœ˜,—šžœž˜ JšœCžœ˜IJ˜Jšžœ˜—Jšœ˜J˜—Jšžœ˜J˜J˜—…—J°