Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid.MouseMove Refresh Rate
Message
From
15/04/2008 22:07:12
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
15/04/2008 21:50:35
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01310942
Message ID:
01310971
Views:
10
Update: I moved my code into the grid's MouseEnter event and am using a Timer to call that. The MouseEnter has the same functionality and parameters as the MouseMove, but now I can control the frequency it is called. Not perfect, but getting closer.


>Jay --
>
>Did you try the code I supplied in an earlier thread?
>
>The part of that code that actually does the display you're interested in only runs once per each cell.
>
>Jim

I did, but I combined it with some other code I found and put it at the grid level. I'll post it here; let me know what you think I'm totally screwing up. And, the oPopUpInfoForm never appears for me in the grid. It will from a textbox directly on the form though. I know the code is working as the WAIT window and labels appear and refresh.

Update: Some of the naming conventions are odd, but I'm still testing and playing.
LPARAMETERS nButton, nShift, nXCoord, nYCoord

THISFORM.LockScreen = .T.

LOCAL ;
	nXCoord_In, ;
	nYCoord_In, ;
	lnColno, ;
	lnDiff, ;
	loGrid, ;
	nWhere_Out, ;
	nRelRow_Out, ;
	nRelCol_Out, ;
	nView_Out, ;
	CurrentRecNo

WITH THIS

	* Remember the current record
	CurrentRecNo = RECNO((.RECORDSOURCE))
	SCATTER NAME oCurrentRecord

	* 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)

	IF nWhere_Out = 3 AND nRelRow_Out # .DynamicToolTipRow


* SET STEP ON 


*		WAIT WINDOW TRANSFORM(nRelRow_Out) + ' ' + TRANSFORM(nRelCol_Out) NOWAIT

		* temporarily activate first cell, so that .RelativeRow makes sense
		lnColno = .COLUMNS(nRelCol_Out).COLUMNORDER
		lnColno = lnColno + IIF(.COLUMNS(nRelCol_Out).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

		*******************************************************

*		IF RECNO() = CurrentRecNo
			WAIT WINDOW 'Record Number: ' + TRANSFORM(RECNO()) NOWAIT
*			THISFORM.oPopUpInfoForm.zOrder(0)
*			THISFORM.oPopUpInfoForm.AutoCenter = .T.
*			THISFORM.oPopUpInfoForm.Visible = .T.
*		ENDIF

		THISFORM.lblRemCode.Caption = TRANSFORM(oCurrentRecord.Rem_Code)
		THISFORM.lblRemCode.Refresh
		THISFORM.lblRemDesc.Caption = TRANSFORM(oCurrentRecord.Rem_Desc)
		THISFORM.lblRemDesc.Refresh
		THISFORM.lblSchColor.Caption = TRANSFORM(oCurrentRecord.Sch_Color)
		THISFORM.lblSchColor.Refresh

		*******************************************************

		SKIP (-lnDiff) IN (.RECORDSOURCE)
		.DynamicToolTipRow = nRelRow_Out

	ENDIF
	.DynamicToolTipRow = 0
ENDWITH

m.CurrentMousePointer = THISFORM.MousePointer
m.TimerPause = DATETIME() + .25
DO WHILE DATETIME() < m.TimerPause
	THISFORM.MousePointer = 1
ENDDO
THISFORM.MousePointer = m.CurrentMousePointer

THISFORM.LockScreen = .F.

RETURN .T.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform