ILanerBox.HitTest

Syntax

HitTest(X: Integer; Y: Integer): LanerBoxArea;

Parameters

X. Horizontal coordinate.

Y. Vertical coordinate.

Description

The HitTest method returns component area based on the specified coordinates.

Comments

Coordinates are specified relative to the left top corner of the component.

Example

Executing the example requires a form containing the LanerBox component named LanerBox1 name, and the UiErAnalyzer component used as a data source for LanerBox. The workbook of the time series database should be loaded to UiErAnalyzer. The Memo component with the Memo1 identifier is also available on the form.

The procedure must be set the OnMouseDown event handler for LanerBox.

Sub LanerBox1OnMouseDown(Sender: Object; Args: IMouseClickEventArgs);
Var
    BoxArea: LanerBoxArea;
    Point: IPoint;
Begin
    Point := Args.pPoint;
    BoxArea := LanerBox1.HitTest(Point.X, Point.Y);
    Select Case BoxArea
        Case LanerBoxArea.None: Memo1.Lines.Add("Area is undefined");
        Case LanerBoxArea.MethodsBar: Memo1.Lines.Add("Modeling panel");
        Case LanerBoxArea.Toolbar: Memo1.Lines.Add("Toolbar ");
        Case LanerBoxArea.Tabsheet: Memo1.Lines.Add("Data table");
        Case LanerBoxArea.DimPanel: Memo1.Lines.Add("Dimension panel");
    End Select;
End Sub LanerBox1OnMouseDown;

After executing the example, Memo1 shows the name of the clicked LanerBox area.

See also:

ILanerBox