TCustomGrid.DrawCellGrid procedure
Draws cell grid lines for the control.
Declaration
procedure DrawCellGrid(aCol: Integer; aRow: Integer; aRect: TRect;
aState: TGridDrawState); virtualArguments
aCol | Column number for the cell. |
aRow | Row number for the cell. |
aRect | Rectangle with the screen coordinates for the cell. |
aState | State for the cell (normal, fixed, pushed, et. al.). |
Description
DrawCellGrid is a procedure used to draw cell grid lines for both
a fixed and a non-fixed cell in the grid control.
DrawCellGrid ensures that the control Canvas (and its
Pen) are updated to use the values needed to draw the fixed or
non-fixed cell at the location specified in ACol and
ARow.
For a fixed cell (when gdFixed is in AState), grid lines are drawn
when gdoFixedVertLine or gdoFixedHorzLine is found in
the Options property. The Pen in the control Canvas is updated to
reflect a non-zero value in GridLineWidth.
When Flat is set to False, the value in AState is used to
determine the color used for the Pen. Canvas drawing methods, like
MoveTo and LineTo, are used to draw the cell grid lines
at the coordinates in ARect. The value in UseRightToLeftAlignment
determines how values in ARect are adjusted for the operation.
When Flat is set to True, the value in FixedGridLineColor
is used as the color for the Pen.
For a non-fixed cell (gdFixed is not in AState), grid lines are drawn when
gdoVertLine or gdoHorzLine is found in the Options
property. The Pen in the control Canvas is updated to use the GridLineWidth,
GridLineStyle, and GridLineColor for the control.
Canvas drawing methods, like MoveTo and LineTo, are used to draw the cell
grid lines at the coordinates in ARect. The value in UseRightToLeftAlignment
determines how values in ARect are adjusted for the operation.
DrawCellGrid is called from the DrawCell method after preparing
the Canvas and drawing the filled rectangle with the background for the cell.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
