TCustomDrawGrid.DrawCell procedure
Draws the content for the cell specified in the ACol and ARow arguments.
Declaration
procedure DrawCell(aCol: Integer; aRow: Integer; aRect: TRect;
aState: TGridDrawState); overrideArguments
aCol | Column number for the cell rendered in the method. |
aRow | Row number for the cell rendered in the method. |
aRect | Rectangle where the cell is drawn. |
aState | Grid drawing state for the cell content, editor control, or borders. |
Description
DrawCell is an overridden method in
TCustomDrawGrid. It
re-implements the method from the ancestor class, and does
not call
the inherited method. DrawCell is used to draw the content for the cell
specified in the ACol and ARow arguments at the position in the ARect
parameter. AState contains the grid drawing state applied to the cell.
DrawCell calls PrepareCanvas to initialize the Canvas for the control to the state in AState. This includes setting the default Color, Pen, Brush, and Font attributes used to render the cell content or editor control. The OnPrepareCanvas event handler is signalled to allow the default canvas settings to be overridden on a cell-by-cell basis.
At run-time, DefaultDrawCell is called to perform the default drawing routine for the cell when DefaultDrawing is set to True. DefaultDrawCell is always called at design-time.
At run-time, the OnDrawCell event handler is signalled (when assigned) to render the cell to the Canvas for the control using the grid draw state in the AState argument. When DefaultDrawing is False, OnDrawCell is responsible for all actions performed to draw the cell.
DrawCellGrid is called prior to exit to draw grid lines around the cell (when enabled).
DrawCell is called from the DrawRow method when it renders the visible cells in the grid row.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
