change tooltips..how?
Posted:
Mon Aug 11, 2008 9:27 pm
by hag
I would like to change size and time tooltip appears. How would I do this?
Posted:
Mon Aug 11, 2008 10:04 pm
by Antonio Linares
Harvey,
1. You can change the size of the tooltip specifying a larger text or a multiline text, i.e.: "This is a" + CRLF + "multiline tooltip" + CRLF + "test"
Also, FWH now supports an array instead of a text for a tooltip, using this format:
oControl:cToolTip := { cToolTipText, [cHeader, [nIcon]], [nForeColor], [nBackColor] }
Posted:
Mon Aug 11, 2008 10:25 pm
by hag
Thanks for the quick resoponse.
I use "This is a" + CRLF + "multiline tooltip" + CRLF + "test" but there seems to be a limit on the amount of text. In 16bit never had a problem. Now the larger tooltips flash off and on until I make them smaller. I put one of my larger tips in tooltip.prg sample and same thing flashing.
Any Idea whats going on?
Posted:
Mon Aug 11, 2008 10:35 pm
by Antonio Linares
Besides the previous msg info, in order to change the default tooltip width, this change is required in source\classes\window.prg:
- Code: Select all Expand view
#define TTM_SETMAXTIPWIDTH (WM_USER + 24)
...
hWnd = CreateToolTip( ... )
SendMessage( hWnd, TTM_SETMAXTIPWIDTH, 0, <nNewLength> )
...
default nLength is 120
Posted:
Mon Aug 11, 2008 10:36 pm
by Antonio Linares
Harvey,
Do you mean the tooltip width or the amount of text that it shows ?
Whats the Len() of your used tooltip text ?
Posted:
Mon Aug 11, 2008 10:43 pm
by Antonio Linares
Harvey,
2. In order to change the time that the tooltip is shows, similar changes in source\classes\window.prg are required:
- Code: Select all Expand view
#define TTM_SETDELAYTIME (WM_USER + 3)
#define TTDT_AUTOPOP 2
...
hWnd = CreateToolTip( ... )
SendMessageDelay( hWnd, TTM_SETDELAYTIME, TTDT_AUTOPOP, 32767 )
...
You can try values between 1 and 32767