<< Return to Main Index

< Return to Class Index

CGXGridCore::OnRButtonHitRowCol

virtual BOOL OnRButtonHitRowCol(ROWCOL nHitRow, ROWCOL nHitCol, ROWCOL nDragRow, ROWCOL nDragCol, CPoint point, UINT flags, WORD nHitState);?

nHitRow

Specifies the row id where the user clicked the mouse.

nHitCol

Specifies the column id where the user clicked the mouse.

nDragRow

Specifies the row id where the user has dragged the mouse.

nDragCol

Specifies the column id where the user has dragged the mouse.

point

Specifies the x- and y-coordinate of the cursor. These coordinates are always relative to the upper-left corner of the window.

flags

MK_SHIFT    Set if the SHIFT key is down.

nHitState

GX_HITCURRENTCELL: User pressed mouse in current cell.

Return Value

TRUE if action has been successfully processed; FALSE if it failed. If nHitStart is GX_HITSTARTand you return FALSE, you can prevent switching the grid to autoscroll mode and cancel the current operation.

Remarks

This method is called when the user has clicked the right mouse button in a cell. Subsequent calls occur when the mouse is dragged and when the user releases the mouse button.

The base-class version of this method calls the RButtonDown, MouseMove and RButtonUp methods of the control associated with the cell where the user clicked the mouse. If the user pressed the mouse on a new cell but the current cell’s data is invalid, OnRButtonHitRowCol will return FALSE. This prevents further user interaction with the grid.

You should override this method if you want to implement some dragging capabilities in your grid.

If you only want to check where the user pressed a mouse and depending on the mouse position start some actions, you should process the OnRButtonDown message and determine the HitTest value. When you call the base-class OnRButtonDown message, OnRButtonHitRowCol will be called.

See Also

CGXControl::RButtonDown CGXGridCore::HitTest

CGXGridCore

Class Overview | Class Members