File: SVViewerTool.mesa
Last edited by Bier on December 18, 1982 1:43 am
Copyright © 1984 by Xerox Corporation. All rights reserved.
Author: Eric Bier before July 30, 1984 2:01:43 am PDT
My very own container-type class for solid viewers
DIRECTORY
SVInterfaceTypes,
ViewerOps USING [CreateViewer],
ViewerClasses USING [Viewer, ViewerRec];
SVViewerTool: DEFINITIONS IMPORTS ViewerOps =
BEGIN
OPEN ViewerClasses;
SolidContainer: TYPE = SVInterfaceTypes.SolidContainer;
Containers are just viewers that are convenient to hold other viewers.
Create: PROC [info: ViewerRec ← [], paint: BOOLTRUE] RETURNS [solidContainer: SolidContainer] = 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 [solidContainer: SolidContainer, child: Viewer] = INLINE
{solidContainer.class.set[self: solidContainer, data: child, op: $YBound]} ;
constrain (child.wy + child.wh = solidViewerTool.wh)
after next time solidViewerTool is painted
ChildXBound: PROC [solidContainer: SolidContainer, child: Viewer] = INLINE
{solidContainer.class.set[self: solidContainer, data: child, op: $XBound]} ;
constrain (child.wx + child.ww = solidViewerTool.ww)
after next time solidViewerTool is painted
END.