Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid.MouseMove Refresh Rate
Message
From
16/04/2008 01:13:57
 
 
To
15/04/2008 22:07:12
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01310942
Message ID:
01310990
Views:
10
Jay --

Your main problem here is with

.DynamicToolTipRow = 0

which is set way down at the bottom of the code. It shouldn't be there. Instead, it should be in MouseLeave. This is the variable which remembers what cell you're in. You'll note it is set almost immediately above. Once you move this to MouseLeave, you won't see the repeated fluttering from repeated calls when you hover the mouse over a cell.

Other comments:

(1) You'll no longer need to do anything with a Timer.

(2) I see a "SCATTER" call along the way ... if it's necessary, you should put it later, where you do all the THISFORM assignments. (Until then, the current record is not the record that the mouse is hovering over).

(3) Using MouseEnter won't be sufficient -- it doesn't fire if you move the cursor up/down to cells above/below. This code belongs in MouseMove.

Hope this helps

Jim


>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.
>
Jim Nelson
Newbury Park, CA
Previous
Reply
Map
View

Click here to load this message in the networking platform