LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

tooltips bug

Solved!
Go to solution

I am really sorry but I am having another issue with tooltips...Smiley Frustrated

 

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 );

 

tooltip_ok.png

 


 

(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 );

 

tooltip_messed_up.png

0 Kudos
Message 1 of 4
(3,626 Views)
Solution
Accepted by topic author Wolfgang

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

0 Kudos
Message 2 of 4
(3,587 Views)

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 Smiley Wink

0 Kudos
Message 3 of 4
(3,581 Views)

This issue seems to be resolved in CVI2013SP2, thanks!

0 Kudos
Message 4 of 4
(3,109 Views)