ViewerMenusImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Edited by McGregor on December 14, 1982 10:50 am
Last Edited by: Maxwell, June 6, 1983 12:11 pm
Doug Wyatt, April 5, 1985 12:09:54 pm PST
DIRECTORY
Menus USING [ClickProc],
MessageWindow USING [Append, Blink],
ViewerClasses USING [Column, Viewer],
ViewerMenus USING [],
ViewerOps USING [Adjust, ChangeColumn, CloseViewer, DestroyViewer, GrowViewer, RestoreViewer, SaveViewer, TopViewer],
ViewerSpecs USING [],
WindowManager USING [colorDisplayOn];
ViewerMenusImpl: CEDAR PROGRAM
IMPORTS MessageWindow, ViewerOps, WindowManager
EXPORTS ViewerMenus
SHARES ViewerClasses, ViewerOps
= BEGIN OPEN Menus;
Destroy: PUBLIC ClickProc = {
viewer: ViewerClasses.Viewer ~ NARROW[parent];
IF viewer.inhibitDestroy THEN {
MessageWindow.Append["Sorry, this viewer can not be destroyed.", TRUE];
MessageWindow.Blink[];
RETURN;
};
ViewerOps.DestroyViewer[viewer];
};
Close: PUBLIC ClickProc = {ViewerOps.CloseViewer[NARROW[parent]]};
Grow: PUBLIC ClickProc = {ViewerOps.GrowViewer[NARROW[parent]]};
Save: PUBLIC ClickProc = {
viewer: ViewerClasses.Viewer ~ NARROW[parent];
IF viewer.newFile OR viewer.newVersion THEN ViewerOps.SaveViewer[viewer];
};
Restore: PUBLIC ClickProc = {ViewerOps.RestoreViewer[NARROW[parent]]};
Adjust: PUBLIC ClickProc = {ViewerOps.Adjust[NARROW[parent], mouseButton=red]};
Left: PUBLIC ClickProc = {
ViewerOps.ChangeColumn[NARROW[parent], left];
IF shift THEN ViewerOps.GrowViewer[NARROW[parent]];
};
Right: PUBLIC ClickProc = {
ViewerOps.ChangeColumn[NARROW[parent], right];
IF shift THEN ViewerOps.GrowViewer[NARROW[parent]];
};
Color: PUBLIC ClickProc = {
IF WindowManager.colorDisplayOn THEN {
ViewerOps.ChangeColumn[NARROW[parent], color];
IF shift THEN ViewerOps.GrowViewer[NARROW[parent]];
}
ELSE {
MessageWindow.Append["Sorry, the color display is not available.", TRUE];
MessageWindow.Blink[];
};
};
Top: PUBLIC ClickProc = {ViewerOps.TopViewer[NARROW[parent]]};
END.