ConvertPtToView(PtInPix: IGxPoint): IGxPointF;
PtInPix. Display point.
The ConvertPtToView method converts a point in screen coordinates into a point relative to the left upper corner of the spreadsheet visible area.
The visible area of a spreadsheet is the entire table except for the scroll bars:
Executing the example requires a form with the TabSheetBox component on it with the TabSheetBox1 identifier and the UiTabSheet component with the UiTabSheet1 name which is a data source for TabSheetBox. Below is given a procedure used to handle the OnMouseMove event (hovering over the component) for TabSheetBox1.
Sub TabSheetBox1OnMouseMove(Sender: Object; Args: IMouseEventArgs);
Var
TabSheet: ITabSheet;
TabView: ITabView;
Point: IGxPoint;
PointF: IGxPointF;
Begin
TabSheet := UiTabSheet1.TabSheet;
TabView := TabSheet.View;
Point := New GxPoint.Create(Args.pPoint.X, Args.pPoint.Y);
PointF := TabView.ConvertPtToView(Point);
If PointF.X = 0 Then
WinApplication.InformationBox("You have crossed the left border of the spreadsheet");
End If;
If PointF.Y = 0 Then
WinApplication.InformationBox("You have crossed the upper border of the spreadsheet");
End If;
End Sub TabSheetBox1OnMouseMove;
The example is executed when the user moves cursor over a spreadsheet (TabSheetBox1). If the cursor crosses its left or right border, the appropriate information message is displayed.
See also: