-- File: SVViewerTool.mesa -- Last edited by Bier on December 18, 1982 1:43 am -- Author: Eric Bier before August 5, 1983 8:00 pm -- My very own container-type class for solid viewers DIRECTORY ViewerOps USING [CreateViewer], ViewerClasses USING [Viewer, ViewerRec]; SVViewerTool: DEFINITIONS IMPORTS ViewerOps = BEGIN OPEN ViewerClasses; SolidViewerTool: TYPE = Viewer; ViewerToolData: TYPE = REF ViewerToolDataObj; ViewerToolDataObj: TYPE = RECORD [ outer: SVViewerTool.SolidViewerTool _ NIL, -- handle for the enclosing container height: CARDINAL _ 0, textSection: ViewerTextData, viewerPicture: ViewerClasses.Viewer _ NIL, editToolData: REF ANY, -- to get rid of compilation dependencies yBounded: LIST OF Viewer _ NIL, xBounded: LIST OF Viewer _ NIL ]; ViewerTextData: TYPE = RECORD [ activateLabel: ViewerClasses.Viewer _ NIL, viewStyle: ViewerClasses.Viewer _ NIL, ais: ViewerClasses.Viewer _ NIL, text: ViewerClasses.Viewer _ NIL, xyz: ViewerClasses.Viewer _ NIL, focalLength: ViewerClasses.Viewer _ NIL, projection: ViewerClasses.Viewer _ NIL, selected: ViewerClasses.Viewer _ NIL, isSelected: BOOL ]; -- Containers are just viewers that are convenient to hold other viewers. Create: PROC [info: ViewerRec _ [], paint: BOOL _ TRUE] RETURNS [solidViewerTool: SolidViewerTool] = INLINE {RETURN[ViewerOps.CreateViewer[$SolidViewerTool, info, paint]]}; -- Creates a new, empty container. You probably want to pass a name in the info record. ChildYBound: PROC [solidViewerTool: SolidViewerTool, child: Viewer] = INLINE {solidViewerTool.class.set[self: solidViewerTool, data: child, op: $YBound]} ; -- constrain (child.wy + child.wh = solidViewerTool.wh) -- after next time solidViewerTool is painted ChildXBound: PROC [solidViewerTool: SolidViewerTool, child: Viewer] = INLINE {solidViewerTool.class.set[self: solidViewerTool, data: child, op: $XBound]} ; -- constrain (child.wx + child.ww = solidViewerTool.ww) -- after next time solidViewerTool is painted END. Ę˜JšrĪc¸œĪk œ žœ!žœ%ž œžœ žœžœ"žœžœžœ'žœžœ*žœ&œ žœKžœžœžœ*œ žœžœ žœ žœžœ žœžœžœ*žœ%žœžœ žœžœ'žœ&žœ$žœžœ JœĪnœžœžœžœžœ'žœžœ;YœŸ œžœ5žœR8œ.œŸ œžœ5žœR8œ.œžœ˜Ū—…—āí