TiogaButtonsExtras.Mesa
Copyright © 1984, 1985 Xerox Corporation. All rights reserved.
Created by Rick Beach, May 2, 1985 2:32:00 pm PDT
Hal Murray, December 22, 1986 10:58:48 am PST
Willie-Sue, January 23, 1987 3:54:24 pm PST
Last tweaked by Mike Spreitzer on June 8, 1988 12:46:00 pm PDT
Polle Zellweger (PTZ) June 14, 1988 2:56:52 pm PDT
Don Baker, August 12, 1988 10:31:41 am PDT
This interface allows user editing on the underlying file. Clients can turn on a button which will let the user toggle between editing and buttoning states, or the client can change the state directly. Notification of changes to the document are given only in the buttoning state and a notification is given when the user or the client sets the state back to buttoning.
TiogaButtons will not change the "edited" state of the document.
Note that it is an implementation restriction that there cannot be multiple TiogaButtons viewers on one document. It is permissible, however, to have any number of Tioga viewers on a document which also has a TiogaButtons viewer.
DIRECTORY
TiogaButtons USING [TiogaButton],
TiogaOps USING [Location, Ref],
ViewerClasses USING [Viewer];
TiogaButtonsExtras: CEDAR DEFINITIONS
= BEGIN OPEN TiogaButtons;
EnumerateTiogaButtons: PROC
[
v: ViewerClasses.Viewer,
WrongViewerClass raised if v isn't a TiogaButtons viewer.
Test: PROC [TiogaButton] RETURNS [BOOL],
Returns TRUE to stop the enumeration.
start: TiogaOps.Location ← [NIL, 0],
default value means begin of whole document.
end: TiogaOps.Location ← [NIL, INT.LAST]
default value means end of whole document.
]
RETURNS [BOOL];
Result is TRUE iff Test returned TRUE.
IsTiogaButtons: PROC [ViewerClasses.Viewer] RETURNS [BOOL];
IsEntireNode: PROC [TiogaButton] RETURNS [BOOL];
State: TYPE = { buttoning, editing };
StateButton: PROC [v: ViewerClasses.Viewer, show: BOOLTRUE];
... called to show (TRUE) or hide (FALSE) the button on the viewer which allows the user to toggle between editing the underlying document and buttoning. Initially, the button is hidden for upward compatibility. Does nothing if the viewer is not a top level viewer (can't have it's own buttons).
SetState: PROC [v: ViewerClasses.Viewer, val: State];
... called to set the state of the viewer directly.
GetState: PROC [v: ViewerClasses.Viewer] RETURNS [State];
... called to get the state of the viewer.
WasModifiedProc: TYPE = PROC [v: ViewerClasses.Viewer];
... called by TiogaButtons to allow the client to redo the buttons upon reentering the buttoning state or after some non-user document edit, like with an active docuement, while in "button mode". All previously created buttons are removed before this call is made.
RegisterModifiedProc: PROC [v: ViewerClasses.Viewer, proc: WasModifiedProc];
... called to register a procedure to be called in the event of a change to the document. To "unregister" the procedure, register NIL as the proc.
IsViewerEdited: PROC [root: TiogaOps.Ref] RETURNS [edited: BOOL];
... returns whether the edited bit of the document (viewer) is set.
END.
Polle Zellweger (PTZ) June 14, 1988 2:56:52 pm PDT
changes to: IsEntireNode