Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid's tooltip
Message
From
22/05/2007 17:26:59
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01109969
Message ID:
01227761
Views:
46
>>>>>Found a better class at http://www.foxclub.ru/sol/index.php?act=view&id=330 but it will require more time for translation. But this sample doesn't have problems of the previous solution.
>>>>
>>>>I suppose I'll have to wait for your translation. My Russian is non-existent.
>>>
>>>Probably next week then...
>>
>>Thanks, there's certainly no rush.
>
>For now I tried the following based on the idea of the previous sample. I bind Column's MouseMove to grid's method. I put the following code in this method
>
>
>LPARAMETERS nButton, nShift, nXCoord, nYCoord
>LOCAL loCalledBy AS OBJECT, nWhere_Out, lnRow, ;
>	lnCol, nView_Out, nr, lnColumn, lcValue, lcTip, lcSource
>lcTip = ""
>#DEFINE MAX_LEN 10
>AEVENTS[aCurEvent,0]
>loCalledBy = aCurEvent[1] && should be a column object
>THIS.TOOLTIPTEXT = ''
>
>IF VARTYPE(m.loCalledBy)= "O" AND NOT EMPTY(m.loCalledBy.CONTROLSOURCE)
>	lnColumn = m.loCalledBy.COLUMNORDER
>	lcSource = m.loCalledBy.CONTROLSOURCE
>	STORE 0 TO nWhere_Out, nRelRow_Out, nRelCol_Out, nView_Out
>	WITH THIS
>		.GridHitTest(m.nXCoord, m.nYCoord, @nWhere_Out, @lnRow, @lnCol)
>		IF m.nWhere_Out = 3 && In a Cell
>*!*	  						lnCol = m.lnCol + .LeftColumn - 1
>*!*	  						lnCol = .GetColumnIndex(m.lnCol)
>			IF .RELATIVEROW # 0
>				lnRow = m.lnRow - .RELATIVEROW
>				IF m.lnRow # 0
>					SKIP m.lnRow IN (.RECORDSOURCE)
>					lcTip = ;
>						ALLTRIM(TRANSFORM (EVALUATE (m.lcSource)))
>					SKIP -m.lnRow IN (.RECORDSOURCE)
>				ELSE
>					lcTip = ;
>						ALLTRIM(TRANSFORM (EVALUATE (m.lcSource)))
>				ENDIF
>			ELSE
>				MOUSE CLICK LEFT  && Limitation of the current approach
>				lcTip = ;
>					ALLTRIM(TRANSFORM (EVALUATE(m.lcSource)))
>			ENDIF
>		ELSE
>* We're not on the column with data
>*lcCaption = "Nothing to display"
>		ENDIF
>
>
>		IF LEN(m.lcTip) > MAX_LEN
>			.TOOLTIPTEXT = m.lcTip
>		ENDIF
>	ENDWITH
>ENDIF
>
>
>It seems to work, but the grid's tooltip doesn't always change correctly when you move mouse over different columns. I tried to apply Vlad's Grynchyshyn technique from the old FAQ, but it didn't work and the effect was completely weird.
>
>So, I'm not sure now how to force tooltip refresh when we move mouse.
>
>The solution from Russian website requires a separate timer and a window form.
>I'll leave this code for now until I find time to look closer at the other solution.


What seems to be missing is an effective method to make the current tooltip disappear. Changing the ToolTipText may or may not show the proper value unless the currently displayed on is made to disappear. Moving the mouse programmatically does not always make it happen (as per Vlad's code).
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform