-- GCellprivateDefs.mesa -- Last Edited by: Sturgis, July 10, 1984 9:11:03 pm PDT DIRECTORY Expressions USING[AnalyzedExpression, AnalyzedIdentifier, IdTableSet], Dependencies USING[Action, DataItem], GCell USING[GCellItemDescriptor, GCellItemJustification, GCellItemMode, GCellItemRowColSumMode, GCellItemValueMode], IO USING[STREAM], NewCalcGlobal USING[Displayer, Document], Rope USING[ROPE], StructureNodes USING[DisplayArray, StructureNode], ViewerClasses USING[Viewer]; GCellPrivateDefs: DEFINITIONS = BEGIN OPEN Dependencies, Expressions, GCell, IO, NewCalcGlobal, Rope, ViewerClasses; GCell: TYPE = REF GCellBody; GCellBody: PUBLIC TYPE = RECORD[ da: StructureNodes.DisplayArray, selfI, selfJ: CARDINAL _ 0, document: NewCalcGlobal.Document, displayer: NewCalcGlobal.Displayer, gcaSn: StructureNodes.StructureNode, vParent: Viewer, rowSummer, colSummer: Action _ NIL, screenLead: INTEGER _ 0, screenSpace: INTEGER _ 0, textLead: INTEGER _ 0, textSpace: INTEGER _ 2, -- eventually this will become changeable by GCellTool textNLines: INTEGER _ 0, -- set by preshow lastPrePaintY, lastPrePaintX, lastPrePaintL, lastPrePaintR, lastPrePaintW: INTEGER _ 0, unPainted: BOOLEAN _ TRUE, nItems: CARDINAL _ 0, items: Item _ NIL ]; Item: TYPE = REF ItemBody; ItemBody: TYPE = RECORD[ da: StructureNodes.DisplayArray, selfI, selfJ: CARDINAL _ 0, selfItemX: CARDINAL _ 0, mode: GCellItemMode, justification: GCellItemJustification, rowSumMode: GCellItemRowColSumMode, colSumMode: GCellItemRowColSumMode, valueMode: GCellItemValueMode, idName: ROPE, expressionText: ROPE, zeroValText: ROPE, created: BOOLEAN _ TRUE, expressionBad: BOOLEAN _ TRUE, expression: AnalyzedExpression _ [NIL], evalAction: Action _ NIL, -- created only if expression is not simple constant firstTime: BOOLEAN _ TRUE, -- set false after value is first displayed value: REAL _ 0, valueChanges: DataItem _ NIL, -- created only if information passes through this item idBad: BOOLEAN _ TRUE, id: AnalyzedIdentifier _ [NIL], assignAction: Action _ NIL, -- created only if there is an identifier buttonText: ROPE, buttonTextDirty: BOOLEAN _ FALSE, -- set true when buttonText changed buttonTextAnalyzed: BOOLEAN_ FALSE, -- set false when text becomes dirty, is set true when analyzed buttonShapeDirty: BOOLEAN _ FALSE, -- set true when shape recomputed, textDirty is set false at that time. buttonL, buttonA, buttonB, buttonR, buttonW: INTEGER _ 0, buttonHeight: INTEGER _ 0, textL, textA, textB, textR, textW: INTEGER _ 0, viewerX, viewerY, viewerW: INTEGER _ 0, dirty: BOOLEAN _ TRUE, viewer: Viewer _ NIL, viewerMode: ItemViewerMode _ nil, editable: BOOLEAN _ FALSE, next: Item _ NIL]; ItemViewerMode: TYPE = {nil, button, textBox}; ItemRefDesc: TYPE = REF ItemRefDescBody; ItemRefDescBody: TYPE = RECORD[da: StructureNodes.DisplayArray, I, J: CARDINAL, itemX: CARDINAL]; -- procedures supplied to GCellImplA by GCellImplB ReadOneItem: PROCEDURE[from: STREAM, version: CARDINAL] RETURNS[GCellItemDescriptor]; CreateItem: PROCEDURE[idTables: IdTableSet, gc: GCell, da: StructureNodes.DisplayArray, selfI, selfJ, selfItemX: CARDINAL, desc: GCellItemDescriptor, show: BOOLEAN] RETURNS[item: Item]; AnalyzeItemExpression: PROCEDURE[idTables: IdTableSet, gc: GCell, item: Item]; HandleItemValueChanges: PROCEDURE[gc: GCell, item: Item]; DoItemRowSum: PROCEDURE[gc: GCell, item: Item, sum: REAL] RETURNS[REAL]; ClearGCell: PROCEDURE[gc: GCell]; GetItemDescriptor: PROCEDURE[item: Item] RETURNS[GCellItemDescriptor]; ItemAcceptsSelection: PROCEDURE[item: Item] RETURNS[BOOLEAN]; ForceItemSelection: PROCEDURE[gcSn: StructureNodes.StructureNode, gc: GCell, item: Item]; WriteOneItem: PROCEDURE[desc: GCellItemDescriptor, to: STREAM]; SubstituteInItem: PROCEDURE[idTables: IdTableSet, gc: GCell, item: Item, newText: Rope.ROPE, oldText: Rope.ROPE]; CheckItemForDirtyData: PROCEDURE[gc: GCell, item: Item]; ComputeTextShape: PROCEDURE[item: Item]; ShowItem: PROCEDURE[item: Item, L, R, W: INTEGER, to: STREAM]; AnalyzeItemId: PROCEDURE[idTables: IdTableSet, gc: GCell, item: Item]; DoItemColSum: PROCEDURE[gc: GCell, item: Item, sum: REAL] RETURNS[REAL]; PrePaintItem: PROCEDURE[gc: GCell, item: Item, y, x, L, R, W: INTEGER]; PaintItem: PROCEDURE[gc: GCell, item: Item, dirtyOnly: BOOLEAN]; NoteCoordinatesItem: PROCEDURE[item: Item, document: NewCalcGlobal.Document, da: StructureNodes.DisplayArray, I, J, x: CARDINAL]; END.. -- February 28, 1983 4:50 pm: Sturgis, started GCellPrivateDefs.mesa -- March 1, 1983 1:44 pm: add ncGlobal to NoteCoordinates item. -- March 3, 1983 2:33 pm: remove idTables from GCell, and modify appropriate procedures to take idTables as an argument.