TopButtonsDoc.tioga
Created by Bertrand Serlet, July 16, 1986 3:16:08 pm PDT
Bertrand Serlet, September 2, 1986 5:46:15 pm PDT
TOPBUTTONS
CEDAR 6.1 — FOR INTERNAL XEROX USE ONLY
TopButtons
Let them open!
Bertrand Serlet
© Copyright 1986 Xerox Corporation. All rights reserved.
Abstract: TopButtons turns the Open and New buttons, located on top on a regular Cedar screen, into something useful. When the user clicks Open, the selected file is opened, or, if there is no selection, a new Viewer is created. A pop-up menu, which entries are settable by the user profile, allows the user to choose among several directories. The button labelled Doc replaces the New button, and allows easy on-line documentation: if a filename is selected, it looks for a file ending in Doc.tioga, and if there is no selection, it proposes a menu of Catalogs. An optional third button labelled Refs permits to search for all references of the selected function. The intended semantic for those buttons is: DWIM (Do What I Mean).
Created by: Bertrand Serlet
Maintained by: Bertrand Serlet <Serlet.pa>
Keywords: Buttons, Open, New, Doc, Help, Documentation, Tioga, DWIM, Catalog, MasterScope, Cross Reference, Callers, Grep
XEROX  Xerox Corporation
   Palo Alto Research Center
   3333 Coyote Hill Road
   Palo Alto, California 94304

For Internal Xerox Use Only
1. Semantics of Open/New and Doc buttons
Open/New
IF selection is a filename
THEN IF selection starts with '/ or '[
THEN Open [selection]
ELSE Present directory menu; Open [directoryselection]
ELSE Present directory menu; IF chosen entry is a directory
THEN New [directory]; Position input focus
ELSE Open [file]
Doc
IF selection is a filename
ELSE Open [selectionDoc.Tioga]
ELSE Present catalog menu; Open [catalog]
Fine points
Clicking outside the menu when the Open directory menu is presented causes the usual search path to be used for searching the file.
Frequently accessed files can be specified in the TopButtons.Directories user profile entry, so that in two clicks, it is possible to open them.
A time out is set for the popup menus (currently 10 seconds).
2. Refs button
Who ever wanted to know what are the callers of a given function? The optional Refs button permits searching all the occurrences of a selected function from a root DF file. The selection must be of the form Module.Function. When the Refs buttons is clicked, a menu of root DF files is proposed. The algorithm is to enumerate recursively of DF files from this root, and for each DF file that either defines or uses Module.bcd, to scan all the defined mesa files for the token Function. This textual search (similar to a grep) is conservative. If any occurrence was found, a text window opens at the end of the search. Multiple processes are used for improved usage of the machine, but things still take time: a search through Cedar might take a minute, and a search in CedarChest several. The Refs button is only created if the user profile has a non NIL TopButtons.RootDFs entry.
3. User Profile Options
TopButtons.Directories: LIST OF Token ← ///Users/User.pa/
Specifies the directories to be used
A typical Directories entry:
TopButtons.Directories: ///Users/Dummy.pa/ ///Users/Dummy.pa/UsualWorkingDirectory/ ///Users/Dummy.pa/PhoneList.tioga ///Dummy.profile ///Users/Dummy.pa/WorkingDirectory/RootDF.df
TopButtons.Catalogs: LIST OF Token ← CedarCatalog CedarChestCatalog
Specifies the standard catalogs to be used
DATools people can have in their profile:
TopButtons.Catalogs: CedarCatalog CedarChestCatalog DAToolsCatalog DragonCatalog
TopButtons.RootDFs: LIST OF Token ← NIL
Specifies the roots of the reference search. Must be DF files.
A typical profile:
TopButtons.RootDFs: [Cedar]<Cedar6.1>Top>Cedar.df [Cedar]<CedarChest6.1>Top>CedarChest.df [Indigo]<Dragon>Top>DragonRoot.df []<>Users>Me>MyRootDF.df
4. Loading TopButtons
Load file: TopButtons.load