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, June 11, 1985 10:21:21 am PDT
DIRECTORY
TerminalIO USING [WriteRope, WriteLn],
CD USING [Design, Object, Instance, InstanceList, Rect, lambda, highLightError],
CDSequencer USING [Command, ImplementCommand],
CDOps USING [InstList, DelayedRedraw, ReOrderInstance],
CDCommandOps USING [WriteInfo],
CDBasics USING [Extend],
CDMenus USING [CreateEntry],
CDViewer USING [ShowAndScale, ViewersOf, ViewerList],
CDInstances USING [InstRectI];
CDShowErrorCommands:
CEDAR
PROGRAM
IMPORTS TerminalIO, CDMenus, CDSequencer, CDOps, CDCommandOps, CDBasics, CDViewer, CDInstances =
BEGIN
ShowErrorComm:
PROCEDURE [comm: CDSequencer.Command] =
BEGIN
applList: CD.InstanceList = CDOps.InstList[comm.design];
foundSome: BOOL ← FALSE;
TerminalIO.WriteRope[ "Show error "];
FOR a:
CD.InstanceList ← applList, a.rest
WHILE a#
NIL
DO
IF a.first.ob.layer=
CD.highLightError
THEN {
inst: CD.Instance = a.first;
foundSome ← TRUE;
IF ~inst.selected
THEN {
eRect: CD.Rect = CDInstances.InstRectI[inst];
inst.selected ← TRUE;
CDOps.DelayedRedraw[comm.design, eRect, FALSE];
CDCommandOps.WriteInfo[inst];
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.ReOrderInstance[comm.design, inst];
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.