<> <> <> <> 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], <> 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 } ELSE foundSome _ TRUE }; 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.