Navigation:  Classes > bBrowser >

bBrowser:GetCellFromPoint()

Print this Topic    Previous pageReturn to chapter overviewNext page

Purpose

Determines the cell position relating to a specific point.

Class

bBrowser

Type

Method

Syntax

<oBrowser>:GetCellFromPoint(<oPoint>) Æ oCell

Arguments

<oPoint>The point object for which the data cell is to be determined.
Data Type:Point

Return Value

oCellThe column and row number of the data cell that is under the specified point.
Data Type:bCell

Description

bBrowser:GetCellToPoint() returns cell positional data that corresponds to the point specified in the parameter supplied.

 

The coordinate refers to the origin left above within the ClientArea (CanvasArea) of the browser.

Samples

The following sample intercepts all mouse movements in a window and displays in the caption of the window for the respective position of the mouse the cell that is under it (column and row).

 

METHOD Dispatch(oEvent) CLASS myDataWindow

 LOCAL oCell  AS bCell

 LOCAL oPoint AS Point

 LOCAL sPoint IS _winPoint

 

 // intercepts mouse movements

 IF oEvent:Message=WM_SETCURSOR

         IF SELF:oDCbBrowser<>NULL_OBJECT

                 // determine the position of the mouse

                 // -> the position refers to the left

                 //    upper corner of the desktop

                 GetCursorPos(@sPoint)

 

                 // transform mouse position on the left

                 // upper corner of the bBrowser

                 ScreenToClient(SELF:oDCbBrowser:Handle(), @sPoint)

                 oPoint := Point{sPoint.X, sPoint.Y}

 

                 // determine the cell under the mouse

                 oCell := SELF:oDCBrowser:GetCellFromPoint(oPoint)

 

                 // output the cell in the caption of the window

                 SELF:Caption := "Column: "+NTrim(oCell:Column);

                                                 +" - Row: "+NTrim(oCell:Row)

         ENDIF

 ENDIF

 RETURN SUPER:Dispatch(oEvent)        

See Also

bBrowser:GetCaptionRect()

bBrowser:GetCellAreaRect()

bBrowser:GetCellRect()

bBrowser:GetColumnFromPoint()

bBrowser:GetColumnRect()

 


Page url: http://www.YOURSERVER.com/index.html?bbrowser_getcellfrompoint.htm