WalnutViewer.mesa
Copyright Ó 1988, 1992 by Xerox Corporation. All rights reserved.
Contents: Taken from NutViewer.mesa
Created by: Rick Cattell on 11-Dec-81 12:29:29
Willie-Sue on: March 9, 1988 12:30:24 pm PST
DIRECTORY
TBQueue USING [Queue],
Buttons, Menus, Rope, ViewerClasses, VFonts;
WalnutViewer: CEDAR DEFINITIONS
IMPORTS VFonts =
BEGIN
Viewer: TYPE = ViewerClasses.Viewer;
ROPE: TYPE = Rope.ROPE;
Queue: TYPE = TBQueue.Queue;
buttonEntryHeight: INTEGER = 14;
tiogaButtonHeight: INTEGER = 12;
********************************************************
Handy Procedures for dealing with viewers (WalnutViewerImpl.mesa)
********************************************************
NextTextViewer: PROC[sib: Viewer] RETURNS [nV: Viewer];
creates text viewer on line following sib, full width of sib.parent
NextRightTextViewer: PROC[sib: Viewer, w: INTEGER] RETURNS [nV: Viewer];
creates a text viewer, next right on the same line as v
FirstLabel: PROC[name: ROPE, parent: Viewer] RETURNS [nV: Viewer];
makes a label which is the first one in a viewer, at standard Y value
AnotherLabel: PROC[name: ROPE, sib: Viewer, newLine: BOOL ¬ FALSE] RETURNS [nV: Viewer];
sib is a viewer to the left or above the label to be made
Most menus/buttons are serialized now
FirstButton: PROC[q: Queue, name: ROPE, proc: Buttons.ButtonProc, parent: Viewer, data: REF ANY ¬ NIL, border: BOOL ¬ FALSE, width: INTEGER ¬ 0, guarded: BOOL ¬ FALSE, font: VFonts.Font ¬ VFonts.defaultFont, paint: BOOL ¬ TRUE]
RETURNS [nV: Viewer];
makes a button which is the first one in a viewer
AnotherButton: PROC[q: Queue, name: ROPE, proc: Buttons.ButtonProc, sib: Viewer, data: REF ANY ¬ NIL, border: BOOL ¬ FALSE, guarded: BOOL ¬ FALSE, font: VFonts.Font ¬ VFonts.defaultFont, newLine: BOOL ¬ FALSE, paint: BOOL ¬ TRUE]
RETURNS [nV: Viewer];
sib is a viewer to the left or above the button to be made
ImmediateButton: PROC[name: ROPE, proc: Buttons.ButtonProc, sib: Viewer, data: REF ANY ¬ NIL, border: BOOL ¬ FALSE, guarded: BOOL ¬ FALSE, newLine: BOOL ¬ FALSE, paint: BOOL ¬ TRUE]
RETURNS[Viewer];
does not put button on a queue
CreateMenuEntry: PROC[q: Queue, name: ROPE, proc: Menus.MenuProc, clientData: REF ANY ¬ NIL, documentation: REF ANY ¬ NIL, fork: BOOL ¬ TRUE, guarded: BOOL ¬ FALSE]
RETURNS[Menus.MenuEntry];
The following three PROCs assume that sib.parent#NIL
MakeTypescript: PROC[sib: Viewer] RETURNS [ts: Viewer];
sib is sibling to create TS after, this must be last child of sib.parent.
MakeRuler: PROC[sib: Viewer, h: INTEGER ¬ 1] RETURNS [r: Viewer];
Put a h-bit wide line after sib
MakeBigTextBox: PROC[sib: Viewer, contents: ROPE] RETURNS [nV: Viewer];
Makes editable text viewer taking rest of sib.parent's viewer, suitable for msg body or whatever.
sib is sibling to create text box after, this must be last child of sib.parent.
END.