ShowErrorsCommandImpl.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
Written by Shand, July 25, 1984 7:13:44 pm PDT
Last Edited by: Shand, July 26, 1984 1:56:10 am PDT
DIRECTORY
TerminalIO USING [WriteRope],
CD USING [Design, ObPtr, ApplicationPtr, ApplicationList, DesignRect, lambda, highLightError],
CDSequencer USING [Command, ImplementCommand],
CDOps USING [AppList, DelayedRedraw, ReOrderApplication],
CDCommandOps USING [WriteInfo],
CDInline USING [Extend],
CDViewer USING [ShowAndScale],
CDVPrivate USING [MyGraphicRef],
CDProperties USING [GetPropFromApplication],
CDApplications USING [ARectO]
;
ShowErrorsCommandImpl: CEDAR PROGRAM
IMPORTS TerminalIO, CDSequencer, CDOps, CDCommandOps, CDInline, CDViewer, --CDProperties,-- CDApplications
~ BEGIN
ZoomError:
PROCEDURE [comm: CDSequencer.Command] ~ {
applList: CD.ApplicationList ~ CDOps.AppList[comm.design];
foundSome: BOOLEAN ← FALSE;
FOR a:
CD.ApplicationList ← applList, a.rest
WHILE a #
NIL
DO
IF a.first.ob.level = CD.highLightError
THEN {
-- HORROR! INTERIM code awaiting a method to find the viewer associated with a command.
aptr: CD.ApplicationPtr ~ a.first;
IF aptr.selected #
TRUE
THEN {
mySheet: CDVPrivate.MyGraphicRef ~ NARROW[comm.ref];
eRect: CD.DesignRect ~ CDApplications.ARectO[aptr];
aptr.selected ← TRUE;
CDCommandOps.WriteInfo[aptr];
TerminalIO.WriteRope[ "\n"];
CDViewer.ShowAndScale[viewer~ mySheet.viewer, rect~ CDInline.Extend[eRect, 5*CD.lambda] ];
CDOps.DelayedRedraw[comm.design, eRect, FALSE];
CDOps.ReOrderApplication[comm.design, aptr];
EXIT
}
};
REPEAT
FINISHED =>
TerminalIO.WriteRope[ IF foundSome THEN "***All errors are already selected\n" ELSE "***No errors to show\n"];
ENDLOOP;
};
-- Module Initialization of SpinifexCommands
CDSequencer.ImplementCommand[$ShowErrors, ZoomError,, doQueue];
TerminalIO.WriteRope["ShowErrors loaded\n"]
END.