Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid activity for object under mouse
Message
From
04/04/2007 00:26:29
 
 
To
03/04/2007 15:42:57
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01211777
Message ID:
01211893
Views:
31
John --

I have the following for each column in my grid.

I hope this works; I've thrown a lot of code that's clearly irrelevant and distracting -- hopefully that's all I threw away.
Procedure MouseMove(x1,x2,x3,x4)
	Local nXCoord_In, nYCoord_In, lnColno, lnDiff, loGrid, nWhere_Out, nRelRow_Out, nRelCol_Out
	Local nView_Out

	With This.Parent

		* find out what row we're over
		nXCoord_In = Mcol(Wontop(),3)
		nYCoord_In = Mrow(Wontop(),3)
		Store 0 To nWhere_Out , nRelRow_Out , nRelCol_Out , nView_Out
		.GridHitTest(nXCoord_In, nYCoord_In, @nWhere_Out, @nRelRow_Out, @nRelCol_Out)

		* over a cell, but not the same as last time
		If nWhere_Out = 3 And nRelRow_Out # This.h_DynToolTipRow

			* temporarily activate first cell, so that .RelativeRow makes sense
			lnColno = This.Parent.Columns(This.Parent.c_ActivateCellColumn).ColumnOrder
			lnColno = lnColno + Iif(This.ColumnOrder = lnColno, 1, 0) - .LockColumns
			If .RelativeRow = 0 Or .RelativeColumn # lnColno
				.SetFocus()
				.ActivateCell(Max(1, .RelativeRow), lnColno)
			Endif

			* move to the record we're interested in
			lnDiff = nRelRow_Out - .RelativeRow

			Try
				Skip (lnDiff) In (.RecordSource)
			Catch

			EndTry
			
			*******************************************************

			*    temporarily on the right record ...
			*    so insert code to do something here ...
			
			*******************************************************

			Skip (-lnDiff) In (.RecordSource)
			This.h_DynToolTipRow = nRelRow_Out
		Endif
	Endwith
Endproc


Procedure MouseLeave(nButton, nShift, nXCoord, nYCoord)
	This.h_DynToolTipRow	= 0
	Try
		Thisform.ShowTip()
	Endtry
Endproc
>Is there still no way in vfp to get a grid to be aware of the mouse pointer over it? I want to be able to run the mouse over cells in a column and details from the record to be displayed elsewhere on the form, without each cell having to get clicked on, or getting focus. Thanks!
Jim Nelson
Newbury Park, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform