<> <> <> <> <> <<>> DIRECTORY BasicTime, BiScrollers, Cursors, Geom2D, Imager, IO, Pipal, PipalInteractiveEdit, PipalEdit, PipalPaint, PipalReal, Process, Real, RefTab, TIPUser, ViewerClasses; PipalInteractiveEditImpl: CEDAR PROGRAM IMPORTS BasicTime, BiScrollers, Geom2D, Imager, PipalPaint, PipalReal, Process, TIPUser EXPORTS PipalInteractiveEdit = BEGIN OPEN PipalInteractiveEdit; <> lastBiscrollerPaintTime: BasicTime.Pulses; Create: PUBLIC PROC [editor: PipalEdit.Editor, tipTable: Pipal.ROPE, notify: ViewerClasses.NotifyProc, data: REF _ NIL] RETURNS [viewerData: ViewerData] ~ { style: BiScrollers.BiScrollerStyle _ BiScrollers.GetStyle["Buttonned"]; class: BiScrollers.BiScrollerClass _ style.NewBiScrollerClass[[ flavor: $PipalInteractiveEdit, extrema: Extrema, paint: BiscrollerPaint, notify: notify, bsUserAction: ForkAndDo, finish: LIST [$Exit], menu: BiScrollers.bsMenu, icon: fileCabinet, tipTable: TIPUser.InstantiateNewTIPTable[tipTable], cursor: textPointer, mayStretch: FALSE, offsetsMustBeIntegers: TRUE, preferIntegerCoefficients: FALSE ]]; info: ViewerClasses.ViewerRec _ [name: "Pipal", iconic: FALSE, data: NEW [ViewerDataRec _ [editor: editor, data: data]]]; bs: BiScrollers.BiScroller _ class.style.CreateBiScroller[class: class, info: info]; viewerData _ NARROW[BiScrollers.ClientDataOf[bs]]; }; Extrema: BiScrollers.ExtremaProc = { viewerData: ViewerData _ NARROW[clientData]; size: PipalReal.Size _ PipalReal.ObjectSize[viewerData.editor.object]; [min, max] _ Geom2D.ExtremaOfRect[[0.0, 0.0, size.x, size.y], direction]; }; BiscrollerPaint: ViewerClasses.PaintProc = { clipArea, outlines: LIST OF PipalReal.Rectangle _ NIL; viewerData: ViewerData _ NARROW [BiScrollers.ClientDataOfViewer[self]]; editor: PipalEdit.Editor = viewerData.editor; lastBiscrollerPaintTime _ BasicTime.GetClockPulses[]; <> Imager.SetColor[context, Imager.black]; Imager.MaskVector[context, [-1000, 0], [1000, 0]]; Imager.MaskVector[context, [0, -1000], [0, 1000]]; <> PipalPaint.Paint[editor, context]; lastBiscrollerPaintTime _ BasicTime.GetClockPulses[]-lastBiscrollerPaintTime; }; ForkAndDo: BiScrollers.BSUserActionProc ~ TRUSTED {Process.Detach[FORK BiScrollers.DoBSUserAction[bs, input]]}; <> <> <> <> <> <> <> < ViewerOps.PaintViewer[self, client]; -- until the day we have commands which change menus>> < ViewerOps.PaintViewer[self, client, FALSE, NEW [WhatChangedRec _ [clipArea: NARROW [result]]]];>> < ERROR; -- including object>> <<};>> <<>> <<};>> <<>> END.