DIRECTORY Cursors, Icons, Menus, TIPUser, ViewerClasses; MJSContainers: CEDAR DEFINITIONS = BEGIN Viewer: TYPE = ViewerClasses.Viewer; ViewerRec: TYPE = ViewerClasses.ViewerRec; MJSContainer: TYPE = Viewer; MJSContainerClass: TYPE = REF MJSContainerClassRep; MJSContainerClassRep: TYPE = RECORD [ notify: ViewerClasses.NotifyProc _ NIL, paint: ViewerClasses.PaintProc _ NIL, modify: ViewerClasses.ModifyProc _ NIL, destroy: ViewerClasses.DestroyProc _ NIL, copy: ViewerClasses.CopyProc _ NIL, set: ViewerClasses.SetProc _ NIL, get: ViewerClasses.GetProc _ NIL, init: ViewerClasses.InitProc _ NIL, save: ViewerClasses.SaveProc _ NIL, caption: ViewerClasses.CaptionProc _ NIL, adjust: ViewerClasses.AdjustProc _ NIL, childAdjust: ChildAdjustProc _ NIL, menu: Menus.Menu _ NIL, tipTable: TIPUser.TIPTable _ NIL, icon: Icons.IconFlavor _ document, cursor: Cursors.CursorType _ textPointer]; ChildAdjustProc: TYPE = PROC [parent, child: Viewer] RETURNS [viewerToPaint: Viewer _ NIL, paintColumn: BOOL _ FALSE]; RegisterClass: PROC [viewerFlavor: ATOM, class: MJSContainerClass]; GetClass: PROC [viewerFlavor: ATOM] RETURNS [class: MJSContainerClass]; Create: PROC [viewerFlavor: ATOM, info: ViewerRec _ [], paint: BOOL _ TRUE] RETURNS [container: MJSContainer]; ChildYBound: PROC [container: MJSContainer, child: Viewer]; ChildXBound: PROC [container: MJSContainer, child: Viewer]; FlushChildX, FlushChildY: PROC [child: Viewer] RETURNS [changed: BOOL]; NoteSize: PROC [container: MJSContainer, mayPaint: BOOL] RETURNS [change: BOOL]; NoteChildSize: PROC [child: Viewer] RETURNS [viewerToPaint: Viewer, paintColumn: BOOL]; ScrollOffset: PROC [container: MJSContainer] RETURNS [offTop: INTEGER] ; GetClientData: PROC [container: MJSContainer] RETURNS [clientData: REF ANY]; IsMJSContainer: PROC [viewer: Viewer] RETURNS [BOOL]; END. ψMJSContainers.mesa Copyright c 1986 by Xerox Corporation. All rights reserved. Cloned from Containers.mesa, Edited by McGregor on October 21, 1982 4:10 pm Last Edited by: Maxwell, December 17, 1982 10:07 am Last Edited by: Spreitzer, April 25, 1986 4:18:13 pm PST Containers are just viewers that are convenient to hold other viewers. MJSContainers differ from standard ones (date of divergance: July 11, 1983) in that: MJSContainer is a subClass of Viewer. Clients may make their own subClass of MJSContainer (there is a standard subClass, VanillaMJSContainer, which may also be used), and thus MJSContainers have client data! An MJSContainer may have a ChildAdjustProc. Hint that a child viewer's size may have changed; can err in either direction. Can move anything around, but don't paint; return values indicate what needs painting. This must be called before you try to instantiate any of that class. Module start code does: RegisterClass[$VanillaMJSContainer, NEW [MJSContainerClassRep _ []]]; Returns NIL if no such class. Creates a new, empty MJSContainer. Pass client data in info.data (it won't stay there). Constrain (child.wy + child.wh = container.ch) after next time container is painted. Constrain (child.wx + child.ww = container.cw) after next time container is painted. Stretch child to indicated edge (without painting). Answer indicates work was needed to be done. Considers notifying client of size change. Does not propogate information `upward'. Reports whether anything (client or bounded children) changed. Paints if mayPaint AND change. Do NOT call NoteSize from within a ViewerClasses.PaintProc! Don't worry about calling this as a companion of Viewers calls --- Viewers takes care of that via the AdjustProc. Propogates size information up the viewers hierarchy, and reports lowest ancestor the painting of which covers changes. Do NOT call from within a PaintProc or AdjustProc! Viewers doesn't call this for you; you have to do it yourself. Returns the amount of the container scrolled off the top. Κ7– "cedar" style˜šΟc™Icodešœ Οmœ1™Kšœ™Kšœ;™;K™qK™—K˜š‘ œŸœŸœ&Ÿœ˜WK™wK™2K™>—K˜š‘ œŸœŸœ Ÿœ˜HJš9™9—J˜Kš ‘ œŸœŸœŸœŸœ˜LKš‘œŸœŸœŸœ˜5K˜KšŸœ˜K˜K˜—…—:i