Sign in Join
FPDoc Onlineexperiment

TCustomGrid.CalcFocusRect procedure

Member of TCustomGridprotectedIn unit Grids

Calculates the bounds for a focus rectangle in the grid control.

Declaration

pascal
procedure CalcFocusRect(var ARect: TRect; adjust: Boolean=True)

Arguments

ARect

TRect instance where the adjusted row or cell selection is stored.

adjust

Description

When row selection is enabled in the grid Options, the Left and Right values in ARect are updated to use cached grid information in GCache. Calls FlipRect to account for Right-to-Left alignment when needed.

Adjust indicates whether values in ARect are adjusted for horizontal or vertical grid lines drawn in the control. No additional actions are performed when Adjust is set to False. The default value for the parameter is True.

When goHorzLine is included in Options, the Bottom value in ARect is decremented to accommodate the horizontal grid line.

When goVertLine is included in Options, the Left or Right value in ARect is adjusted to accommodate the vertical grid line. Left is incremented when UseRightToLeftAlignment is set to True. Right is decremented when UseRightToLeftAlignment is set to False.

CalcFocusRect is called from the DrawRow and DrawFocusRect methods.

See also

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