TBQueue.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Willie-Sue, May 7, 1985 6:40:18 pm PDT
Interface: Provides TiogaButtons that are automatically serialized
Modeled after MBQueue
DIRECTORY
MBQueue USING [Queue],
Rope USING [ROPE],
TiogaButtons USING [TiogaButtonProc, TiogaButton],
TiogaOps USING [Ref],
ViewerClasses USING [Viewer];
TBQueue: CEDAR DEFINITIONS =
BEGIN
Queue: TYPE = MBQueue.Queue;
ROPE: TYPE = Rope.ROPE;
CreateTiogaButton: PROC [
q: Queue, viewer: ViewerClasses.Viewer, rope: ROPENIL, format: ROPENIL,
looks: ROPENIL, proc: TiogaButtons.TiogaButtonProc, clientData: REF ANYNIL,
fork: BOOLTRUE, paint: BOOLTRUE ]
RETURNS [TiogaButtons.TiogaButton];
Identical to TiogaButtons.CreateButton, except for the first argument q. Defines a button that
is interpreted in the context of q.
CreateTiogaButtonFromNode: PROC [
q: Queue, node: TiogaOps.Ref, start: INT ← 0, end: INTINT.LAST,
proc: TiogaButtons.TiogaButtonProc ← NIL, clientData: REF ANYNIL, fork: BOOLTRUE]
RETURNS [TiogaButtons.TiogaButton];
... creates a button from the node and the offsets provided. If the start and end offsets are defaulted then the button refers to the node itself.
If proc is NIL then the a button record returned, but no button property will be applied to the node. Why bother?
AppendToTiogaButton: PROC [
q: Queue, button: TiogaButtons.TiogaButton, rope: ROPENIL, looks: ROPENIL,
proc: TiogaButtons.TiogaButtonProc ← NIL, clientData: REF ANYNIL, fork: BOOLTRUE]
RETURNS [TiogaButtons.TiogaButton];
... appends the formatted rope to an existing button and creates a new button for the appended text.
If proc is NIL then the rope is appended and a button record returned, but no button property will be applied to the node. This is useful for providing labels, spacing between buttons, or special formatting. Note that the format is set only when you create a node.
A curious feature of appending to a button created with proc nonNIL: that button will be for the entire node and will subsume any appended buttons. This might be useful for providing a target that will refer to the entire node contents. The feedback looks neat!
END.