Page 2 of 2

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

Posted: Wed Jun 09, 2010 12:33 am
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 | Expand

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

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

Posted: Wed Jun 09, 2010 12:44 am
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

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

Posted: Wed Jun 09, 2010 3:34 am
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.

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

Posted: Wed Jun 09, 2010 5:35 am
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

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

Posted: Wed Jun 09, 2010 11:37 am
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

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

Posted: Wed Jun 09, 2010 11:49 am
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

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

Posted: Thu Jun 10, 2010 2:19 pm
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?

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

Posted: Thu Jun 10, 2010 2:26 pm
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

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

Posted: Fri Jun 11, 2010 1:57 pm
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.

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

Posted: Mon Sep 20, 2010 10:55 pm
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()