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
DIRECTORY
Menus USING [MenuProc],
MessageWindow USING [Append, Blink],
ViewerAdjust USING [Adjust],
ViewerClasses USING [Column, Viewer],
ViewerMenus,
ViewerOps,
ViewerSpecs,
WindowManager USING [colorDisplayOn];
ViewerMenusImpl: CEDAR PROGRAM
IMPORTS MessageWindow, ViewerAdjust, ViewerOps, WindowManager
EXPORTS ViewerMenus
SHARES ViewerClasses, ViewerOps =
BEGIN OPEN Menus;
Destroy: PUBLIC MenuProc = BEGIN
viewer: ViewerClasses.Viewer ~ NARROW[parent];
IF ~viewer.inhibitDestroy THEN ViewerOps.DestroyViewer[viewer]
ELSE {MessageWindow.Append["Sorry, this viewer can not be destroyed.", TRUE];
MessageWindow.Blink[]};
END;
Close: PUBLIC MenuProc = {ViewerOps.CloseViewer[NARROW[parent]]};
Grow: PUBLIC MenuProc = {ViewerOps.GrowViewer[NARROW[parent]]};
Top: PUBLIC Menus.MenuProc = {ViewerOps.TopViewer[NARROW[parent]]};
Save: PUBLIC MenuProc = BEGIN
viewer: ViewerClasses.Viewer ~ NARROW[parent];
IF viewer.newFile OR viewer.newVersion THEN ViewerOps.SaveViewer[viewer];
END;
Reset: PUBLIC MenuProc = {ViewerOps.RestoreViewer[NARROW[parent]]};
Adjust: PUBLIC MenuProc = {ViewerAdjust.Adjust[NARROW[parent], mouseButton=red]};
Left: PUBLIC MenuProc = {
ViewerOps.ChangeColumn[NARROW[parent], left];
IF shift THEN ViewerOps.GrowViewer[NARROW[parent]]};
Right: PUBLIC MenuProc = {
ViewerOps.ChangeColumn[NARROW[parent], right];
IF shift THEN ViewerOps.GrowViewer[NARROW[parent]]};
Color: PUBLIC MenuProc = BEGIN
IF WindowManager.colorDisplayOn THEN {
ViewerOps.ChangeColumn[NARROW[parent], color];
IF shift THEN ViewerOps.GrowViewer[NARROW[parent]]}
ELSE BEGIN
MessageWindow.Append["Sorry, the color display is not available.", TRUE];
MessageWindow.Blink[];
END;
END;
END.