Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
News Maps
Message
De
23/04/2008 01:52:08
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
23/04/2008 01:32:44
Information générale
Forum:
Politics
Catégorie:
Autre
Titre:
Divers
Thread ID:
01312022
Message ID:
01312555
Vues:
16
>>Another nice-to-have feature there would be to make tooltip stay longer on. About twice as much would be enough for me - and I read fast. Or if it needs to be configured somewhere, just say so in the help. The tooltips help a lot, as if I can read the tooltip, I don't need to wait for all the ads to fail to load just to see that the two paragraphs don't contain what title has promised - usual thing with news.
>
>Agree, but I don't know how to make the default tooltips stay longer. I remember seeing a custom tooltip class somwehere once but can't remember where.

I used this for a tooltip over an OCX (when nothing else worked, and I think the tip came from Borislav)
DEFINE WINDOW (SYS(2015)) NAME o AT 0, 0 SIZE 1,15 NONE FLOAT
this.AddProperty("oTool",o)
WITH this.oTool
	.alwaysontop=.t.
	.newobject("lbl", "_Label", "libs\default_class.vcx")
	.lbl.left=0
	.lbl.top=0
	.lbl.autosize=.t.
	.lbl.backcolor=0xffffff		&& maybe get the tooltip color from system colors?
	.lbl.borderstyle=1
	.lbl.visible=.t.
	.left=-2000
	.visible=.t.
ENDWITH
Then it was a matter of showing this where it should go, for as long as it was needed, and moving it back offscreen. Can't get into that part of the code, or much out of it, because it was around the OCX. Anyway, here's the relevant code:
PROCEDURE OnShowHint
*** ActiveX Control Event ***
LPARAMETERS x, y, hint, ignore
*SET STEP ON
thisform.setHint(x, y, hint, not ignore)
ENDPROC

*-- form.sethint:
Lpara tnleft, tntop, tcHint, lShow
lshow=lshow and !EMPTY(tcHint)
With This.oTool
	.lbl.Caption=" "+tcHint+" "
	If lShow        && this.ocnt is the OCX
		.Top=tntop+3-this.ocnt.Top
		.Left=tnleft+32
		.width=.lbl.width
		.height=.lbl.height
	ELSE
		.left=-2000
	Endif
*	.Visible=lShow
Endwith
I wrote this because there was some problem with OCX's own tooltips, which wouldn't go beyond VFP form's viewport and would show up in unpredictable positions.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform