Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hyperlink Tooltip 2

Status
Not open for further replies.

Koen Piller

Programmer
Jun 30, 2005
841
NL
Hi,

1)When I set the property Enablehyperlink .T. in my textox, there is a tooltip shown "Ctrl + click to follow link" how can I translate this to my native lanquage?
2)How to set the background colour? Default is black, would like to have it white.

Regards,

Koen
 
Hi Koen,

I know I have a solution for this somewhere, including an updated VFP DLL. I will look for this.
Do you know how much I can upload here? Or on foxite?

Regards,

Gerrit
 
Gerrit,
dont know, but you can weTransfer it to me? koenDOTpillerATgmailDOTcom
groet,
Koen
 
You can't do that with native tooltips, but it's fairly easy to create your own tooltip class which you can customise in any way you like. Theree are also several generic tooltip classes available from various sources.

The problem with that approach is that it is only really suitable if the textbox contains a hyperlink and nothing else. The point is that you show the tip in the MouseEnter event, and hide it in the MouseLeave. But those events have no way of knowing whether the mouse is over the hyperlink at any given moment, or over the other text within the textbox.

The nXCoord and nYCoord parameters tell you where the mouse is within the form, but you would then have to translate that to coordinates relative to the textbox, and then figure out where the hyperlink begins and ends within the textbox. That could be tricky.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,
How can I disable the default Tooltip text which comes with the EnableHyperlink?
To create my own tooltip is not a problem.
How do I set the background colour of my Textbox with EnableHyperlink to an other colour than the default black?
Regards.
Koen
 
Koen, the only way to disable the default hyperlink tooltip is to disable tooltips for the entire form (ShowTips = .F.).

I don't understand your second question, re the background colour. I don't see a default of black in the textbox. The hyperlink's background colour is the same as the rest of the textbox. Is that not what you are seeing?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,
OK, will apply my own tooltip class for the whole form. The blackbackground is indeed what I see. I will throw an example/test form and upload it here.
Regards,
Koen
 
Koen,

Just to be completely clear: You are talking about the background colour of the hyperlink? Within the edit box? Is that right.

If so, I am definitely not seeing it. Here is the form you uploaded, with a hyperlink filled in:

hyperlinkform_jh1nqx.jpg


Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

Hmmm, what could be the reason that I see this?

Regards,

Koen
Naamloos_jcvgtl.png
 
Koen, to go back to your original question, you asked how to translate "Ctrl + click to follow link". That string is in the Foxpro resource file: VFP9xxx.DLL, where "xxx" is the language code.

So, provided you are distributing the correct DLL, the string should be translated automatically (as are all other English strings that are built into the VFP runtime).

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I've never seen that before, Koen, and I can't reproduce it.

Does the black background only appear when the edit box contains a hyperlink? And what happens if there is other text in the box, apart from the hyperlink?

Anyone else got any ideas?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,
Thanks,
So for Dutch I shall have to 'hack' the VFP9EN.DLL, hmm a lot more difficult than to change any other English display into Dutch, maybe there is a .H file where I can change the wording. Let me have a look.
How about the black background? You have white and I have black. We are both using VFP9EN.DLL
Regards,
Koen
 
You shouldn't have to hack VFP9ENU.DLL. There should be another file for Dutch strings. I don't know the name, but it should be similar to VFP9xxx.DLL. Maybe VFP9NDL.DLL (that's just a guess). If you can find it, you use the -L command-line parameter to load it at run time.

If you do decide you need to hack VFP9ENU.DLL, do so very carefully (I'm sure I didn't need to tell you that). You'll find the relevant string at offset 5EF0.

By the way, this DLL has got nothing to do with the black background. It is only concerned with character strings.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Mike,

There is no such file as VFP9xx for Dutch. The team made one for English, one for French, one for German and a Korean.
Only around 15mil people for Dutch, to little.
Changed the English file, no effect, suppose I have to recompile the DLL. Will further investigate.
Do you have any idea why I get this black background?

Regards,

Koen
 
Just to add another test sample: I also see no black background. So this really must be something about your system and I'd look into Windows settings and version and for example themes more than into anything VFP related.

I neither get a black editbox background nor black tooltip.

Re4garding the language resources, there also is Chinese simplified and traditional, Czech and Russian. But yes, there is no Dutch runtime resource DLL.

including small k instead of big K in Editoroptions is documented on removing the need to press CTRL, the tooltip then changes to "Click to follow link", but I then get no tooltip in IDE windows and Memoe editing windows. I haven't looked into all the options, in the Tools-Options dialogue you can do several settings in the IDE tab and those settings are per Type of file/window, so this kind of seems like settings working in general but that is separately maintained for eg Program Files, Code windows (methods pf forms/classes) browse windows, Memo edit windows etc.

I don't really think you find the setting to change there about background color, but you might find a way to disable the tooltip of links.

Another obvious solution, which takes a lot of effort to implement, though, would be using a web browser control with an HTML textarea as editbox replacement.

It's simpler to use an RTF textbox.

Bye, Olaf.



Olaf Doschke Software Engineering
 
Another option to consider is to do without the tooltip completely. Turn it off from the form's ShowTips property. If you feel the user needs to be told how to follow the link, add a label alongside the editbox, and set its caption to the required text.

Going further, you could start by making the label invisible. In the edit box's InteractiveChange, test for the presence of the hyperlink (for example, by searching for a string that starts with " or " If it is present, make the label visible.

That way, you can forget about having to hack the DLL. The disadvantage is that the ShowTips property will affect the entire form, not just the hyperlink.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Koen,

Just mailed the DLL to you, using Wetransfer. My antivirus will nog allow sending a DLL to your.

Regards, Gerrit
 
Hi,
Just now received Gerrit's VFP9RENU.DLL in which he changed the text into Dutch. Will let you know asap.
Meanwhile, if this does not work, I will apply myTooltip.VCX, construct the tip, for consistency with the other forms in this .pjx to the native tooltip looks, apply it on all the objects in this form and on the editbox with EnabledHyperlink.
A little bit more work than to make use of Gerrit's VFP9RENU.DLL.
And if nobody knows why my Editbox has a black backcolor, unchangeble, I will leave it as is. Too bad.
Thanks for all the advises.
Koen
 
Hi Gerrit,
Have implented your VFP9RENU.DLL, sorry but it does not change the tooltip form English to Dutch on my system.
Regards,
Koen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top