<> <> DIRECTORY Buttons, Rope, ViewerClasses; HierarchicalDisplays: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; Viewer: TYPE = ViewerClasses.Viewer; ViewerRec: TYPE = ViewerClasses.ViewerRec; Button: TYPE = Buttons.Button; Parent: TYPE = REF ParentRep; ParentRep: TYPE = RECORD [ container: Viewer, firstChild, lastChild: Child _ NIL, asChild: Child _ NIL, rx, ty: INTEGER _ 0, by: INTEGER _ minH]; minH: INTEGER = 10; Child: TYPE = REF ChildRep; ChildRep: TYPE = RECORD [ container: Viewer, forceNewline: BOOLEAN _ FALSE, nameButton: Button _ NIL, parent: Parent, next, prev: Child _ NIL, class: ChildClass, classData, instanceData: REF ANY, variant: SELECT type: ChildType FROM TypeLeaf => [value: Viewer], TypeParent => [asParent: Parent], ENDCASE]; ChildType: TYPE = {TypeLeaf, TypeParent}; Leaf: TYPE = REF ChildRep[TypeLeaf]; InternalNode: TYPE = REF ChildRep[TypeParent]; ChildClass: TYPE = REF ChildClassRep; ChildClassRep: TYPE = RECORD [ buttonProc: Buttons.ButtonProc, -- = Menus.MenuProc <> NotifyOnRemove: ChildNotifyProc _ NIL]; ChildNotifyProc: TYPE = PROC [child: Child]; LeafNotifyProc: TYPE = PROC [leaf: Leaf]; ValueCreater: TYPE = PROC [leaf: Leaf] RETURNS [value: Viewer]; CreateRoot: PROC [viewerInit: ViewerRec, paint: BOOLEAN _ TRUE] RETURNS [p: Parent]; AddLeaf: PROC [parent: Parent, before: Child, name: ROPE, class: ChildClass, classData, instanceData: REF ANY _ NIL, CreateValue: ValueCreater] RETURNS [leaf: Leaf]; AddInternalNode: PROC [parent: Parent, before: Child, name: ROPE, class: ChildClass, classData, instanceData: REF ANY _ NIL] RETURNS [internal: InternalNode]; Remove: PROC [child: Child]; Pack: PROC [parent: Parent, paint: BOOLEAN _ TRUE]; EnumerateChildren: PROC [to: ChildNotifyProc, from: Parent _ NIL, changedOnly: BOOLEAN _ FALSE, leaves, internals: BOOLEAN _ TRUE]; <> END.