TiogaActiveDoc.tioga
Bier, October 5, 1989
Bier, June 25, 1991 4:37 pm PDT
TiogaActive
CEDAR 7.0 —
TiogaActive
Tioga Meets EmbeddedButtons
Eric A. Bier
© Copyright 1989 Xerox Corporation. All rights reserved.
Abstract: Not to be confused with ActiveTioga, this package registers routines with the EmbeddedButtons package that allow objects in normal Tioga documents to behave as buttons. This facility is different from TiogaButtons, because the resulting buttons are persistent; button-containing documents can be edited by users, saved on disk, and sent through the mail. Users need not install this package directly. It is installed by the ButtonApplications package.
Created by: Doug <Wyatt.pa>, Eric <Bier.pa>
Maintained by: Doug <Wyatt.pa>, Eric <Bier.pa>
Keywords: Tioga, embedded buttons, active documents
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

1. How to Use Buttons in Tioga
See ButtonApplicationsDoc.tioga and ButtonIdeas.tioga in ButtonApplications.df for an introduction to the use of button-containing documents.
2. What TiogaActive Provides
2.1 The Ability to Click on Buttons
When TiogaActive is run, it changes the input notification routines for Tioga viewers so that they can handle raw mouse and keyboard actions that have not been interpreted through a TIP table. When the mouse is over a button, Tioga passes the actions to a handler for buttons. Otherwise, the action is passed through the Tioga TIP table and executed normally.
TiogaActive registers with Tioga routines for reading and writing the special "ButtonData" character properties that are applied to text strings that should act as buttons.
TiogaActive registers routines with EmbeddedButtons that enumerate all text runs that have the ButtonData property, that describe the text of such a run, that select such a run, or that replace the text of such a run.
2.2 An Addition to the Tioga Control Panel
Finally, TiogaActive provides a button at the top of Tioga viewers that looks like:

Left-clicking this button turns all buttons in that viewer on. Right-clicking turns them off.
2.3 Commands Available From Buttons
TiogaActive registers a set of commands that can be used from buttons to perform Tioga operations. In particular, these commands can be used in the "Feedback" clause of a ButtonData to display feedback resulting from a button being pressed. These operations are registered by TiogaActive:
ActivityOn -- turns on button activity in the Tioga document that has the input focus (if any).
ActivityOff -- the inverse of ActivityOn
SelectButton -- selects all of the characters of the button that was most recently pressed.
BeginButton -- saves the current selection, does a SelectButton
EndButton -- restores the selection that was saved by StartButton
ReplaceText -- as in (PARAM "New Text" ReplaceText). The text of the currect selection is replaced by the string that follows PARAM. Where possible, character properties are maintained.
SetPostfix -- as in (PARAM "New Postfix Value" SetPostfix). The Postfix property of the currently selected characters becomes the string that follows PARAM. This can be used to change a Postfix property to display button feedback. For instance, this button changes its box width when pressed:
Press to Change Bounding Box
3. The "Buttons On" and "Buttons Off" Commands
To turn on buttons in a CommandTool, type:
Buttons on
or
Buttons on -quiet
The later command doesn't print out the "Buttons are on" feedback message. Likewise, the commands:
Buttons off
and
Buttons off -quiet
turn off button activity in a CommandTool.