tooltips_20on_20the_20main_20output_20window
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
tooltips_20on_20the_20main_20output_20window [2018/03/31 13:19] – external edit 127.0.0.1 | tooltips_20on_20the_20main_20output_20window [2024/01/05 00:21] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====Tooltips on the main output window===== | =====Tooltips on the main output window===== | ||
- | //by Richard Russell, May 2009//\\ \\ **Tooltips** (helpful information displayed in a small box when you ' | + | //by Richard Russell, May 2009//\\ \\ **Tooltips** (helpful information displayed in a small box when you ' |
+ | |||
+ | <code bb4w> | ||
INSTALL @lib$+" | INSTALL @lib$+" | ||
Line 27: | Line 29: | ||
SYS " | SYS " | ||
\ | \ | ||
- | Each tool is associated with a rectangular region of the window; when the user hovers the mouse over that region the tooltip will be displayed:\\ \\ | + | </ |
+ | |||
+ | Each tool is associated with a rectangular region of the window; when the user hovers the mouse over that region the tooltip will be displayed: | ||
+ | |||
+ | <code bb4w> | ||
tip$ = "This is a demo tooltip" | tip$ = "This is a demo tooltip" | ||
ti.cbSize% = DIM(ti{}) | ti.cbSize% = DIM(ti{}) | ||
Line 38: | Line 44: | ||
ti.lpszText% = !^tip$ | ti.lpszText% = !^tip$ | ||
SYS " | SYS " | ||
- | Here **left%**, **right%**, **top%** and **bottom%** define the rectangle associated with the tooltip; the coordinates are pixels with respect to the top left-hand corner of the window (client area).\\ \\ If you have more than one region in which you wish a tooltip to be displayed, you can either create multiple tools by duplicating the above code (with a different rectangle and string) or you can dynamically modify the rectangle and string, as follows:\\ \\ | + | </ |
+ | |||
+ | Here **left%**, **right%**, **top%** and **bottom%** define the rectangle associated with the tooltip; the coordinates are pixels with respect to the top left-hand corner of the window (client area).\\ \\ If you have more than one region in which you wish a tooltip to be displayed, you can either create multiple tools by duplicating the above code (with a different rectangle and string) or you can dynamically modify the rectangle and string, as follows: | ||
+ | |||
+ | <code bb4w> | ||
newtip$ = "This is a new tooltip" | newtip$ = "This is a new tooltip" | ||
ti.lpszText% = !^newtip$ | ti.lpszText% = !^newtip$ | ||
Line 47: | Line 57: | ||
SYS " | SYS " | ||
SYS " | SYS " | ||
- | You will need to update the rectangle and tip text when the mouse enters the region of interest. This approach is more appropriate when there are a large number of different tooltip rectangles.\\ \\ On exit from your program the tooltip window should be closed:\\ \\ | + | </ |
+ | |||
+ | You will need to update the rectangle and tip text when the mouse enters the region of interest. This approach is more appropriate when there are a large number of different tooltip rectangles.\\ \\ On exit from your program the tooltip window should be closed: | ||
+ | |||
+ | <code bb4w> | ||
hwndTT% += 0 : IF hwndTT% PROC_closewindow(hwndTT%) : hwndTT% = 0 | hwndTT% += 0 : IF hwndTT% PROC_closewindow(hwndTT%) : hwndTT% = 0 | ||
- | This code can most usefully be placed in a ' | + | </ |
- | ===== __Important note__ | + | |
- | If your program also calls routines in the **WINLIB**, **WINLIB3**, | + | This code can most usefully be placed in a ' |
+ | |||
+ | ===== Important note ===== | ||
+ | |||
+ | If your program also calls routines in the **WINLIB**, **WINLIB3**, | ||
| WINLIB.BBC\\ | Version 2.1\\ | | | WINLIB.BBC\\ | Version 2.1\\ | | ||
Line 58: | Line 76: | ||
| WINLIB5A.BBC\\ | Version 1.7\\ | | | WINLIB5A.BBC\\ | Version 1.7\\ | | ||
| MDILIB.BBC\\ | Version 1.4\\ | | | MDILIB.BBC\\ | Version 1.4\\ | | ||
+ |
tooltips_20on_20the_20main_20output_20window.1522502386.txt.gz · Last modified: 2024/01/05 00:16 (external edit)