-- HCells.mesa
-- Last Edited by: Sturgis, July 23, 1984 10:04:26 am PDT
DIRECTORY
Dependencies USING[Action],
IO USING[STREAM],
NewCalcGlobal USING[Displayer, Document],
Rope USING[ROPE],
StructureNodes USING[StructureNode],
ViewerClasses USING[Viewer];
HCells: DEFINITIONS =
BEGIN
-- note: in some of the following procedures there is a BOOLEAN parameter named "entry". This should be set true when called from outside the monitor protecting the object of the call, be it a GCell or a GCellArray. These outside calls will generally come from an instance of a GCellTool, or a GCellArrayTool. The called procedure will lock the appropriate monitor for the duration of the call.
HCell: TYPE = REF HCellBody;
HCellBody: TYPE;
ValueMode: TYPE = {exp, rowSum, rowTotal, colSum, itemArrayColTotal, lv, lvTimesExp, none};
IdMode: TYPE = {setId, none};
RowColSumMode: TYPE = {add, sub, none};
DisplayMode: TYPE = {text, value, control};
Justification: TYPE = {left, centered, right, leftDecimal, rightDecimal};
CreateHCell: PROCEDURE[document: NewCalcGlobal.Document, displayer: NewCalcGlobal.Displayer, hcaSn: StructureNodes.StructureNode, vParent: ViewerClasses.Viewer] RETURNS[StructureNodes.StructureNode, HCell];
DoRowSum: PROCEDURE[hcn: StructureNodes.StructureNode, sumToLeft: REAL] RETURNS[REAL];
DoRowTotal: PROCEDURE[hcn: StructureNodes.StructureNode, total: REAL];
DoColSum: PROCEDURE[hcn: StructureNodes.StructureNode, sumAbove: REAL] RETURNS[REAL];
DoItemArrayColSum: PROCEDURE[cell: HCells.HCell, total: REAL];
SetHCellParameters: PROCEDURE[cell: HCell, rowSummer, colSummer, itemArrayColSummer: Dependencies.Action, leftCell, rightCell: HCell, editable: BOOLEAN, text: Rope.ROPE, valueMode: ValueMode, rowSumMode: RowColSumMode, colSumMode: RowColSumMode, idMode: IdMode, displayMode: DisplayMode, justification: Justification, zeroValueText: Rope.ROPE, pageName: Rope.ROPE, arrayIdText: Rope.ROPE];
GetHCellText: PROCEDURE[cell: HCell] RETURNS[Rope.ROPE];
SetHCellText: PROCEDURE[cell: HCell, text: Rope.ROPE];
ForceHCellSelection: PROCEDURE[hcn: StructureNodes.StructureNode, conditional: BOOLEAN ← FALSE] RETURNS[succeeded: BOOLEAN];
-- if conditional is true, then succeeds only if the cell is editable
ForceNoteHCellSelection: PROCEDURE[cellRef: REF ANY];
-- HCellArrays
ArrayMode: TYPE = {individual, groupItem, groupSummary};
CreateHCellArray: PROCEDURE[document: NewCalcGlobal.Document, displayer: NewCalcGlobal.Displayer, vParent: ViewerClasses.Viewer, pageName: Rope.ROPE, arrayName: Rope.ROPE] RETURNS[StructureNodes.StructureNode];
LoadHCellArray: PROCEDURE[document: NewCalcGlobal.Document, displayer: NewCalcGlobal.Displayer, vParent: ViewerClasses.Viewer, pageName: Rope.ROPE, arrayName: Rope.ROPE, from: IO.STREAM, version: CARDINAL, mode: ArrayMode] RETURNS[StructureNodes.StructureNode];
ResetPageNameOfHCellArray: PROCEDURE[hcaSn: StructureNodes.StructureNode, pageName: Rope.ROPE];
WriteCellText: PROCEDURE[to: IO.STREAM, text: Rope.ROPE];
ReadCellText: PROCEDURE[from: IO.STREAM] RETURNS[Rope.ROPE];
--HCellArray Groups
CreateSummaryHCellArray: PROCEDURE[document: NewCalcGlobal.Document, displayer: NewCalcGlobal.Displayer, vParent: ViewerClasses.Viewer, pageName: Rope.ROPE] RETURNS[StructureNodes.StructureNode];
CreateHCellArrayModeledAfter: PROCEDURE[modelHcaSn: StructureNodes.StructureNode, document: NewCalcGlobal.Document, displayer: NewCalcGlobal.Displayer, vParent: ViewerClasses.Viewer, pageName: Rope.ROPE] RETURNS[StructureNodes.StructureNode];
AppendHCellArrayInGroup: PROCEDURE[newItemHcaSn: StructureNodes.StructureNode, afterHcaSn: StructureNodes.StructureNode];
InsertHCellArrayInGroup: PROCEDURE[newItemHcaSn: StructureNodes.StructureNode, beforeHcaSn: StructureNodes.StructureNode];
ConnectHCellArrayInGroup: PROCEDURE[newItemHcaSn, summaryHcaSn: StructureNodes.StructureNode, atRowNumber: CARDINAL];
GetSummaryArray: PROCEDURE[itemHcaSn: StructureNodes.StructureNode] RETURNS[summaryHcaSn: StructureNodes.StructureNode, atRow: CARDINAL];
DeleteHCellArrayFromGroup: PROCEDURE[hcaSn: StructureNodes.StructureNode];
END..
-- June 27, 1984 4:47:58 pm PDT: Sturgis, started HCell.mesa