DIRECTORY XTk USING [TQ, Widget, WidgetNotifyProc, WidgetSpec], XTkCommon USING [ChoiceElement, StyleSpec]; XTkChoiceWidgets: CEDAR DEFINITIONS ~ BEGIN WidgetSpec: TYPE = XTk.WidgetSpec; StyleSpec: TYPE = XTkCommon.StyleSpec; ChoiceWidget: TYPE = XTk.Widget; ChoiceElement: TYPE = XTkCommon.ChoiceElement; ChoiceList: TYPE = LIST OF ChoiceElement; IsChoice: PROC [w: XTk.Widget] RETURNS [BOOL]; CurrentChoice: PROC [widget: ChoiceWidget] RETURNS [REF ANY]; Choose: PROC [widget: ChoiceWidget, ce: ChoiceElement]; CreateChoices: PROC [widgetSpec: WidgetSpec ¬ [], choices: ChoiceList, horizontal: BOOL ¬ TRUE, hitProc: XTk.WidgetNotifyProc ¬ NIL, registerData: REF ¬ NIL, tq: XTk.TQ ¬ NIL, style: StyleSpec ¬ []] RETURNS [ChoiceWidget]; CreateToggle: PROC [widgetSpec: WidgetSpec ¬ [], choices: ChoiceList, hitProc: XTk.WidgetNotifyProc ¬ NIL, registerData: REF ¬ NIL, tq: XTk.TQ ¬ NIL, style: StyleSpec ¬ []] RETURNS [ChoiceWidget]; END. ΒXTkChoiceWidgets.mesa Copyright Σ 1991, 1992 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, July 2, 1991 1:58 pm PDT Christian Jacobi, April 7, 1992 11:28 am PDT Implements some choice widget classes. A choice is a widget which allows the user to make a choice. Choice widgets might sub class or delegate to text widgets. Returns whether w is a ChoiceWidget Returns key field of current choice Selects the feedback choice of a ChoiceWidget; Like interactive action, except the hitProc is not called. It is ok if only text or only key in ChoiceElement is defined. Use this for initializations. ChoiceWidget displays choices but marks the currently selected one. choices must not be NIL. The hitProc procedure is executed on thread [forked if NIL]. style: applied to all elements choices with NIL key can not be selected; all choices are visible. ChoiceWidget displays current options but can be toggled through choices. Κ•NewlineDelimiter –(cedarcode) style˜codešœ™Kšœ Οeœ7™BKšœ5™5K™,K™šœ(™(Kšœ<™™>Jšœ™J™—šŸ œžœ@žœžœ"žœžœžœ žœžœžœ˜ήKšœC™CKšœž™Kšœ7žœ™