-- EditToolBuilder.mesa
-- Edited by Paxton on June 24, 1982 9:53 am
-- Edited by McGregor on September 1, 1982 3:39 pm
DIRECTORY
ViewerClasses USING [Viewer],
Buttons USING [Button, ButtonProc],
Labels USING [Label],
Rope USING [ROPE],
TextNode USING [RefTextNode],
TextLooks USING [Looks];
EditToolBuilder: CEDAR DEFINITIONS = {
-- general stuff
Layout: TYPE = REF LayoutRec;
LayoutRec: TYPE = RECORD [
entryLeft: CARDINAL,
initLeft: CARDINAL,
heightSoFar: CARDINAL,
initHeight: CARDINAL,
entryHeight: CARDINAL ← 15,
entryVSpace: CARDINAL ← 5,
gapSize: CARDINAL ← 5,
container: ViewerClasses.Viewer ];
ToMiddle: PROC [info: Layout];
-- change entryLeft to middle of container
ToNext: PROC [info: Layout, bigGap: BOOLEANFALSE];
HGap: PROC [info: Layout] = INLINE { OPEN info;
entryLeft ← entryLeft + gapSize };
VGap: PROC [info: Layout] = INLINE { OPEN info;
heightSoFar ← heightSoFar + entryVSpace };
BuildPair: PROC [info: Layout, proc: Buttons.ButtonProc, flag: BOOLEAN, l1, l2: Rope.ROPE,
clientData: REF ANYNIL, fork: BOOLEANFALSE]
RETURNS [label: Labels.Label, button: Buttons.Button];
-- places at current entryLeft & heightSoFar and then updates those parameters
BuildTriple: PROC [info: Layout, proc: Buttons.ButtonProc, state: [0..2], l0, l1, l2: Rope.ROPE,
clientData: REF ANYNIL, fork: BOOLEANFALSE]
RETURNS [label: Labels.Label, button: Buttons.Button];
DataFieldButton: PROC [arg: ViewerClasses.Viewer, clear: BOOLEAN];
BuildDataFieldPair: PROC [info: Layout, buttonRope: Rope.ROPE, buttonProc: Buttons.ButtonProc,
clientData: REF ANYNIL, lines: CARDINAL ← 2]
RETURNS [button: Buttons.Button, arg: ViewerClasses.Viewer];
GetDataNode: PROC [arg: ViewerClasses.Viewer] RETURNS [TextNode.RefTextNode];
GetDataLooks: PROC [arg: ViewerClasses.Viewer, name: Rope.ROPE]
RETURNS [looks: TextLooks.Looks];
BadNumber: SIGNAL;
GetInt: PROC [arg: ViewerClasses.Viewer] RETURNS [num: INT];
SetInt: PROC [arg: ViewerClasses.Viewer, num: INT];
ConvertList: PROC [list: LIST OF REF ANY] RETURNS [Rope.ROPE];
BuildButton: PROC [info: Layout, name: Rope.ROPE, proc: Buttons.ButtonProc,
clientData: REF ANYNIL, fork: BOOLFALSE, gapAfter: BOOLTRUE, border: BOOLFALSE]
RETURNS [button: Buttons.Button];
BuildLabel: PROC [info: Layout, name: Rope.ROPE, width: INTEGER ← 0]
RETURNS [label: Labels.Label];
HRule: PROC [info: Layout, thickness: CARDINAL ← 1, gapAbove, gapBelow: BOOLEANTRUE];
-- put a horizontal rule the full width of the container
-- if gapAbove is true, then move down by entryVSpace before placing the rule
-- if gapBelow if true, then move down by entryVSpace after placing the rule
}...