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, menu: Menus.Menu _ NIL, tipTable: TIPUser.TIPTable _ NIL, icon: Icons.IconFlavor _ document, cursor: Cursors.CursorType _ textPointer, NoteSizeChanged: SizeChangeNotifyProc _ NIL]; SizeChangeNotifyProc: TYPE = PROC [container: MJSContainer, cw, ch: BOOL] RETURNS [paint: BOOL _ TRUE]; 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] = INLINE {container.class.set[self: container, data: child, op: $YBound]} ; ChildXBound: PROC [container: MJSContainer, child: Viewer] = INLINE {container.class.set[self: container, data: child, op: $XBound]} ; FlushChildX, FlushChildY: PROC [child: Viewer] RETURNS [changed: BOOL]; NoteSize: PROC [container: MJSContainer, mayPaint: BOOL] RETURNS [change: 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; 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 14, 1985 11:53:24 am 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). MJSContainers have an additional Class procedure: NoteSizeChanged. This proc gets called when cw or ch changes, and can request painting after it is done. The size change notification, as well as bounded child adjustment, is done by a forked process. MJSContainers have client data! 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.wh) after next time container is painted. Constrain (child.wx + child.ww = container.ww) 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. Reports whether anything (client or bounded children) changed. Paints if mayPaint AND change. Do NOT call NoteSize from within a ViewerClasses.PaintProc!. Returns the amount of the container scrolled off the top. Κ– "cedar" style˜JšΟcB™BJšœ3™3J™9J˜codešΟk œ/˜8K˜—KšΠbx œžœž œ˜"K˜Kšž˜K˜Kšœžœ˜$Kšœ žœ˜*Kšœžœ ˜K˜KšœF™FšœT™TK™¦Kšœš™šK™_K™—K˜Kšœžœžœ˜3šœžœžœ˜%Kšœ#žœ˜'Jšœ!žœ˜%Jšœ#žœ˜'Jšœ%žœ˜)Jšœžœ˜#Jšœžœ˜!Jšœžœ˜!Jšœžœ˜#Jšœžœ˜#Jšœ%žœ˜)Jšœžœ˜Jšœžœ˜!Jšœ"˜"Jšœ)˜)JšœΟiœžœ˜-—J˜KšΟnœžœžœ#žœžœ žœžœ˜gK˜K˜š‘ œžœžœ˜CJ™Dšœ™Jšœ$žœ™E——J˜š‘œžœžœžœ˜GJ™—J˜š ‘œžœžœžœžœžœ˜nKšW™W—K˜š‘ œžœ,ž˜CK˜BKšT™TK˜—š‘ œžœ,ž˜CK˜BKšT™T—K˜š ‘ œ‘ œžœžœ žœ˜GK™`—K˜š ‘œžœ%žœžœ žœ˜PK™*K™>Kšœ™Kšœ<™