Antonio,need help!How to ShowToolTip without move the mouse

User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Antonio,need help!How to ShowToolTip without move the mouse

Post by James Bott »

Antonio and Samir,

Here is a little program that shows the problem. Calling oControl:showTooltip() does not force the tooltip to be displayed. If we can find a way to do this, the problem will be solved. I think this would be useful in other situations also. For instance, I would use it to force a tooltip to be displayed when the user makes an invalid entry.

James

Code: Select all

include "fivewin.ch"

function main()

   local oDlg, oGet, oBtn, cName:="James"

   define dialog oDlg title "Test Tooltip"

   @ 5,5 get oGet var cName of oDlg pixel
   oGet:cTooltip:= "Test tooltip"

   // Shows that you cannot force the tooltip to be displayed.
   @ 20,5 button oBtn prompt "Show Tooltip" ;
      action oGet:showToolTip() pixel

   activate dialog oDlg

return nil
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Antonio,need help!How to ShowToolTip without move the mouse

Post by James Bott »

OK, here is a clue. If I put a msgBeep() as the very last line of showToolTip(), it beeps BEFORE the tooltip is displayed, so it seems that the showTooltip() method does not acually display the tooltip. Perhaps it is just an init routine?

Now we need to find the code that actually does display the tooltip.

James
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Antonio,need help!How to ShowToolTip without move the mouse

Post by Antonio Linares »

James,

I think it is related to the standard behavior that Windows provides to the tooltip class. They relate the tooltip to the mouse movements. Maybe there is a message to be sent to the tooltip that forces its inmediate display.

But after reviewing Samir's screenshot, I think that a different implementation may be taken. I would display an overlapping bitmaps with all the "simulated" tooltips on it. Similar to samples\newhelp,prg implementation.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Antonio,need help!How to ShowToolTip without move the mouse

Post by James Bott »

Here is a thread on forcing a tooltip to display, but they could find no solution.

http://www.codeguru.com/forum/archive/i ... 28180.html

It also seems that you can display only one tooltip at a time. Samir, it appears that you want to show them all at the same time?

James
User avatar
sambomb
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil
Contact:

Re: Antonio,need help!How to ShowToolTip without move the mouse

Post by sambomb »

Antonio Linares wrote:James,

I think it is related to the standard behavior that Windows provides to the tooltip class. They relate the tooltip to the mouse movements. Maybe there is a message to be sent to the tooltip that forces its inmediate display.

But after reviewing Samir's screenshot, I think that a different implementation may be taken. I would display an overlapping bitmaps with all the "simulated" tooltips on it. Similar to samples\newhelp,prg implementation.
The image is just to show what I wish: show multiple tooltips at the same time and without move the mouse
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
Marcelo Via Giglio
Posts: 1033
Joined: Fri Oct 07, 2005 3:33 pm
Location: Cochabamba - Bolivia

Re: Antonio,need help!How to ShowToolTip without move the mouse

Post by Marcelo Via Giglio »

Hola,

there is a post-it sample system, why not use it like a base to emualte a multiple tooltip

regards

Marcelo
User avatar
sambomb
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil
Contact:

Re: Antonio,need help!How to ShowToolTip without move the mouse

Post by sambomb »

Antonio, I'm still waiting a solution, you asked me for remember you, beside the facebook I don't have any other means to enter in contact with you, could you turn on the Private Message in the forum?
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Re: Antonio,need help!How to ShowToolTip without move the mouse

Post by James Bott »

Samir,

First, we have determined you cannot use the standard windows tooltip since only one can be displayed at one time. So you are going to have to take another approach.

Two have been mentioned. Antonio suggested using transparent bitmaps as is shown in \samples\newhelp.prg.

And Marcelo suggested looking at the sample post-it program.

Either one of these may be your answer.

Regards,
James
User avatar
sambomb
Posts: 385
Joined: Mon Oct 13, 2008 11:26 am
Location: Itaocara - RJ - Brasil
Contact:

Re: Antonio,need help!How to ShowToolTip without move the mouse

Post by sambomb »

How to change the time the tooltip is displayed and the time the tooltip take to appear, I saw on the MSDN that the tooltip has this atributes, but don't know how to change them...

I think that with this 2 properties, 3 seconds for the first, and 0 miliseconds to the second, plus mousemove + SysRefresh() I can simulate what I want....

But James said that the windows show just one ToolTip.
Email: SamirSSabreu@gmail.com
MSN: SamirAbreu@hotmail.com
Skype: SamirAbreu
xHarbour 1.1.0 + FwXh 8.02
xHarbour 1.2.1 + Fwhh 10.6
User avatar
cladron
Posts: 4
Joined: Wed Feb 08, 2006 12:32 am
Location: Lima - Perú
Contact:

Re: Antonio,need help!How to ShowToolTip without move the mouse

Post by cladron »

I recenty made this trick:

Function UserShowToolTip(cText)
oBrowse:DestroyToolTip()
oBrowse:cToolTip:=cText

// Create and destoy a dialog
Define dialog odlg00 from 2,2 to 3,3 STYLE WS_POPUP
Activate dialog oDlg00 NOWAIT
oDlg00:end() ; oBrowse:setfocus()

// Show de tooltip
oBrowse:CheckToolTip()
Post Reply