TapeToolInterfaceImplA.mesa
Copyright © 1984 by Xerox Corp. All rights reserved.
Last edited by Tim Diebert: March 19, 1986 3:36:11 pm PST
Last Edited by: McCreight, February 25, 1985 5:48:20 pm PST
DIRECTORY
Buttons USING [Create, Button, ButtonProc],
Containers USING [ChildXBound, ChildYBound, Container, Create],
Labels USING [Create, Label],
Rope USING [ROPE],
Rules USING [Create],
TapeOps USING [DriveNumber],
TapeToolInternal USING [Action, Enqueue, Parameters, PrompterSeq, TapeTool, TapeToolOp],
VFonts USING [Font],
ViewerClasses USING [Viewer, ViewerClassRec],
ViewerTools USING [GetContents];
TapeToolInterfaceImplA: CEDAR PROGRAM
IMPORTS Buttons, Containers, Labels, Rules, TapeToolInternal, ViewerTools
EXPORTS TapeToolInternal = BEGIN
OPEN Tool: TapeToolInternal;
TapeTool: TYPE ~ Tool.TapeTool;
PrompterSeq: TYPE ~ Tool.PrompterSeq;
ROPE: TYPE ~ Rope.ROPE;
---- ---- ---- ---- ---- ---- ---- ----
Tool Construction
---- ---- ---- ---- ---- ---- ---- ----
BuildOperations: PUBLIC PROC [tool: TapeTool] = BEGIN
rule, prev: ViewerClasses.Viewer;
height: INT ← 0;
tool.ops ← Containers.Create[info: [
wx: 0,
wy: tool.height,
ww: 9999, -- arbitrary; Containers.ChildXBound overrides
wh: 9999, -- arbitrary; Containers.ChildYBound overrides
parent: tool.outer,
border: FALSE,
scrollable: FALSE
], paint: FALSE];
tool.OpenButton ← prev ← Buttons.Create[
info: [name: "Open",
wx: tool.params.entryHSpace,
wy: height,
wh: tool.params.entryHeight,
parent: tool.ops,
border: TRUE
],
proc: SelectOperation,
fork: FALSE,
clientData: tool,
guarded: FALSE,
font: tool.params.font,
paint: FALSE
];
tool.CloseButton ← prev ← Buttons.Create[
info: [name: "Close",
wx: prev.wx + prev.ww + tool.params.entryHSpace,
wy: height,
wh: tool.params.entryHeight,
parent: tool.ops, 
border: TRUE
],
proc: SelectOperation,
fork: FALSE,
clientData: tool,
guarded: TRUE,
font: tool.params.font,
paint: FALSE
];
tool.RewindButton ← prev ← Buttons.Create[
info: [name: "Rewind",
wx: prev.wx + prev.ww + tool.params.entryHSpace,
wy: height,
wh: tool.params.entryHeight,
parent: tool.ops, 
border: TRUE
],
fork: FALSE,
proc: SelectOperation,
clientData: tool,
font: tool.params.font,
paint: FALSE
];
tool.UnloadButton ← prev ← Buttons.Create[
info: [name: "Unload",
wx: prev.wx + prev.ww + tool.params.entryHSpace,
wy: height,
wh: tool.params.entryHeight,
parent: tool.ops, 
border: TRUE
],
proc: SelectOperation,
fork: FALSE,
clientData: tool,
guarded: TRUE,
font: tool.params.font,
paint: FALSE
];
tool.Statusbutton ← prev ← Buttons.Create[
info: [name: "Status",
wx: prev.wx + prev.ww + tool.params.entryHSpace,
wy: height,
wh: tool.params.entryHeight,
parent: tool.ops, 
border: TRUE
],
fork: FALSE,
proc: SelectOperation,
clientData: tool,
guarded: FALSE,
font: tool.params.font,
paint: FALSE
];
height ← height + tool.params.entryHeight + tool.params.entryVSpace;
tool.ReadButton ← prev ← Buttons.Create[
info: [name: "Read",
wx: tool.params.entryHSpace,
wy: height,
wh: tool.params.entryHeight,
parent: tool.ops, 
border: TRUE
],
proc: SelectOperation,
fork: FALSE,
clientData: tool,
guarded: FALSE,
font: tool.params.font,
paint: FALSE
];
tool.WriteButton ← prev ← Buttons.Create[
info: [name: "Write",
wx: prev.wx + prev.ww + tool.params.entryHSpace,
wy: height,
wh: tool.params.entryHeight,
parent: tool.ops, 
border: TRUE
],
proc: SelectOperation,
fork: FALSE,
clientData: tool,
guarded: FALSE,
font: tool.params.font,
paint: FALSE
];
tool.FSF ← prev ← Buttons.Create[
info: [name: "Fwd File",
wx: prev.wx + prev.ww + tool.params.entryHSpace,
wy: height,
wh: tool.params.entryHeight,
parent: tool.ops, 
border: TRUE
],
proc: SelectOperation,
clientData: tool,
guarded: FALSE,
fork: FALSE,
font: tool.params.font,
paint: FALSE
];
tool.BSF ← prev ← Buttons.Create[
info: [name: "Back File",
wx: prev.wx + prev.ww + tool.params.entryHSpace,
wy: height,
wh: tool.params.entryHeight,
parent: tool.ops, 
border: TRUE
],
proc: SelectOperation,
clientData: tool,
fork: FALSE,
guarded: FALSE,
font: tool.params.font,
paint: FALSE
];
height ← height + tool.params.entryHeight + tool.params.entryVSpace;
rule ← Rules.Create[info: [
wx: 0,
wy: height,
ww: 9999, -- arbitrary; Containers.ChildXBound overrides
wh: 1,
parent: tool.ops
]];
height ← height + tool.params.entryVSpace;
tool.statusLabel ← Labels.Create[
info: [
name: "Rdy Onl Rwd WP BOT EOT FMK NRZI HE SE DL RDP ICL Hdw FP Cmd",
wx: 30,
wy: height + 2,
parent: tool.ops,
border: FALSE
],
font: tool.params.fixedFont
];
height ← height + tool.params.entryHeight + tool.params.entryVSpace;
tool.recordCountLabel ← Labels.Create[
info: [
name: "File number: 0 ",
wx: 30,
wy: height + 2,
parent: tool.ops,
border: FALSE
],
font: tool.params.fixedFont
];
rule ← Rules.Create[
info: [
wx: 0,
wy: tool.recordCountLabel.wy + tool.recordCountLabel.wh + 2,
wh: 1,
ww: 9999,
parent: tool.ops
]
];
tool.height ← tool.height + tool.params.entryHeight + tool.params.entryVSpace + height + 2;
Containers.ChildXBound[container: tool.outer, child: tool.ops];
Containers.ChildYBound[container: tool.outer, child: tool.ops];
END;
SelectOperation: Buttons.ButtonProc = BEGIN
tool: Tool.TapeTool ← NARROW[clientData];
viewer: Buttons.Button ← NARROW[parent];
op: Tool.Action;
IF tool.AbortNow THEN BEGIN
tool.AbortNow ← FALSE;
RETURN;
END;
op.opConversions ← ViewerTools.GetContents[tool.conversionsViewer];
op.opBlockingRope ← ViewerTools.GetContents[tool.blockingViewer];
op.oplreclRope ← ViewerTools.GetContents[tool.lreclViewer];
op.opFiles ← ViewerTools.GetContents[tool.fileNameViewer];
op.opWDir ← ViewerTools.GetContents[tool.wdViewer];
op.localOp ← tool.params.localDisk;
op.tiogaRead ← tool.tiogaReadValue;
op.padBlock ← tool.fillBlock;
op.serverName ← ViewerTools.GetContents[tool.serverNameViewer];
op.driveNumberRope ← ViewerTools.GetContents[tool.driveNumberViewer];
op.density ← tool.density;
op.op ← SELECT viewer FROM
tool.OpenButton => Open,
tool.CloseButton => Close,
tool.RewindButton => Rewind,
tool.UnloadButton => Unload,
tool.Statusbutton => Status,
tool.ReadButton => Read,
tool.WriteButton => Write,
tool.FSF => FSF,
tool.BSF => BSF,
ENDCASE => ERROR;
Tool.Enqueue[tool: tool, q: tool.opsQueue, a: op];
END;
END.