<< Return to Main Index

< Return to Class Index

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:

Width1Width3Width2448 Width3Width3543 Hit-Code MeaningWidth1Width3Width2448 Width3Width3543
Width1Width3Width2448 Width3Width3543 GX_HORZLINE Specifies the gridline of a row header.Width1Width3Width2448 Width3Width3543
GX_VERTLINE Specifies the gridline of a column header.Width1Width3Width2448 Width3Width3543
GX_HEADERHIT Specifies the interior rectangle of a row or column header.Width1Width3Width2448 Width3Width3543
GX_CELLHIT Specifies the interior rectangle of a cell.Width1Width3Width2448 Width3Width3543
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.Width1Width3Width2448 Width3Width3543
GX_NOHIT No information is displayed at the point.Width1Width3Width2448 Width3Width3543
Width1Width3Width2448 Width3Width3543 Width1Width3Width2448 Width3Width3543

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_bHitTestSelEdge CGXGridCore::OnExtHitTest

CGXGridCore

Class Overview | Class Members