tooltip timing

tooltip timing

Postby hag » Wed Sep 30, 2009 4:08 pm

Is there away to adjust the timing of tooltips?
Use FWH909.
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: tooltip timing

Postby James Bott » Wed Sep 30, 2009 4:21 pm

Harvey,

Try oWnd:nToolTip.

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

Re: tooltip timing

Postby hag » Wed Sep 30, 2009 9:00 pm

Thanks James:

Not sure where to put it and is it to be set to a time oWnd:ntooltip := ???
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: tooltip timing

Postby James Bott » 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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: tooltip timing

Postby hag » Fri Oct 02, 2009 12:45 am

James:

ownd:ntoolTip := 1000, doesn't work

Code: Select all  Expand view
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
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: tooltip timing

Postby James Bott » Fri Oct 02, 2009 1: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: tooltip timing

Postby Antonio Linares » Fri Oct 02, 2009 7: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: Select all  Expand view

         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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: tooltip timing

Postby hag » Sun Oct 04, 2009 3: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
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: tooltip timing

Postby James Bott » 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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: tooltip timing

Postby hag » Sun Oct 04, 2009 4: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: Select all  Expand view

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
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: tooltip timing

Postby Antonio Linares » 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: Select all  Expand view

SendMessage( hWnd, TTM_SETDELAYTIME, TTDT_AUTOPOP, nMakeLong( 6000, 0 ) )
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: tooltip timing

Postby hag » Mon Oct 05, 2009 4: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
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California

Re: tooltip timing

Postby Antonio Linares » Mon Oct 05, 2009 6: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: tooltip timing

Postby hag » Mon Oct 05, 2009 7:08 am

Perfect. Thanks for the help
Thank you
Harvey
hag
 
Posts: 598
Joined: Tue Apr 15, 2008 4:51 pm
Location: LOs Angeles, California


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 67 guests