ViewerMenusImpl.mesa;
Edited by McGregor on December 14, 1982 10:50 am
Last Edited by: Maxwell, February 18, 1983 3:43 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]]};
Save: PUBLIC MenuProc = BEGIN
viewer: ViewerClasses.Viewer ~ NARROW[parent];
IF viewer.newFile OR viewer.newVersion THEN ViewerOps.SaveViewer[viewer];
END;
Restore: PUBLIC MenuProc = {ViewerOps.RestoreViewer[NARROW[parent]]};
Adjust: PUBLIC MenuProc = {ViewerAdjust.Adjust[NARROW[parent], mouseButton=red]};
Left: PUBLIC MenuProc = {ViewerOps.ChangeColumn[NARROW[parent], left]};
Right: PUBLIC MenuProc = {ViewerOps.ChangeColumn[NARROW[parent], right]};
Color: PUBLIC MenuProc = BEGIN
IF WindowManager.colorDisplayOn THEN ViewerOps.ChangeColumn[NARROW[parent], color]
ELSE BEGIN
MessageWindow.Append["Sorry, the color display is not available.", TRUE];
MessageWindow.Blink[];
END;
END;
END.