08-01-2013 08:49 AM - edited 08-01-2013 08:55 AM
I am really sorry but I am having another issue with tooltips...
I will show two samples, code plus result, in the first case everything is fine, in the second the tooltip tries to be smart and fails miserably: It inserts line breaks without asking and it cuts/omits/swallows text, see below. I have checked the char string using the variable view, the text has been formatted correctly and is complete. Unfortunately, it is not displayed completely.
In effect, the only difference between the two cases is that in (1) there is a long line, the path name, that prevents the 'automatic', undocumented word wrap / line break. I have no explanation why part of the text is omitted, may be there is a default aspect ratio or a maximum of lines? Too bad...
(1) O.K.
char tooltip_text [ 768 ];
sprintf ( tooltip_text,
"%s%s%s",
"Reference Spectrum File:\n\n",
reference_spectrum_file_list [ reference_spectrum_file_index ],
"\n\nDouble Click\t\t\t to open one spectrum file\n"
"Ctrl + Double Click\t\t to open one or more spectrum files\n"
"Shift + Double Click\t\t to import one data file\n"
"Ctrl + Shift + Double Click\t to import one or more data files\n"
"Alt + Double Click\t\t to open a directory of spectrum files\n"
"Shift + Alt + Double Click\t\t to import a directory of data files\n"
"Right Click\t\t\t to display a popup menu" );
SetCtrlAttribute ( panel_handle, control_id, ATTR_TOOLTIP_TEXT, tooltip_text );
(2) FAILURE
char tooltip_text [ 768 ];
sprintf ( tooltip_text,
"%s",
"Reference Spectrum File:\n\n"
"Double Click\t\t\t to open one spectrum file\n"
"Ctrl + Double Click\t\t to open one or more spectrum files\n"
"Shift + Double Click\t\t to import one data file\n"
"Ctrl + Shift + Double Click\t to import one or more data files\n"
"Alt + Double Click\t\t to open a directory of spectrum files\n"
"Shift + Alt + Double Click\t\t to import a directory of data files\n"
"Right Click\t\t\t to display a popup menu" );
SetCtrlAttribute ( panel_handle, control_id, ATTR_TOOLTIP_TEXT, tooltip_text );
Solved! Go to Solution.
08-07-2013 06:39 AM
Hi Wolfgang,
I was easily able to reproduce the bug (#421593). The problem seems to be related to tabs. If you replace them with spaces the problem goes away. Of course this might not be the easiest thing in the world to do, when using a non-monospaced font. But until there is a fix, that might be your only option.
Sorry about the inconvenience.
Luis
08-07-2013 07:14 AM
Hi Luis,
Thanks for looking into it! I wouldn't mind to use spaces and a monospaced font, unfortunately this isn't possible yet. But may be my suggestions will get implemented - you see I am trying my best to gain your support
08-07-2014 09:21 AM