The cell
The cell can hold three modes: (possible empty) text, a numerical value, or a formula. Its mode is stored in the cellMode
field. It can hold the value TextMode
, ValueMode
, or FormulaMode
. Similar to CalcDocument
in this chapter and WordDocument
in the previous chapters, we refer to the current value of cellMode
in expressions such as in text mode, in value mode, and in formula mode.
HeaderWidth
, HeaderHeight
, ColWidth
, and RowHeight
are the size of the headers and cells of the spreadsheet. In order for the cell text to not overwrite the cell's borders, CellMargin
is used. The spreadsheet is made up of ten rows and four columns.
Cell.h
extern const int HeaderWidth, HeaderHeight, ColWidth, RowHeight, CellMargin; #define Rows 10 #define Cols 4
A cell can be aligned at the left, center, right or justified in the horizontal direction, and it can be aligned at the top, center, or bottom in the vertical direction:
enum Alignment {Left, Center...