adding_20tooltips_20to_20a_20dialogue_20box
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
adding_20tooltips_20to_20a_20dialogue_20box [2018/03/31 13:19] – external edit 127.0.0.1 | adding_20tooltips_20to_20a_20dialogue_20box [2024/01/05 00:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
=====Adding tooltips to a dialogue box===== | =====Adding tooltips to a dialogue box===== | ||
- | //by Richard Russell and Howard Bolton, May 2006//\\ \\ Tooltips are small (usually light yellow) windows containing useful information, | + | //by Richard Russell and Howard Bolton, May 2006//\\ \\ Tooltips are small (usually light yellow) windows containing useful information, |
+ | |||
+ | <code bb4w> | ||
INSTALL @lib$+" | INSTALL @lib$+" | ||
INSTALL @lib$+" | INSTALL @lib$+" | ||
Line 24: | Line 26: | ||
PROC_showdialog(dlg%) | PROC_showdialog(dlg%) | ||
- | Note the installation of the **WINLIB5A** library which is needed later.\\ \\ Next we perform any initialisation of the dialogue box required; in this case we enter some data into the combobox and the list box:\\ \\ | + | </ |
+ | |||
+ | Note the installation of the **WINLIB5A** library which is needed later.\\ \\ Next we perform any initialisation of the dialogue box required; in this case we enter some data into the combobox and the list box: | ||
+ | |||
+ | <code bb4w> | ||
CB_ADDSTRING = &143 | CB_ADDSTRING = &143 | ||
CB_SETCURSEL = &14E | CB_SETCURSEL = &14E | ||
Line 39: | Line 45: | ||
SYS " | SYS " | ||
SYS " | SYS " | ||
- | So far everything has been conventional. Now comes the code for creating the tooltips:\\ \\ | + | </ |
+ | |||
+ | So far everything has been conventional. Now comes the code for creating the tooltips: | ||
+ | |||
+ | <code bb4w> | ||
TTS_ALWAYSTIP = 1 | TTS_ALWAYSTIP = 1 | ||
TTS_NOPREFIX = 2 | TTS_NOPREFIX = 2 | ||
Line 54: | Line 64: | ||
PROC_CreateToolTip(!dlg%, | PROC_CreateToolTip(!dlg%, | ||
PROC_CreateToolTip(!dlg%, | PROC_CreateToolTip(!dlg%, | ||
- | PROC_CreateToolTip(!dlg%, | + | PROC_CreateToolTip(!dlg%, |
- | Finally we need the procedure to send the Tooltip text to each dialogue item. This procedure can be used for any dialogue box in your program by passing appropriate values for the handles to the dialogue box and the Tooltip (note the important addition of CHR$0 to each of the strings):\\ \\ | + | </ |
+ | |||
+ | Finally we need the procedure to send the Tooltip text to each dialogue item. This procedure can be used for any dialogue box in your program by passing appropriate values for the handles to the dialogue box and the Tooltip (note the important addition of CHR$0 to each of the strings): | ||
+ | |||
+ | <code bb4w> | ||
DEF PROC_CreateToolTip(hdlg%, | DEF PROC_CreateToolTip(hdlg%, | ||
TTF_IDISHWND = 1 | TTF_IDISHWND = 1 | ||
Line 68: | Line 82: | ||
SYS " | SYS " | ||
ENDPROC | ENDPROC | ||
+ | </ | ||
+ | |||
Now all you need to do is hover the mouse over the controls and see the effect. | Now all you need to do is hover the mouse over the controls and see the effect. |
adding_20tooltips_20to_20a_20dialogue_20box.1522502344.txt.gz · Last modified: 2024/01/05 00:18 (external edit)