-- File: WalnutViewer.mesa
-- Contents: Taken from NutViewer.mesa
-- Created by: Rick Cattell on 11-Dec-81 12:29:29
-- Last edited by:
-- Willie-Sue on: January 20, 1984 2:41:45 pm PST
DIRECTORY
MBQueue USING [Queue],
Buttons, Menus, Rope, ViewerClasses, VFonts;
WalnutViewer: CEDAR DEFINITIONS
IMPORTS VFonts =
BEGIN
Viewer: TYPE = ViewerClasses.Viewer;
ROPE: TYPE = Rope.ROPE;
Queue: TYPE = MBQueue.Queue;
-- ********************************************************
-- 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, width: INTEGER← 0,
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
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.
ImmediateButton: PROC[name: ROPE, proc: Buttons.ButtonProc, border: BOOL,
sib: Viewer, fork: BOOL← TRUE, guarded: BOOL← FALSE, newLine: BOOL← FALSE]
RETURNS[Viewer];
-- does not put button on a queue
END.