[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Grids' (#lcl)

TCustomDrawGrid.DrawFocusRect

Draws the focus rectangle for the control.

Declaration

Source position: grids.pas line 1425

protected procedure TCustomDrawGrid.DrawFocusRect(

  aCol: Integer;

  aRow: Integer;

  ARect: TRect

); override;

Arguments

aCol

  

Column number for the cell with the focus rectangle.

aRow

  

Row number for the cell with the focus rectangle.

ARect

  

TRect instance with the bounds for the cell with the focus rectangle.

Description

DrawFocusRect is an overridden method used to draw the focus rectangle for the specified cell when the grid control or its cell Editor is focused. No actions are performed in the method if DefaultDrawing is set to False, or the grid is not Focused. In addition, the focus rectangle cannot be displayed if goAlwaysShowEditor has been enabled in Options and the Editor is either unassigned (Nil) or not focused.

DrawFocusRect calls CalcFocusRect to apply the cached visual information in GCache for the focused cell or row. This includes adjustments for grid lines when enabled for the control.

When UseXORFeatures is True, the Pen mode in the Canvas is updated to used the XOR drawing operator and the color needed for the control. The Canvas state is restored prior to exiting from the method.

DrawRubberRect is called to draw the rubber band rectangle with the appropriate borders using the FocusColor in the control.

DrawFocusRect is called from the DrawRow method.

See also

TCustomGrid.DrawFocusRect

  

Draws the focus rectangle for the specified cell.

TCustomGrid.DrawRow

  

Draws the columns for the specified row in the grid control.


Version 4.0 Generated 2025-05-03 Home