DIRECTORY XTk USING [Class, Widget, WidgetSpec]; XTkContainers: CEDAR DEFINITIONS ~ BEGIN Widget: TYPE = XTk.Widget; WidgetSpec: TYPE = XTk.WidgetSpec; ContainerWidget: TYPE = Widget; Orientation: TYPE = MACHINE DEPENDENT {inX, inY}; yStack: READONLY XTk.Class; xStack: READONLY XTk.Class; container: READONLY XTk.Class; CreateYStack: PROC [widgetSpec: WidgetSpec ¬ [], stack: LIST OF Widget ¬ NIL, force: INT ¬ -1] RETURNS [ContainerWidget]; CreateXStack: PROC [widgetSpec: WidgetSpec ¬ [], stack: LIST OF Widget ¬ NIL, force: INT ¬ -1] RETURNS [ContainerWidget]; CreateAbut: PROC [widgetSpec: WidgetSpec ¬ [], children: LIST OF Widget ¬ NIL, orient: Orientation ¬ inX, force: INT ¬ -1] RETURNS [ContainerWidget]; CreateContainer: PROC [widgetSpec: WidgetSpec ¬ [], children: LIST OF Widget ¬ NIL] RETURNS [ContainerWidget]; AppendChild: PROC [container: ContainerWidget, child: Widget, startReconfigure: BOOL ¬ TRUE]; AppendChildren: PROC [container: ContainerWidget, children: LIST OF Widget, startReconfigure: BOOL ¬ TRUE]; RemoveChild: PROC [container: ContainerWidget, child: Widget, destroyChild: BOOL ¬ TRUE, startReconfigure: BOOL ¬ TRUE]; SetForce: PROC [container: ContainerWidget, force: INT]; SetVaryingSize: PROC [childOfStack: XTk.Widget, varyingSize: BOOL ¬ TRUE]; END. XTkContainers.mesa Copyright Σ 1988, 1991, 1992 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, October 18, 1988 10:46:22 am PDT Christian Jacobi, August 7, 1991 6:15 pm PDT Implements some simple widget container classes. Stacks children vertically. Stacks children horizontally. Children keep position and size from creation time. Container which abuts children in Y direction. force: force children height; -1 to leave individual; 0 to split equal. Container which abuts children in X .direction force: force children width; -1 to leave individual; 0 to split equal Container which abuts children in direction orient. force: whether children should all have this size in orientation; -1 means use individual size of children; 0 to split equal. Container which draws children at their requested size and position. Append child as last child to ContainerWidget. Callable from any thread. Append children to ContainerWidget. Callable from any thread. Removes child from ContainerWidget. Callable from any thread. force: forces children height in stacks. -1 to leave individual sizes; 0 to split equal. Delayed until next reconfigure. Maybe ignored if container has "varying sized" child. If childOfStack is actually used as a child of an stack, childOfStack will be sized varying. (The varying sized children will be stretched to match the size of the container; the non-varying sized children will get their desired size, if possible) . Ignored if childOfStack is used in different context. ΚΨ•NewlineDelimiter –(cedarcode) style˜codešœ™Kšœ Οeœ=™HKšœ=™=Kšœ,™,K™K™0K™—šΟk œ˜ Kšœžœ˜&K˜—KšΟn œžœž ˜ Kšœžœ˜K™Kšœžœ˜Kšœ žœ˜"Kšœžœ ˜Kšœ žœžœž œ ˜1K˜šœžœ ˜K™—šœžœ ˜K™—šœ žœ ˜K™3—K™šŸ œžœ&žœžœ žœ žœžœ˜yKšΟc.™.Kš G™GK˜—šŸ œžœ&žœžœ žœ žœžœ˜yKš .™.Kš E™EK˜—šŸ œžœ)žœžœ žœ$žœžœ˜•Kš 3™3Kš ~™~K˜—š Ÿœžœ)žœžœ žœžœ˜nKš D™DK˜—šŸ œžœ?žœžœ˜]Kš œ ™/Kš ™K˜—š Ÿœžœ(žœžœžœžœ˜kKš œ ™$Kš ™K™—š Ÿ œžœ;žœžœžœžœ˜xKš œ ™$Kš ™K™—šŸœžœ%žœ˜8Kš (™(Kš /™/Kš  !œœœœœœœ  œ ™W—K˜šŸœžœ)žœžœ˜JKš œ  *œ  ΅™ϊK™6K™—Kšžœ˜K˜—…— μ