CDShowErrorCommands.mesa
Copyright (C) 1984, 1985 by Xerox Corporation. All rights reserved.
Written by Shand, July 25, 1984 7:13:44 pm PDT
Last Edited by: Jacobi, February 16, 1985 5:34:35 pm PST
Last Edited by: Jacobi, April 11, 1985 9:16:36 am PST
DIRECTORY
TerminalIO USING [WriteRope, WriteLn],
CD USING [Design, ObPtr, ApplicationPtr, ApplicationList, DesignRect, lambda, highLightError],
CDSequencer USING [Command, ImplementCommand],
CDOps USING [AppList, DelayedRedraw, ReOrderApplication],
CDCommandOps USING [WriteInfo],
CDBasics USING [Extend],
CDMenus USING [CreateEntry],
CDViewer USING [ShowAndScale, ViewersOf, ViewerList],
CDApplications USING [ARectI];
CDShowErrorCommands: CEDAR PROGRAM
IMPORTS TerminalIO, CDMenus, CDSequencer, CDOps, CDCommandOps, CDBasics, CDViewer, CDApplications =
BEGIN
ShowErrorComm: PROCEDURE [comm: CDSequencer.Command] =
BEGIN
applList: CD.ApplicationList = CDOps.AppList[comm.design];
foundSome: BOOLFALSE;
TerminalIO.WriteRope[ "Show error "];
FOR a: CD.ApplicationList ← applList, a.rest WHILE a#NIL DO
IF a.first.ob.layer=CD.highLightError THEN {
aptr: CD.ApplicationPtr = a.first;
foundSome ← TRUE;
IF ~aptr.selected THEN {
eRect: CD.DesignRect = CDApplications.ARectI[aptr];
aptr.selected ← TRUE;
CDOps.DelayedRedraw[comm.design, eRect, FALSE];
CDCommandOps.WriteInfo[aptr];
TerminalIO.WriteLn[];
FOR vl: CDViewer.ViewerList ← CDViewer.ViewersOf[comm], vl.rest WHILE vl#NIL DO
CDViewer.ShowAndScale[viewer: vl.first, rect: CDBasics.Extend[eRect, 30*CD.lambda] ];
ENDLOOP;
CDOps.ReOrderApplication[comm.design, aptr];
EXIT
}
};
REPEAT FINISHED =>
IF foundSome THEN TerminalIO.WriteRope["All errors in this cell are already selected\n"]
ELSE TerminalIO.WriteRope[ "No errors in this cell\n"]
ENDLOOP;
END;
CDMenus.CreateEntry[menu: $SpecialMenu, entry: "select next error", key: $ShowErrors];
CDSequencer.ImplementCommand[$ShowErrors, ShowErrorComm,, doQueue];
END.