ButtonIdeas.tioga
Copyright 1989 by Xerox Corporation. All rights reserved.
Bier, October 20, 1992 2:01 pm PDT
Kenneth A. Pier, October 31, 1990 2:41 pm PST
Introduction
Many of the text strings in this document act as buttons when the document is activated. To activate a document, make sure that the ButtonApplications package has been installed (type "Require PCedar ButtonApplications ButtonApplications" to install it). Open a fresh viewer on the document. A button should appear at the top of the Tioga viewer that looks like:

Left-clicking this button activates the document. Right-clicking the button deactivates the document. There are two alternative ways to activate a document. In Tioga, CTRL-L (for Lively) activates and CTRL-SHIFT-L deactivates. Also, the Activity button below activates and deactivates the window that has the current input focus.
You can copy buttons from this document to make control panels of your own. Also, the section on "Buttonizers" will help you turn Tioga and Gargoyle objects into buttons.
To edit a button, use the EditProperties mechanism in Tioga as follows: Select the node that contains the button that you would like to change. Type CTRL-U. Edit the ButtonData node property. Select the expanded nodes and type CTRL-SHIFT-U. Try out the new button. If you don't want to worry about accidentally pushing the button during this process, deactivate the document before editing it and re-activate it later.
You cannot currently edit the text of a button in place if you want the new text to be part of the button. You must expand the node with CTRL-U, edit the Text: line, select the expanded nodes and click CTRL-SHIFT-U. This problem will go away when Tioga has caret properties that work like caret looks. Alternatively, if the button was made by a buttonizer, just type the new text in place and apply the buttonizer a second time.
Patience. The first named multi-state button or radio button that you click in a document may take a while to work. EmbeddedButtons is searching through the document to see if any other buttons have the same name. Subsequent clicks will go faster.
ButtonExamples
This section contains a small number of examples of each of the four button types. Try them out. Remember to hold down the mouse on the pop-up buttons if you want to see the pop-up menu. The two-state and multi-state buttons change font to show their state. Only one of the radio buttons should be on at a time.
Guarded Buttons
This is a guarded button. Click on it twice, with a pause in between to get it to perform its action: Clear
Pop Up Buttons
Here's a pop up button with 3 entries: A button.
Here's a pop up button with 6 entries: A button.
Multiple State Buttons
Here's a two state button: A TwoStateButton.
This button cycles through plain, bold, and large:
An EnumeratedTypeButton.
This button cycles through three different text values (note that looks are unaffected). Be patient after clicking—this button has a name (TropicalFruit).
Papaya
These two buttons change their value in synchrony (because they have the same Name: field):
Guava Guava
These two buttons are real-valued. Left-clicking doubles the value. Right-clicking halves it.
(Thickness 8.0) Press to Change Bounding Box
Pop-Up State Buttons
These buttons combine the features of pop-up and multi-state buttons. If a button has no "Menu:" description, a menu is constructed automatically from the values, as is done for this button:
bah based on an enumerated type, and this button 100.0 based on type REAL.
If a menu is provided, this menu is displayed. However, when the button is not linked to an application, left and middle mouse clicks cause the value to increase, right clicks cause the value to decrease, regardless of what the button will do once linked. For example: 14
Radio Buttons
Only one of these buttons will be on at once. This works because these buttons have the same name.
Grapefruit . . . Banana . . . Apple
Button Button Button Button Button Some of these buttons work in pairs
Buttonizers
The buttons in this section turn other objects into buttons. To use them, select a string of Tioga characters, then left-click on one of the buttons. A box will be added around the selected text string, and it will begin to act as a button (if the document in which it is embedded has been activated).
The Make-Command-Doer Buttonizer
Make-Command-Doer
To use this button, select a Cedar Commander command that you would like to be a button and click on the buttonizer. For instance, this button was made that way:
Openr IODoc.tioga
Because every character of this button now mentions the full command, you can delete characters to make a more compact button. For instance, you might want to delete the "Openr" and ".tioga" in the button above to make:
IODoc
Unfortunately, adding characters is harder (because Tioga won't automatically transfer the button behavior to the new characters). You CAN edit the text of the button in an arbitrary way by expanding out the node (with CTRL-U), editing the Text: part, and then selecting the whole node and using CTRL-SHIFT-U to reconstruct the node and its buttons.
If you make this document active and hold down the mouse button over this embedded button, you will see that the buttonizer constructs a pop-up menu for this command, by using the first token of the command "Openr" as the menu entry, and the complete command as the documentation line.
The Make-Tioga-Doer Buttonizer
Make-Tioga-Doer
To use this button, select a text string representing a Tioga macro. (This text string can be created by example by performing the Tioga macro on an example text selection and then clicking "GetLast" in the Operations section of the EditTool.) Then press the Make-Tioga-Doer button. The resulting button will perform the macro when clicked. For instance, this button that makes text LOOK-B (bold) was made this way:
1 ApplyLook
So was this button that makes text red:
SaveSelectionA PropForSelectedCharacter ClearPropName "Postfix" ClearPropValue "0 1 1 textColor" RestoreSelectionA SetNodeProp
Like the Commander buttons above, these buttons can be edited by deleting unwanted characters. For instance, the second button might become:
0 1 1 textColor
Other Buttonizers
 Make-PopUpButton turns the selected text into a simple three-entry PopUpButton.
 Make-File-Button Produces a button that can open the file named in the button.
  
 Make-TiogaDoc-File-Button Produces a button that opens TiogaDoc.tioga. The resulting button can be edited to open a different file instead.
  
 Make-Mesa-Button Resulting button opens latest released version of named mesa file.
  
 Make-Stuffer Produces a button that will insert its own contents into a Tioga document. 
 Make-TwoStateButton (bold) makes a TwoStateButton.
 Make-TwoStateButton (video-reverse) makes a TwoStateButton that video-reverses.
 Make-TwoStateButton (box toggles) makes a button whose box comes and goes.
 Make-TwoStateButton (disappears) makes a button that goes from black to white
 Make-MultiStateButton turns the selected text into an EnumeratedTypeButton.
 Make-RadioButton turns the selected text into a RadioButton.
 Make-Phone-Dialer produces a button that dials a number (if you have an Etherphone).
 Make-Command-Doer makes button that performs the selected command.
 ClearButton removes the button properties from the selected objects.
 Make-Buttonizer turns the selected text into a buttonizer, just like this one.
 Commandizer makes button that creates buttons that perform the selected command. [This button is currently out of order.]
Poppy1
Class: PopUpButton
Menu: (
((Event1) "First Item" "Sends Event1 to application")
((Event2) "Second Item" "Sends Event2 to application")
((Event3) "Third " "Sends Event3 to application")
)
MessageHandler: MessageWindow
Feedback: (
(MouseMoved <SetCursor bullseye>)
)
The above bold node is a button that applies its own text as a ButtonData for the selected text.
The following buttons work on a selection of one or more objects in the Gargoyle illustrator.
 Make-Gargoyle-ChangeColorButton turns selected gargoyle objects into color changers.
 Make-Gargoyle-TwoStateButton turns selected gargoyle objects into TwoStateButton's.
 Make-Transfer-Dash-And-Ends
  turns Gargoyle objects into buttons that transfer dash patterns.
 Make-Transfer-Stroke-Width
  turns Gargoyle objects into buttons that transfer stroke width.
Tioga Macros
Each of these buttons is a pop-up menu that performs several Tioga editing macros. Select a text string and click a button. The buttons will change the appearance of the string.

 Font Face makes characters look plain, bold, italic, or bold and italic.
 Alphabet changes alphabet between latin (abcedefg...), greek (abcedefg...),
 and math (蝩CC...).
 Font Size changes character size from small, to normal, to large, to extra large.
The "Boxes" button only works if the EditTool is loaded. Click here:
 EditTool
 Boxes applies a box of width zero, one, or two pixels to selected characters.
 Red Orange Yellow Green Cyan Blue Magenta Adds color to selected characters
These colors were chosen by trial and error by Eric Bier to be readable against a white background and easy to distinguish from each other and from black.
 Red Blue Green Orange Pink Yellow Brown Purple Adds one of the
Boynton colors to selected characters. These eight colors have been found to have names in many cultures. In addition, their color coordinates are chosen to maximize the probability that viewers will agree on their names.
 PropertyTransferButton Transfers its own character properties to the selected text.
 ShowPostfixProperty
 Reverse video reverses selected characters.
 Activity turns activity on or off in the selected Tioga viewer.
Russ Atkinson contributes this extensive set of Tioga macro buttons:
Set char looks
<> bold italic bold-italic reverse underline strikeout up down
Set node formats
<> block body center code head indent item ragged
Set char/node properties
none highlight black red yellow green cyan blue magenta
Saturated -- left: character, middle: node, right: node
Xerox Palette -- left: character, middle: node, right: node
Acting On Files
Opening Files
Open TiogaDoc. -- The command "Open [PCedar2.0]<Documentation>TiogaDoc.tioga" is hardwired.
Open ButtonIdeas. -- The command "Open /R/ButtonIdeas.tioga" is hardwired.
[PCedar2.0]<Documentation>EmbeddedButtonsDoc.tioga -- opens the file named in the button.
ButtonClassesDoc.tioga -- opens using [PCedar2.0]<Documentation> as a working directory.
Picking Apart File Names
These buttons deduce a file name from the current selection and print the deduced name in the Message Window. The current selection can either be a text string file name or a point selection in a Viewer.
FileName
ShowShortName
ShowBaseName
Bringing Over Software
Get Gargoyle. -- forks a Commander to bring Gargoyle into /net/gharlane/cree/gargoyle/
Starting Cedar Applications
These buttons start up Cedar applications.
DFTool -- The DFTool provides a window interface to Bringover and SModel commands.
EditTool -- The EditTool performs operations for searching and inspecting Tioga documents
Maintain. -- Starts up Maintain, a tool to update e-mail distribution lists
SummonerClient {on/off} -- Left click for On, right click for Off.
WalnutSend -- Creates a Walnut mail sender
Videotape Catalog -- Starts up an XNSChat window and opens Videotape browser documentation. [XNSChat does not work in PCedar.]
Searching and Substituting
These buttons only work when the EditTool is loaded (press to load):
document -> banana searches for the word "document" in the currently selected Tioga file.

SHIFT-Left click will replace all occurences of "document" with "banana".
Control Panels -- searches for whatever word the button mentions.
If you search backward from here, you may find a button called Guava.
Hypertext Links
This button using QFind -o to open IODoc.tioga and scroll to a desired location. The file is only opened if the pattern is found.
QFind -o "4. Convert" /R/IODoc.tioga
This button always opens the file, even if the pattern isn't found:
open /R/IODoc.tioga; QFind -o "4. Convert" /R/IODoc.tioga
The next button scrolls to a specified position in IODoc.tioga, rather than searching for a string. The specified position includes comment nodes.
Search for Position 40344 in IODoc.tioga
The ChangeLog Button
This button opens a file, scrolls to the end, inserts a few form-fill-in fields (Tioga placeholders) and selects the first one. For this example, the button opens /R/MultiCursors.mesa.
Change Log
(The first time you press the button, you get a "Can't do it" message from Tioga because the macro includes an UnNest operation; I'm working on it.)
Probably Obsolete
This button uses the CommandTool commands "Open" and "SelectTiogaFile" and the Tioga command "Search" to open a Tioga document and scroll to a specified text string.
Search for Scanning in IODoc.tioga
Control Panels
DrawShapes
DrawShapes is a toy drawing package built to demonstrate a Tioga document used as a control panel. To try out this application, press this button:
DrawShapes
Open the DrawShapes icon that appears. Try alternatively left clicking and right clicking in this window to draw shapes. Click on the control panel document to change between rectangle mode and circle mode, to change stroke width, and to erase the picture.
Known bug: Destroying the DrawShapes tool adds the user interface document to the Edited Documents icon. This will get fixed.
The EditTool
This control panel doesn't do anything yet, but some of the buttons work in a familiar way.
   EditTool
Stop Search Yes No Substitute Replace Count Sections RealOps
Target: Apple
Replacement: Banana
Pick one or more: Text Looks Format Style Comment
Match Case  Match Anywhere
Match Literally  Subset as Looks Test
Don't change caps  Do Replace
In Entire Document
Buttons That Control Other Buttons
MasterButton is a pop-up button that can control the multi-state buttons to its right. The shift and control keys determine which button is controled.
MasterButton  OneTwoThree
Buttons That Change Their Text
This TRUE/FALSE button is a multi-state button. It changes both is value and its appearance when pressed:
FALSE
This button is a pop-up button. It changes its text when pressed because its command applies to itself:
Blue
Buttons That Act on Their Document
Print this file.-- prints the file containing this button on a choice of printers (see the menu for choices). Copy this button into any document you want to print.
Multiple Applications
Using the syntax <Send application1 arg1 arg2 arg3> instead of (arg1 arg2 arg3), it is possible for a button to send a message to an application other than the one mentioned in the MessageHandler: field. This pop-up button sends messages to different applications depending on which menu option is chosen:
Multi-Button
Using the syntax <Do expression1 expression2>, a button can perform two operations with a single click. The above button sends a message to the MessageWindow and a different message to the EmbeddedButtons Typescript when middle-clicked.
Buttons with Memory
This button remembers the text that was selected last time it was right-clicked. It inserts this text at the current insertion point when left-clicked.
RememberText
This button remembers the file name that was selected last time it was right-clicked. It opens this file when left-clicked.
RememberFile
Buttons as Distribution Lists
This button inserts the names of all of the implementors of EmbeddedButtons at the current Tioga insertion point. Left-click for grapevine names. Right-click for NS names:
EmbeddedButtons^
Fun with DF Files
You need to create a lot of DF files in PCedar. Here's a button that opens forms for the four main DF files, in a selected directory. Make a Tioga selection of a directory (full path) name and click the button. Be sure that you have write permission in the selected directory.
MakeSuite
The ButtonOpen command (also provided by the ButtonApplications package) reads a DF file and displays its contents as a set of TiogaButtons, each of which opens a file. The following button starts up such a document on Gargoyle-Suite.df, Gargoyle-Source.df, or Gargoyle-PCR.df depending on which mouse button you press. The resulting document of file names opens files in the Gargoyle development directory when you left-click or the release directory when you right-click on the file names:
Gargoyle
Failing and Succeeding
Left-clicking this button executes an unregistered Commander command. Right-clicking executes a registered Commander command. Notice the difference in feedback.
Fail or Succeed
An Obsolete Torch-Passing Mechanism
This (expanded) button shows an example of using a Tioga command that takes a string as an argument:
BEGIN NODE
CONTENTS
Text: Gargoyle Torch:
Text: Papaya
LOOKS(bl)
ButtonData: Poppy1
Class: PopUpButton
Menu: (
((BeginButton PARAM <FileText "/pcedar2.0/torches/GargoyleTorch.txt"> ReplaceText EndButton) "Show Torch Holder" "Show the current owner of the torch")
(<Send Typescript <FileText "/pcedar2.0/torches/GargoyleTorch.txt">> "Test" "Test")
((BeginButton PARAM "SomeName" ReplaceText EndButton) "Set Torch Bearer to Self" "The current logged on user becomes the bearer of this torch")
)
Feedback: (
(MouseMoved <SetCursor bullseye>)
)
MessageHandler: Tioga
PROPERTIES
Comment: FALSE
Format: block
END NODE