<<>> <> <> <> <> DIRECTORY Rope USING [ROPE], ImagerFont USING [Font], ViewerClasses USING [ClickProc, Viewer]; VTables: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; Viewer: TYPE = ViewerClasses.Viewer; VTable: TYPE = Viewer; Border: TYPE = RECORD [up,down,left,right: BOOL]; FullBorder: Border = [TRUE, TRUE, TRUE, TRUE]; NullBorder: Border = [FALSE, FALSE, FALSE, FALSE]; Create: PROC [ columns, rows: INTEGER ¬ 1, name: ROPE ¬ NIL, parent: Viewer ¬ NIL, xRuleWidth: INTEGER ¬ 1, yRuleWidth: INTEGER ¬ 1, x, y, w, h: INTEGER ¬ 0, scrollable: BOOL ¬ FALSE] RETURNS [table: VTable]; <> <> <> <<(and will be used as the parent)>> <> <> Install: PROC [table: VTable, paint: BOOL ¬ TRUE]; <> <> <> <> <<(SetEntryBorder, SetRowsAndColumns, SetTableEntry, SetEntryOffset)>> GetTableEntry: PROC [table: VTable, row, column: NAT ¬ 0] RETURNS [Viewer]; <> SetTableEntry: PROC [ table: VTable, row, column: NAT ¬ 0, name: ROPE ¬ NIL, flavor: ATOM ¬ NIL, proc: ViewerClasses.ClickProc ¬ NIL, clientData: REF ¬ NIL, w, h: NAT ¬ 0, xoff, yoff: INTEGER ¬ 0, border: Border ¬ FullBorder, font: ImagerFont.Font ¬ NIL, displayStyle: ATOM ¬ NIL, useMaxSize: BOOL ¬ FALSE]; <<... sets a table entry (requires installation afterwards). Invalid row and column specs cause bounds faults.>> <> < clientData is a pre-existing viewer (which had better have table as a parent!). >> < a new viewer of the appropriate flavor is created (appropriate arguments are passed through to CreateChild).>> < flavor = $Button will be forced>> <> <> SwapTableEntries: PUBLIC PROC [table: VTable, row1, column1, row2, column2: NAT ¬ 0, swapBorders: BOOL ¬ FALSE]; <> <> GetEntryBorder: PROC [table: VTable, row, column: NAT ¬ 0] RETURNS [Border]; <> <> <> SetEntryBorder: PROC [table: VTable, row, column: NAT ¬ 0, border: Border ¬ FullBorder]; <> <> GetEntryOffset: PROC [table: VTable, row, column: NAT ¬ 0] RETURNS [xoff,yoff: INTEGER]; <> SetEntryOffset: PROC [table: VTable, row, column: NAT ¬ 0, xoff,yoff: INTEGER ¬ 0]; <> <> GetRowsAndColumns: PROC [table: VTable] RETURNS [rows, columns: NAT]; <> SetRowsAndColumns: PROC [table: VTable, rows, columns: NAT ¬ 0]; <> <> <> ExchangeRows: PROC [table: VTable, row1,row2: NAT ¬ 0]; <> <> ExchangeColumns: PROC [table: VTable, column1,column2: NAT ¬ 0]; <> <> END.