FileViewerOps.mesa
Paul Rovner, November 11, 1983 11:51 am
DIRECTORY
IO USING [STREAM],
Rope USING [ROPE];
FileViewerOps: CEDAR DEFINITIONS
= BEGIN OPEN IO, Rope;
SourceFromSelection: PROC [which: SelectionOption ← primary]
RETURNS [fileName: ROPENIL, index: INT ← -1];
... returns the file name and position within the file for the selected Tioga viewer (returns [NIL, -1] if no valid Tioga viewer is selected).
SelectionOption: TYPE = {primary, feedback};
primary => use primary selection
feedback => use feedback selection
OpenSource: PROC [fileName: ROPE, index: INT, chars: INT ← 2, feedBack: STREAMNIL];
... opens a viewer on the source file. If index >= 0, then also set the feedback selection to the given index (for "chars" characters).
ShowLog: PROC [
fileName: ROPE,
destroyIt: BOOLFALSE,
createIconic: BOOLFALSE,
blinkIfIconic: BOOLTRUE];
WaitUntilSaved: PROC [fileName: ROPE, feedBack: STREAMNIL];
WaitUntilSaved tries to find a viewer (v) such that
Rope.Find[(IF v.name # NIL THEN v.file ELSE v.name), fileName, 0, FALSE] # 0
AND v is in the process of being saved or is marked as a "newVersion". If such a viewer is found, this prints relevant messages on "feedBack" and waits until v.saveInProgress is TRUE, then until it goes FALSE, then returns.
AttachErrorLog: PROC[sourceFileName: Rope.ROPE];
Find or open a viewer on sourceFileName and put an ErrorLog button in the menu. Change the icon to show that the file has errors.
RemoveErrorLog: PROC[sourceFileName: Rope.ROPE];
Remove the ErrorLog button from the viewer. Change the icon back. Destroy the errlog file.
END.