<> <> <> <> <> 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.