FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour tooltip timing
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
tooltip timing
Posted: Wed Sep 30, 2009 04:08 PM

Is there away to adjust the timing of tooltips?
Use FWH909.

Thank you

Harvey
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: tooltip timing
Posted: Wed Sep 30, 2009 04:21 PM

Harvey,

Try oWnd:nToolTip.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: tooltip timing
Posted: Wed Sep 30, 2009 09:00 PM

Thanks James:

Not sure where to put it and is it to be set to a time oWnd:ntooltip := ???

Thank you

Harvey
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: tooltip timing
Posted: Thu Oct 01, 2009 12:14 AM

Harvey,

OK, I should have explained. nTooltip is CLASSDATA of TWindow. This means that it is like a STATIC. All instances of TWindow and any instances of subclasses of TWindow will inherit this instance variable AND and its value. So you only have to set it once in your app. nTooltip defaults to 900 milliseconds.

Remember that most controls inherit from TWindow via TControl, so all those controls will have the overridden nTooltip value.

Example:

define window oWnd title "Main Window"
oWnd:nTooltip:= 1000

Or you can use this unsual syntax:

TWindow():nTooltip := 1000

Now your toolbar, GETs, etc, will have the longer time.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: tooltip timing
Posted: Fri Oct 02, 2009 12:45 AM
James:

ownd:ntoolTip := 1000, doesn't work

Code (fw): Select all Collapse
 DEFINE FONT oFont1 NAME "tahoma" SIZE 0,-11 BOLD 
          DEFINE WINDOW OWND1 FROM 1, 5 TO 20, 75  ;
         TITLE "Up Your Cash Flow XT2-2009" ;
        MENU( BUILDMENU())                                 ;
       COLOR CLR_WHITE, CLR_BLUE
       oWnd1:nTooltip := 1000


Can't get the tool tips to last more the 6 seconds. Even if i change the value higher.
Thank you

Harvey
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: tooltip timing
Posted: Fri Oct 02, 2009 01:54 AM

Harvey,

After looking at the code, it appears that nTooltips is only being used with Clipper. I am going to have to look at this more when I have time.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: tooltip timing
Posted: Fri Oct 02, 2009 07:55 AM
Harvey, James,

http://msdn.microsoft.com/en-us/library/bb760404(VS.85).aspx

We should modify this section of code in FWH\source\classes\window.prg:
Code (fw): Select all Collapse
         hWnd = CreateToolTip( Self:hWnd, If( ValType( cToolTip ) == "A", cToolTip[ 1 ], cToolTip ),  ;
                               If( ::lBalloon != nil, ::lBalloon, lTTBalloon ) )

         if ValType( cToolTip ) == "A"
            if Len( cToolTip ) > 1
               if ! Empty ( cToolTip[ 2 ] )
                  SendMessage( hWnd, TTM_SETTITLE, ;
                     If( Len( cToolTip ) > 2 .and. ! Empty( cToolTip[ 3 ] ), ;
                        cToolTip[ 3 ], TTI_INFO ), cToolTip[ 2 ] )
               endif
               ...

Maybe enhancing CreateToolTip() to accept new parameters, or simply adding new calls to SendMessage() there, the same way we do it for TTM_SETTITLE, etc.

First I would recommend to read that Microsoft docs info and decided what values we want to support
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: tooltip timing
Posted: Sun Oct 04, 2009 03:36 AM

Antonio:
Read the information you sent looked at the code. Looked at window.prg and I cant seem to figure out what to do. :cry:

Thank you

Harvey
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: tooltip timing
Posted: Sun Oct 04, 2009 10:43 AM

Harvey,

That was not a solution, just the section of code where the solution needs to go.

Antonio was requesting feedback on any other properties that we might want to also add at the same time as the timing fix. I haven't looked at the docs yet.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: tooltip timing
Posted: Sun Oct 04, 2009 04:22 PM
Yes I know. This seems to be the location where the attribures of the tooltip take place but the if statement == "A" is a problem since the tooltip is a "C".

I may be way off but i couldn't find any othe place in window.prg where the tool yip is adjusted.
Code (fw): Select all Collapse
if ValType( cToolTip ) == "A"
       if Len( cToolTip ) > 1
            if ! Empty ( cToolTip[ 2 ] )
             SendMessage( hWnd, TTM_SETTITLE, ;
              If( Len( cToolTip ) > 2 .and. ! Empty( cToolTip[ 3 ] ), ;
              cToolTip[ 3 ], TTI_INFO ), cToolTip[ 2 ] )
        endif
      if Len( cToolTip ) > 3
           if ValType( cToolTip[ 4 ] ) == "N"
                SendMessage( hWnd, TTM_SETTIPTEXTCOLOR, cToolTip[ 4 ], 0 )
             endif
      if Len( cToolTip ) > 4
           if ValType( cToolTip[ 5 ] ) == "N"
               SendMessage( hWnd, TTM_SETTIPBKCOLOR, cToolTip[ 5 ], 0 )
                 endif
          endif
              endif
            endif
         endif
Thank you

Harvey
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: tooltip timing
Posted: Sun Oct 04, 2009 11:20 PM
Harvey,

Your code should go outside of that if ... endif unless you plan to use an array for the tooltip info:

Code (fw): Select all Collapse
SendMessage( hWnd, TTM_SETDELAYTIME, TTDT_AUTOPOP, nMakeLong( 6000, 0 ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: tooltip timing
Posted: Mon Oct 05, 2009 04:46 AM

Antonio:
Doesnt work :cry:

I need to define the ttm_setdelaytime

define TTM_SETDELAYTIME ??? what value

define TTDT_AUTOPOP ??? what value

I placed SendMessage( hWnd, TTM_SETDELAYTIME, TTDT_AUTOPOP, nMakeLong( 6000, 0 ) )
below the endif in the array if endif statement. Nothing happens
BUT If I set #define TTM_SETDELAYTIME (WM_USER +24) the ToolTip looks much better better but no time change or time control.

Thanks again for the help but so far not working.

Thank you

Harvey
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: tooltip timing
Posted: Mon Oct 05, 2009 06:38 AM

Harvey,

define TTM_SETDELAYTIME (WM_USER + 3)

define TTDT_AUTOPOP 2

Those values are defined in c:\bcc55\include\commctrl.h

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 598
Joined: Tue Apr 15, 2008 04:51 PM
Re: tooltip timing
Posted: Mon Oct 05, 2009 07:08 AM

Perfect. Thanks for the help

Thank you

Harvey

Continue the discussion