YOUSEFUL / DELPHI / COMPONENTS
TAtlasGridHit
The result of TAtlasVirtualGrid.HitTest: area, column and row under a point.
Description
Returned by HitTest(X, Y) of TAtlasVirtualGrid. Frozen columns lie on top of scrolled ones and are tested first.
Members
| Member | Kind | What it does |
|---|---|---|
Area | field | What is under the point. |
Column | field | Index into Columns, or -1 for gaNone. |
Row | field | The row as shown for gaCell; -1 otherwise. |
Fields
Area field
Area: TAtlasGridArea;What is under the point. See TAtlasGridArea.
Column field
Column, Row: Integer;Index into Columns, or -1 for gaNone.
Row field
Column, Row: Integer;The row as shown for gaCell; -1 otherwise.
Examples
Describe a point
Uses Area, Column and Row.
uses System.SysUtils, Atlas.VGrid;
function DescribePoint(Grid: TAtlasVirtualGrid; X, Y: Integer): string;
var Hit: TAtlasGridHit;
begin
Hit := Grid.HitTest(X, Y);
case Hit.Area of
gaBand: Result := 'band ' + Grid.Columns[Hit.Column].Band;
gaHeader: Result := 'title of column ' + IntToStr(Hit.Column);
gaDivider: Result := 'right border of column ' + IntToStr(Hit.Column);
gaCell: Result := 'cell ' + Grid.CellText(Hit.Column, Hit.Row);
gaFooter: Result := 'total ' + Grid.TotalText(Hit.Column);
else
Result := 'nothing';
end;
end;
Related
TAtlasGridArea · TAtlasVirtualGrid
Also in Atlas Virtual Grid
TAtlasVirtualGrid · TAtlasMemoryData · TAtlasVirtualData · TAtlasPlotData