Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP9 SP2 Tooltips for Grid.Columns and Headers removed!!
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01260797
Message ID:
01502254
Vues:
99
Hi Naomi,

I'm sorry, wrong recipient.
The answer is "yes" to your question.

MartinaJ

>I'm going to try to hook Header's methods to Grid's methods - don't want to use extra class.
>
>Thanks a lot for your help.
>
>>Is not good way, but....
>>
>>
>>DECLARE Sleep IN kernel32 integer
>>
>>* Form::Init
>>Thisform.AddObject("Proxy",CREATEOBJECT("_ColumnProxy"))
>>This.Proxy.oCol=This.Grid.Column1 &&
>>
>>BINDEVENT(This.Grid.Column1,"MouseLeave",This.Proxy,"MouseLeave")
>>BINDEVENT(This.Grid.Column1,"MouseEnter",This.Proxy,"MouseEnter")
>>BINDEVENT(This.Grid.Column1.Header1,"MouseLeave",This.Proxy,"MouseLeave")
>>BINDEVENT(This.Grid.Column1.Header1,"MouseEnter",This.Proxy,"MouseEnter")
>>
>>ADDPROPERTY(This.Grid.Column1,"ToolTipSource","")
>>
>>* form:QueryUnload
>>This.Proxy.oCol=.NULL.
>>
>>
>>DEFINE CLASS _ColumnProxy AS CUSTOM
>>   Name="_ColumnProxy"
>>   oCol=.NULL.
>>
>>   PROCEDURE MouseLeave(nButton, nShift, nXCoord, nYCoord)
>>      LOCAL lcCur,llST
>>      This.oCol.Parent.ToolTipText= ""
>>      lcCur=SET("CURSOR")
>>      SET CURSOR OFF
>>      llST=_Screen.ActiveForm.ShowTips
>>      _Screen.ActiveForm.ShowTips= .F.  && now turn off currently displayed tip
>>      =Sleep(100)
>>      _Screen.ActiveForm.ShowTips= llST
>>      SET CURSOR &lcCur.
>>   ENDPROC
>>
>>   PROCEDURE MouseEnter(nButton, nShift, nXCoord, nYCoord)
>>      IF EMPTY(This.oCol.ToolTipSource)
>>         This.oCol.Parent.ToolTipText= This.oCol.ToolTipText
>>      ELSE
>>         This.oCol.Parent.ToolTipText= EVALUATE("This.oCol."+This.oCol.ToolTipSource+".ToolTipText")
>>      ENDIF
>>   ENDPROC
>>
>>ENDDEFINE
>>
>>
>>MartinaJ
>>
>>>So, will I bind header's MouseEventer/MouseLeave to grid's same methods?
>>>
>>>>You can use BINDEVENT() .
>>>>For adding property at run you can use method AddProperty() or function ADDPROPERTY().
>>>>
>>>>and instead INKEY(.1) you must use Sleep(100)
>>>>DECLARE Sleep IN kernel32 integer
>>>>
>>>>MartinaJ
>>>>
>>>>>Hi Martina,
>>>>>
>>>>>Do you have generic code I can use on the grid's level for this? We don't use custom column class and I don't want to introduce one.
>>>>>
>>>>>>>I wanted to share a further improvement on this that I finally discovered. One of the remaining issues was that setting the ToolTipText= "" does not turn off the displayed tooltip immediately as it would normally when you move off of an item. So to get the ToolTip display to go away as soon as the cursor is moved off of the grid column, you can do the following. (Good ole INKEY() to the rescue again). I couldn't find any other way to make this work without using INKEY().
>>>>>>>
>>>>>>>-Mark
>>>>>>
>>>>>>Next version...
>>>>>>
>>>>>>* Add new property ToolTipSource with value "Header1" to class Column
>>>>>>
>>>>>>* Add this to the Column.MouseLeave event
>>>>>>LOCAL lcCur,llST
>>>>>>This.Parent.ToolTipText= ""
>>>>>>lcCur=SET("CURSOR")
>>>>>>SET CURSOR OFF
>>>>>>llST=Thisform.ShowTips
>>>>>>Thisform.ShowTips= .F.  && now turn off currently displayed tip
>>>>>>INKEY(.1)
>>>>>>Thisform.ShowTips= llST
>>>>>>SET CURSOR &lcCur.
>>>>>>
>>>>>>* Add this to the Column.MouseEnter event, (as Andreas provided).
>>>>>>IF EMPTY(This.ToolTipSource)
>>>>>>   This.Parent.ToolTipText= This.ToolTipText
>>>>>>ELSE
>>>>>>   This.Parent.ToolTipText= EVALUATE("This."+This.ToolTipSource+".ToolTipText")
>>>>>>ENDIF
>>>>>>
>>>>>>* Add this to the object/class Header.MouseLeave event
>>>>>>This.Parent.MouseLeave(nButton, nShift, nXCoord, nYCoord)
>>>>>>
>>>>>>* Add this to the object/class Header.MouseEnter event
>>>>>>This.Parent.MouseEnter(nButton, nShift, nXCoord, nYCoord)
>>>>>>
>>>>>>
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform