Sign in Join
FPDoc Onlineexperiment

TCustomGrid.OnPrepareCanvas property

Member of TCustomGridprotectedIn unit Grids

Event handler signalled to prepare the Canvas to draw the grid.

Declaration

pascal
property OnPrepareCanvas: TOnPrepareCanvasEvent read FOnPrepareCanvas write FOnPrepareCanvas;

Description

OnPrepareCanvas is a TOnPrepareCanvasEvent property with the event handler signalled to configure the control Canvas to draw a cell at specified coordinates using a specific state. OnPrepareCanvas is signalled (when assigned) from the DoPrepareCanvas method.

OnPrepareCanvas allows the Pen, Brush, Font, and Color defaults assigned in PrepareCanvas to be overridden for a specified column and row to use a specific TGridDrawState value. It offers the last chance to change the appearance of a cell before it is drawn in the DrawCell or ShowCellHintWindow methods.

Use OnDrawCell (implemented in the TCustomDrawGrid descendant) to override the actions performed in the DefaultDrawCell method when DefaultDrawing is enabled.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.