Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid's column tooltip
Message
 
 
À
18/06/2015 12:40:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01621141
Message ID:
01621179
Vues:
81
>Grid tooltips are tricky. First, I'm assuming the form's ShowTips is .T. (I tend to forget to set that.)
>
>Beyond that, check the section titled "Grid component tooltips" in this: http://www.tomorrowssolutionsllc.com/Conference%20Sessions/Bind%20Events%20for%20Better%20Applications.pdf
>
>Tamar

Tamar,

My problem is the following:

I have a form class which includes Grid1 which is a native VFP grid (not a subclass). Your article talks about adding ToolTipText_Assign method to the grid's class. However, how can I add this method to that grid (which is in the form's class) and which is not even a subclassed grid?

Thanks in advance.

UPDATE. I've tried the following:

In the form's Init I added this:
BINDEVENT(thisform.Grid1, 'tooltiptext', thisform, 'tooltiptext_access', 0)
And I've added the following tooltiptext_access method for the form:
local cTip

* Let components have their own tooltips.
* Look up the tooltip for the object currently under the mouse.
local aMousePos[1], oColumn, oControl
cTip = thisform.grid1.ToolTipText

if amouseobj(aMousePos) > 0
	oColumn = aMousePos[1]
	if not isnull(m.oColumn) and upper(oColumn.baseclass) = "COLUMN"
		* First, grab column-level tip in case we don't find something below
		cTip = oColumn.tooltiptext
		
		IF oColumn.name = 'colReason'
			*=MESSAGEBOX(cTip)
			thisform.grid1.ToolTipText = m.cTip
		endif	
*!*			* Now, look for the right control.
*!*			oControl = evaluate("oColumn." + oColumn.currentcontrol)
*!*			if not empty(oControl.tooltiptext)
*!*				cTip = oControl.tooltiptext
*!*			endif
	endif
endif

return m.cTip
If I uncomment messagebox, I can see it (although not every time). But the tooltiptext still refuses to show :( I see tooltips for columns with small widths (the actual column content), but I still can do nothing to show the reason as a tooltip :(
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform