CGXGridCore::HitTest
virtual int HitTest(CPoint& pt, ROWCOL* pnRow = NULL, ROWCOL* pnCol = NULL, CRect* rectHit = NULL);
pt
Window coordinate.
pnRow
A pointer to a row index. The pointer can be NULL if the row is not needed.
pnCol
A pointer to a column index. The pointer can be NULL if the column is not needed.
rectHit
A pointer to rectangle. The pointer can be NULL if the cell rectangle is not needed.
Return Value
Integer value specifying the type of information displayed at the window coordinate:
Hit-Code | Meaning |
GX_HORZLINE | Specifies the gridline of a row header. |
GX_VERTLINE | Specifies the gridline of a column header. |
GX_HEADERHIT | Specifies the interior rectangle of a row or column header. |
GX_CELLHIT | Specifies the interior rectangle of a cell. |
GX_SELEDGEHIT | Specifies that cursor is over the edge of a selection. This Hit-Test value will only be generated if m_bHitTestSelEdge is TRUE. |
GX_NOHIT | No information is displayed at the point. |
Remarks
HitTest is used to determine the type of information displayed at a window coordinate (pt). The cell coordinate is stored into *pnRow and *pnCol and the drawing rectangle of the cell into *rectHit.
If the point is on the right of the last column, *pnCol will be set to GetColCount( )+1.
If the point is below the last row, *pnRow will be set to GetRowCount( )+1.
See Also
CGXGridCore::m_bHitTestSelEdgeCGXGridCore::OnExtHitTest