DIRECTORY ChoiceButtons USING [EnumTypeRef], Containers USING [Container], Icons USING [IconFlavor], Labels USING [Label], LoganBerry USING [Attribute, AttributeType, Entry, nullDB, OpenDB, SchemaInfo], LoganQuery USING [AttributePatterns, Cursor, QueryPlan], Menus USING [ClickProc, Menu], RefTab USING [Ref], Rope USING [ROPE], TiogaButtons USING [TiogaButtonProc], ViewerClasses USING [Viewer, ViewerFlavor]; LoganBerryBrowser: CEDAR DEFINITIONS ~ BEGIN DBInfo: TYPE = REF DBInfoRec; DBInfoRec: TYPE = RECORD[ db: LoganBerry.OpenDB ¬ LoganBerry.nullDB, -- open database handle schema: LoganBerry.SchemaInfo ¬ NIL, -- database schema shortname: Rope.ROPE ¬ NIL, -- short name for database selected: BOOLEAN ¬ TRUE -- whether or not database is selected for browsing ]; DisplayProc: TYPE ~ PROC [entry: LoganBerry.Entry, tool: Tool] RETURNS []; Tool: TYPE = REF ToolBody; ToolBody: TYPE = RECORD[ name: Rope.ROPE ¬ NIL, -- browser name displayed in caption databases: LIST OF DBInfo ¬ NIL, -- databases that can be browsed menu: Menus.Menu ¬ NIL, -- command menu (default is standard menu) innerFlavor: ViewerClasses.ViewerFlavor ¬ NIL, -- flavor for inner viewer inner: ViewerClasses.Viewer ¬ NIL, -- viewer for retrieved database entries (*) display: DisplayProc ¬ NIL, -- procedure to display entries in inner viewer outer: Containers.Container ¬ NIL, -- main container (*) icon: Icons.IconFlavor ¬ unInit, -- icon used fields: LIST OF LoganBerry.AttributeType ¬ NIL, -- fields that should be present in the entry form (default is set of indexed attributes) entryform: RefTab.Ref ¬ NIL, -- set of "FormField"s (*) wantInputArea: BOOLEAN ¬ TRUE, -- whether input area should be created inputArea: ViewerClasses.Viewer ¬ NIL, -- area for type in (*) wantSortButton: BOOLEAN ¬ TRUE, -- whether sort button should be created sortButton: ChoiceButtons.EnumTypeRef ¬ NIL, -- order of retrieval (*) queryFeedback: Labels.Label ¬ NIL, -- area for feedback about query processing (*) details: Containers.Container ¬ NIL, -- container for choice buttons (*) historyData: REF ANY ¬ NIL, -- log of executed queries (*) history: ViewerClasses.Viewer ¬ NIL, -- viewer for history data (*) lastDeletes: LIST OF LoganBerry.Entry ¬ NIL, -- entries recently deleted (*) height: CARDINAL ¬ 0, -- current height of tool (excluding inner viewer) (*) cursor: LoganQuery.Cursor, -- currently executing query (*) clientData: REF ¬ NIL -- client-specific data ]; CreateTool: PROC [db: LoganBerry.OpenDB ¬ LoganBerry.nullDB, tool: Tool] RETURNS []; ReadEntryForm: PROC [tool: Tool] RETURNS [form: LoganQuery.AttributePatterns, other: Rope.ROPE, orderBy: LoganBerry.AttributeType]; RestoreEntryForm: PROC [tool: Tool, form: LoganQuery.AttributePatterns, other: Rope.ROPE]; PrintEntry: PROC [entry: LoganBerry.Entry, tool: Tool]; PrintEntryAsButton: PROC [entry: LoganBerry.Entry, tool: Tool, proc: TiogaButtons.TiogaButtonProc, clientData: REF ANY ¬ NIL]; ReportFeedback: PROC [plan: LoganQuery.QueryPlan, tool: Tool] RETURNS []; AddToHistory: PROC [tool: Tool, form: LoganQuery.AttributePatterns, other: Rope.ROPE]; StopProc: Menus.ClickProc; BrowseProc: Menus.ClickProc; UpdateProc: Menus.ClickProc; DeleteProc: Menus.ClickProc; UnDeleteProc: Menus.ClickProc; DetailsProc: Menus.ClickProc; HistoryProc: Menus.ClickProc; AdminOpsProc: Menus.ClickProc; OpenProc: Menus.ClickProc; CloseProc: Menus.ClickProc; BuildIndicesProc: Menus.ClickProc; CompactLogsProc: Menus.ClickProc; END.  LoganBerryBrowser.mesa Copyright Σ 1986, 1992 by Xerox Corporation. All rights reserved. Doug Terry, July 17, 1992 10:54 am PDT Operations that allow one to create a LoganBerry browser with customized behavior. Entries that are marked with (*) should be treated as read-only; all other entries can be set explicitly by a client before calling CreateTool. Builds a tool for browsing the given LoganBerry database. This procedure takes an OpenDB as a convenience to those clients wishing to browse a single database; to perform merged queries on multiple databases, clients must explicitly set tool.databases before calling this routine with a nullDB. The following routines may be useful for those clients creating customized browsers. Returns the contents of the entry form and the sort button. Writes the given form contents to the browser's entry form. Simply prints a LoganBerry entry in the browser's inner viewer (works only if the inner viewer is of the default flavor). Builds a tioga button in the browser's inner viewer (works only if the inner viewer is of flavor $TiogaButtons). Displays the feedback obtained from the given query plan in the browser's feedback areas. Adds information to the browser's history viewer. These are the default menu procs used by the Browser: ΚF•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ Οeœ6™BK™&K™K™RK™—šΟk ˜ Kšœžœ˜"Kšœ žœ ˜Kšœžœ˜Kšœžœ ˜Kšœ žœ?˜OKšœ žœ(˜8Kšœžœ˜Kšœžœ˜Kšœžœžœ˜Kšœ žœ˜%Kšœžœ˜+—K˜KšΠblœžœž ˜$šœž˜˜Kšœžœžœ ˜šœ žœžœ˜Kšœ,Οc˜CKšœ žœ ˜8Kšœžœžœ ˜7Kšœ žœžœ 3˜MK˜—K˜Kšœ žœžœ'žœ˜JK˜Kšœžœžœ ˜šœ žœžœ˜Kšœ žœžœ $˜žœ˜ZK™;—K˜š‘ œžœ'˜7Kšœy™y—K™š ‘œžœWžœžœžœ˜~Kšœp™p—K™š‘œžœžœ žœ˜IK™YK™—š‘ œžœ>žœ˜VK™1—K™K™5K™KšΠbnœ˜Kš‘ œ˜Kš‘ œ˜Kš‘ œ˜Kš‘ œ˜Kš’ œ˜Kš’ œ˜K˜KšΟb œ˜Kš£œ˜Kš£ œ˜Kš£œ˜"Kš£œ˜!——K˜Kšžœ˜—…— ¨