Containers.mesa; Written by S. McGregor
Edited by McGregor on July 21, 1983 10:58 am
Last Edited by: Maxwell, December 17, 1982 10:07 am
DIRECTORY
ViewerOps USING [CreateViewer],
ViewerClasses USING [Viewer, ViewerRec];
Containers: CEDAR DEFINITIONS IMPORTS ViewerOps = BEGIN OPEN ViewerClasses;
Container: TYPE = Viewer;
Containers are just viewers that are convenient to hold other viewers.
Create: PROC [info: ViewerRec ← [], paint: BOOLTRUE] RETURNS [container: Container] =
INLINE {RETURN[ViewerOps.CreateViewer[$Container, info, paint]]};
Creates a new, empty container. You probably want to pass a name in the info record.
ChildYBound: PROC [container: Container, child: Viewer] = INLINE
{container.class.set[self: container, data: child, op: $YBound]} ;
Constrain (child.wy + child.wh = container.wh) after next time container is painted.
ChildXBound: PROC [container: Container, child: Viewer] = INLINE
{container.class.set[self: container, data: child, op: $XBound]} ;
Constrain (child.wx + child.ww = container.ww) after next time container is painted.
ScrollOffset: PROC [container: Container] RETURNS [offTop: INTEGER] ;
Returns the amount of the container scrolled off the top.
A fast child move proc will go here someday.
END.