YOUSEFUL / DELPHI / COMPONENTS

TAtlasGridHit

The result of TAtlasVirtualGrid.HitTest: area, column and row under a point.

Record Unit Atlas.VGrid · Product Atlas Virtual Grid

Description

Returned by HitTest(X, Y) of TAtlasVirtualGrid. Frozen columns lie on top of scrolled ones and are tested first.

Members

MemberKindWhat it does
AreafieldWhat is under the point.
ColumnfieldIndex into Columns, or -1 for gaNone.
RowfieldThe 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.

pascal
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;

TAtlasGridArea · TAtlasVirtualGrid

Also in Atlas Virtual Grid

TAtlasVirtualGrid · TAtlasMemoryData · TAtlasVirtualData · TAtlasPlotData