ViewerMenusImpl.mesa;
Edited by McGregor on December 14, 1982 10:50 am
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]]};
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];
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.