DIRECTORY BiScrollers, Icons, GGBasicTypes, GGEvent, GGInterfaceTypes, Rope, ViewerClasses, ViewerOps; GGContainerImpl: CEDAR PROGRAM IMPORTS BiScrollers, GGEvent, ViewerOps = BEGIN Viewer: TYPE = ViewerClasses.Viewer; Point: TYPE = GGBasicTypes.Point; GargoyleData: TYPE = GGInterfaceTypes.GargoyleData; GargoyleContainerPaint: PRIVATE ViewerClasses.PaintProc = CHECKED { gargoyleData: GargoyleData _ NARROW[self.data]; v: Viewer; update: BOOL _ FALSE; hdiff, wdiff: INTEGER; FOR l: LIST OF Viewer _ gargoyleData.xBounded, l.rest UNTIL l=NIL DO v _ l.first; IF v.destroyed THEN {update _ TRUE; LOOP}; wdiff _ v.ww-v.cw; v.ww _ MAX[v.parent.cw-v.wx-1, 5]; v.cw _ v.ww-wdiff; FOR vChild: Viewer _ v.child, vChild.sibling UNTIL vChild=NIL DO IF vChild.class.flavor=$BiScrollBarY THEN LOOP; wdiff _ vChild.ww-vChild.cw; vChild.ww _ MAX[v.cw-vChild.wx-1, 5]; vChild.cw _ vChild.ww-wdiff; ENDLOOP; ENDLOOP; FOR l: LIST OF Viewer _ gargoyleData.yBounded, l.rest UNTIL l=NIL DO v _ l.first; IF v.destroyed THEN {update _ TRUE; LOOP}; hdiff _ v.wh-v.ch; v.wh _ MAX[v.parent.ch-v.wy-1, 5]; v.ch _ v.wh-hdiff; FOR vChild: Viewer _ v.child, vChild.sibling UNTIL vChild=NIL DO IF vChild.class.flavor=$BiScrollBarX THEN LOOP; hdiff _ vChild.wh-vChild.ch; vChild.wh _ MAX[v.ch-vChild.wy-1, 5]; vChild.ch _ vChild.wh-hdiff; ENDLOOP; ENDLOOP; IF update THEN { oldx: LIST OF Viewer _ gargoyleData.xBounded; oldy: LIST OF Viewer _ gargoyleData.yBounded; gargoyleData.xBounded _ gargoyleData.yBounded _ NIL; FOR l: LIST OF Viewer _ oldx, l.rest UNTIL l=NIL DO IF ~l.first.destroyed THEN gargoyleData.xBounded _ CONS[l.first, gargoyleData.xBounded]; ENDLOOP; FOR l: LIST OF Viewer _ oldy, l.rest UNTIL l=NIL DO IF ~l.first.destroyed THEN gargoyleData.yBounded _ CONS[l.first, gargoyleData.yBounded]; ENDLOOP; }; }; GargoyleContainerDestroy: PRIVATE ViewerClasses.DestroyProc = CHECKED { }; GargoyleContainerSet: PRIVATE ViewerClasses.SetProc = CHECKED { child: Viewer; gargoyleData: GargoyleData _ NARROW[self.data]; IF data=NIL THEN RETURN; -- November 27, 1985 KAP child _ NARROW[data]; IF op=$YBound THEN gargoyleData.yBounded _ CONS[child, gargoyleData.yBounded] ELSE IF op=$XBound THEN gargoyleData.xBounded _ CONS[child, gargoyleData.xBounded] ELSE ERROR; }; GargoyleContainerSave: ViewerClasses.SaveProc = { gargoyleData: GargoyleData _ NARROW[BiScrollers.ClientDataOfViewer[self.child.child]]; filename: Rope.ROPE _ IF gargoyleData.outer.file=NIL THEN "Emergency.gargoyle" ELSE gargoyleData.outer.file; GGEvent.Store[LIST[$Emergency, filename], gargoyleData]; -- save the action area }; GargoyleContainerInit: PRIVATE ViewerClasses.InitProc = CHECKED {}; gargoyleContainerClass: ViewerClasses.ViewerClass _ NEW[ViewerClasses.ViewerClassRec _ [ init: GargoyleContainerInit, paint: GargoyleContainerPaint, destroy: GargoyleContainerDestroy, set: GargoyleContainerSet, save: GargoyleContainerSave, -- used when Shift-Shift-Swat is invoked topDownCoordSys: TRUE ]]; ViewerOps.RegisterViewerClass[$GargoyleContainer, gargoyleContainerClass]; -- plug in to Viewers END. hGGContainerImpl.mesa Last edited by Bier on August 12, 1986 9:48:55 pm PDT Copyright c 1985 by Xerox Corporation. All rights reserved. Created on June 5, 1985 11:16:46 pm PDT A container-type class for Gargoyle. Pier, August 14, 1986 10:49:36 am PDT Do children of v as well as v Do children of v as well as v IF gargoyleData.xBounded#NIL OR gargoyleData.yBounded#NIL THEN ViewerOps.ResetPaintCache[self, FALSE]; Add a constrained child to the list. IF child.parent#self THEN ERROR; -- November 27, 1985 KAP [self: ViewerClasses.Viewer, force: BOOL _ FALSE] icon: Icons.NewIconFromFile["SolidViews.icons", 0] Κο˜code™Kšœ5™5Kšœ Οmœ1™