<> <> <> <> 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; ---- ---- ---- ---- ---- ---- ---- ---- <> ---- ---- ---- ---- ---- ---- ---- ---- 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.