DIRECTORY Rope USING [ROPE], Xl USING [Connection, Font, Size], XTk USING [Class, ImplementorClass, Widget, WidgetSpec], XTkCommon USING [RepaintMode, StyleSpec]; XTkLabels: CEDAR DEFINITIONS ~ BEGIN TextWidget: TYPE = XTk.Widget; StyleSpec: TYPE = XTkCommon.StyleSpec; RepaintMode: TYPE = XTkCommon.RepaintMode; CreateLabel: PROC [widgetSpec: XTk.WidgetSpec ¬ [], text: Rope.ROPE ¬ NIL, style: StyleSpec ¬ []] RETURNS [TextWidget]; GetText: PROC [widget: TextWidget] RETURNS [Rope.ROPE]; GetStyleSpec: PROC [widget: TextWidget] RETURNS [StyleSpec]; SetText: PROC [widget: TextWidget, text: Rope.ROPE, repaint: RepaintMode ¬ immediately]; SetStyleSpec: PROC [widget: TextWidget, style: StyleSpec, repaint: RepaintMode ¬ immediately]; SetStyleKey: PROC [widget: TextWidget, styleKey: ATOM ¬ NIL, repaint: RepaintMode ¬ immediately]; labelClass: READONLY XTk.Class; GetTextProc: TYPE = PROC [widget: TextWidget] RETURNS [text: Rope.ROPE]; SetTextProc: TYPE = PROC [widget: TextWidget, text: Rope.ROPE, repaint: RepaintMode]; GetStyleSpecProc: TYPE = PROC [widget: TextWidget] RETURNS [style: StyleSpec]; SetStyleSpecProc: TYPE = PROC [widget: TextWidget, style: StyleSpec, repaint: RepaintMode]; SetStyleKeyProc: TYPE = PROC [widget: TextWidget, style: ATOM, repaint: RepaintMode]; LabelClassRec: TYPE = RECORD [ getText: GetTextProc, setText: SetTextProc, getStyleSpec: GetStyleSpecProc, setStyleSpec: SetStyleSpecProc, setStyleKey: SetStyleKeyProc ]; NewLabelClassPart: PROC [subClass: XTk.ImplementorClass] RETURNS [REF LabelClassRec]; GetDefaultFont: PROC [c: Xl.Connection] RETURNS [font: Xl.Font]; END. φXTkLabels.mesa Copyright Σ 1991 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, July 2, 1991 1:58 pm PDT Christian Jacobi, April 7, 1992 11:37 am PDT Implements a label widget class. A label is a piece of text which can not be directly changed by editing operations. Client accessible functions Parameter used in procedures modifying a TextWidget to specify optional repaint. Creates a label widget. Returns current text in widget. Returns current style of widget. Replaces text displayed with widget; This does not cause a size change. Replaces style of displayed text. Replaces style of displayed text. Functions which allow subclassing. Modifies subClass to use a new copy of the LabelClassRec. Returns a ref to the new copy which can be changed safely. (The new copy replaces the default original LabelClassRec used for further sub-sub-classes). Generic procedures Might be handy for other applications too. Get default font (from cache, or, using database query). Κά•NewlineDelimiter –(cedarcode) style˜codešœ™Kšœ Οeœ1™˜[KšœŸœŸœŸœ˜UK˜šœŸœŸœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜K˜—š œŸœ"ŸœŸœ˜UKšœΣ™Σ—K˜—š‘™Kšœ*™*K˜š œŸœŸœ˜@K™8——K˜KšŸœ˜K˜K˜—…—X *