GGContainer.mesa
Last edited by Bier on June 5, 1985 10:41:44 pm PDT
Copyright © 1985 by Xerox Corporation. All rights reserved.
Author: Eric Bier July 15, 1985 12:04:58 pm PDT
A container-type class for Gargoyle.
Pier, December 6, 1985 10:01:28 am PST
DIRECTORY
ViewerOps USING [CreateViewer],
ViewerClasses USING [Viewer, ViewerRec];
GGContainer: CEDAR DEFINITIONS IMPORTS ViewerOps =
BEGIN
OPEN ViewerClasses;
GargoyleContainer: TYPE = ViewerClasses.Viewer;
Containers are just viewers that are convenient to hold other viewers.
Create:
PROC [info: ViewerRec ← [], paint:
BOOL ←
TRUE]
RETURNS [gargoyleContainer: GargoyleContainer] =
INLINE
{RETURN[ViewerOps.CreateViewer[$GargoyleContainer, info, paint]]};
Creates a new, empty container. You probably want to pass a name in the info record.
ChildYBound:
PROC [gargoyleContainer: GargoyleContainer, child: Viewer] =
INLINE
{gargoyleContainer.class.set[self: gargoyleContainer, data: child, op: $YBound]} ;
constrain (child.wy + child.wh = gargoyleContainer.wh)
after next time gargoyleContainer is painted
ChildXBound:
PROC [gargoyleContainer: GargoyleContainer, child: Viewer] =
INLINE
{gargoyleContainer.class.set[self: gargoyleContainer, data: child, op: $XBound]} ;
constrain (child.wx + child.ww = gargoyleContainer.ww)
after next time gargoyleContainer is painted
END.