-- 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: BOOLFALSE] 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 ANYNIL, border: BOOLFALSE, width: INTEGER← 0,
guarded: BOOLFALSE, font: VFonts.Font ← VFonts.defaultFont,
paint: BOOLTRUE]
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 ANYNIL, border: BOOLFALSE, width: INTEGER← 0,
   guarded: BOOLFALSE, font: VFonts.Font ← VFonts.defaultFont,
   newLine: BOOLFALSE, paint: BOOLTRUE]
  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 ANYNIL, documentation: REF ANYNIL, fork: BOOLTRUE,
   guarded: BOOLFALSE]
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: BOOLTRUE, guarded: BOOLFALSE, newLine: BOOLFALSE]
  RETURNS[Viewer];
-- does not put button on a queue

END.