adding_20tooltips_20to_20the_20status_20bar
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
adding_20tooltips_20to_20the_20status_20bar [2018/03/31 13:19] – external edit 127.0.0.1 | adding_20tooltips_20to_20the_20status_20bar [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====Adding tooltips to the status bar===== | =====Adding tooltips to the status bar===== | ||
- | //by Richard Russell, January 2007//\\ \\ If your program uses the [[http:// | + | //by Richard Russell, January 2007//\\ \\ If your program uses the [[http:// |
+ | |||
+ | <code bb4w> | ||
TB_GETTOOLTIPS = 1059 | TB_GETTOOLTIPS = 1059 | ||
SYS " | SYS " | ||
- | Here **htoolbar%** is the handle of the toolbar, as returned from **FN_createtoolbar**.\\ \\ If your program doesn' | + | </ |
+ | |||
+ | Here **htoolbar%** is the handle of the toolbar, as returned from **FN_createtoolbar**.\\ \\ If your program doesn' | ||
+ | |||
+ | <code bb4w> | ||
INSTALL @lib$+" | INSTALL @lib$+" | ||
- | The tooltip control can now be created as follows:\\ | + | </ |
+ | |||
+ | The tooltip control can now be created as follows: | ||
+ | |||
+ | <code bb4w> | ||
TTS_ALWAYSTIP = 1 | TTS_ALWAYSTIP = 1 | ||
TTS_NOPREFIX = 2 | TTS_NOPREFIX = 2 | ||
Line 14: | Line 24: | ||
htooltip% = FN_createwindow(" | htooltip% = FN_createwindow(" | ||
\ | \ | ||
- | If instead your program uses the **WINLIB5A** library then the code must be adapted as follows:\\ | + | </ |
+ | |||
+ | If instead your program uses the **WINLIB5A** library then the code must be adapted as follows: | ||
+ | |||
+ | <code bb4w> | ||
TTS_ALWAYSTIP = 1 | TTS_ALWAYSTIP = 1 | ||
TTS_NOPREFIX = 2 | TTS_NOPREFIX = 2 | ||
Line 22: | Line 36: | ||
htooltip% = FN_createwindow(@hwnd%, | htooltip% = FN_createwindow(@hwnd%, | ||
\ | \ | ||
- | It is advisable to create only one tooltip control for your entire program.\\ \\ Next define a TOOLINFO data structure and initialise a couple of its members:\\ | + | </ |
+ | |||
+ | It is advisable to create only one tooltip control for your entire program.\\ \\ Next define a TOOLINFO data structure and initialise a couple of its members: | ||
+ | |||
+ | <code bb4w> | ||
DIM ti{cbSize%, uFlags%, hwnd%, uId%, rect{l%, | DIM ti{cbSize%, uFlags%, hwnd%, uId%, rect{l%, | ||
TTM_ADDTOOL = 1028 | TTM_ADDTOOL = 1028 | ||
Line 30: | Line 48: | ||
ti.uFlags% = TTF_SUBCLASS | ti.uFlags% = TTF_SUBCLASS | ||
ti.hwnd% = hstatusbar% | ti.hwnd% = hstatusbar% | ||
- | Here **hstatusbar%** is the handle of the status bar, as returned from **FN_createstatusbar**.\\ \\ Now we have everything we need to create the tooltips themselves. For each //part// of the status bar create a tooltip for it as follows:\\ | + | </ |
+ | |||
+ | Here **hstatusbar%** is the handle of the status bar, as returned from **FN_createstatusbar**.\\ \\ Now we have everything we need to create the tooltips themselves. For each //part// of the status bar create a tooltip for it as follows: | ||
+ | |||
+ | <code bb4w> | ||
tip$ = "Tool tip" | tip$ = "Tool tip" | ||
ti.lpszText% = !^tip$ | ti.lpszText% = !^tip$ | ||
SYS " | SYS " | ||
SYS " | SYS " | ||
+ | </ | ||
+ | |||
Here **part%** is the status bar part number, starting from 0 for the first (leftmost) part.\\ \\ Note particularly the important **CHR$0** concatenated to the end of the tooltip string (here "Tool tip"). | Here **part%** is the status bar part number, starting from 0 for the first (leftmost) part.\\ \\ Note particularly the important **CHR$0** concatenated to the end of the tooltip string (here "Tool tip"). |
adding_20tooltips_20to_20the_20status_20bar.1522502344.txt.gz · Last modified: 2024/01/05 00:18 (external edit)