From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Text message control not selectable

Hello,

 

I faced a strange condition under which a text message control becomes unselectable in the UIR editor. I seemed to have narrowed down the situation to a text message with "Size to text" option unchecked: if you apply a rotation of 900 or 2700 tenths of degrees to the control and contemporarily set "Size to text" checkbox, the control becomes unselectable in the editor with the mouse.

 

You can preview the header file, locate the control and select it with Right click + Locate UI control  (or press Ctrl+Shift+U): the control will be selected and you can press Enter to edit its properties; alternatively you can draw a selection box across the panel and select the control with the same results. If you use the keyboard to move it it will disappear except for the highlighting rectagle until you press Enter again.

This applies to controls on a panel and to controls on a tab page. It does not apply for rotations other than one or three square angles; it does not apply for 1800 or 3600 rotations either.

 

The only ways I have found to have the control selectable with the mouse again are to close the UIR file and reopen it: simply saving the file or changing the active tab page or editing another control does not fix the problem. Alternatively you must edit text style properties (e.g. apply bold attribute): no need to save/close the file in this case.

 

I attach a UIR file that shows this behaviour. To test it:

  • Open the attached file
  • Double click on text message control on the tab page
  • Click on Text style button and select a rotation of 900 or 2700. Dismiss the dialog with OK
  • Check "Size to text" checkbox
  • Dismiss the property page with OK: the control is now unselectable with the mouse

 

At this point you can test this additional gem:

  • Edit the command button the tab page and set its text to bold
  • The text message will disappear Smiley Surprised

 

Tested with CVI 2009SP1 and 2012SP1.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 1 of 9
(4,533 Views)

Funny Smiley Happy The same observation with CVI2013.

 

At least: after setting your button text to bold you can retrieve the text message control by clicking anywhere on the tab. No real consolation, I know...

0 Kudos
Message 2 of 9
(4,531 Views)

Hi Roberto,

 

I was able to reproduce the problem and it does seem to be a bug. I've recorded internally (431566) and hopefully it will be addressed soon.

 

From what I could tell, the problem only happens when you disable the size to text option before rotating it. If you rotate it first and then disable the option, it seems to still be selectable, although there are some drawing problems when you type additional text into it.

Message 3 of 9
(4,494 Views)

Thanks Luis for addressing this item. You see, it's a little funny bug for which some workaround exist so we can wait for the fix when it will appear.

What it's important is that its effect is limited to the control not being selectable and does not implies more serious effects.

 

 

As a side, partially related note, while playing with rotated texts I've found that text alignment (left-center-right) has an effect on rotated labels too but only at runtime: left alignment produces top aligned texts if rotated 90 degrees, center alignment produces middle-aligned ones and right alignment results in bottom-aligned texts.

Is this behaviour the expected one? If so, I haven't seen it noted in the documentation.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 9
(4,486 Views)

No, that's not expected, but I couldn't see the problem myself. When I try it, I see the alignment applied horizontally, relative to the control frame (regardless of the text's rotation) both in the UI Editor and at run-time.

 

For example, in the label below (with size-to-text disabled), I set the alignment to right-justified and it looks correct to me. Are you seeing something different?

 

 alignment.png

0 Kudos
Message 5 of 9
(4,470 Views)

Absolutely different!

 

In the UIR editor I see the same as you, but when the panel is shown at runtime thigs are radically different! See this screenshot:

VertAlign.png

Using CVI2009SP1 on Win7 Pro SP1 with CVI2012 RTE.

 

Using CVI2012SP1 alignment translates to vertical even in the editor (i.e. a left-aligned text appears bottom-aligned even at design time, and this both on the panel and in the quick edit window in control properties dialog).



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 9
(4,465 Views)

Ah, okay, that makes sense. I had been testing with CVI 2013 and that's why I didn't see the same thing you did.

 

It looks as if this was a bug in CVI 2012. I tried to look up the bug so that I could send you the link but I haven't found it yet. In any case, it looks like the bug was introduced with 2012 and it was fixed with 2013. I'll let you know if I find out exactly what it was.

 

The reason you see the difference between edit-time and run-time is because the version of your RTE is 2012 and so it has the bug. This affects the behavior of your program when you run it. However, when you try the same thing in the UI editor, in CVI 2009, you don't see the bug, because the UI editor does not depend on the RTE -- it's part of the ADE, which in this case does not have the bug.

 

Luis

0 Kudos
Message 7 of 9
(4,447 Views)

Well, good to know. Just one thing: do you really consider it a bug? Smiley Surprised

I mean, I understand that an undocumented and not coherent behaviour indeed is a bug, but sometimes I miss the ability to vertically align text messages: it would be a good thing to have for text controls the same alignment options we have with cell text. I thing I'll post a new idea. Smiley Wink



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 8 of 9
(4,438 Views)

Yes, I do consider it a bug. It's not so much the inconsistency between run-time and edit-time, since that's just a function of the different versions of CVI you're using for each. It's the fact that interpreting the justification relative to the text direction, rather than to the frame, doesn't handle very well the justification of diagonal text. Take a look at what CVI 2012 does when you change the orientation of the text from 900 to 899:

 

900.png                899.png

 

    angle = 900                           angle = 899

 

So, yes, it was definitely a bug. I did eventually find the bug in which this was introduced (308662) but I can't link to it, since for some reason it hasn't yet been added to the Known Issues list. By the way, this bug had to do with using ClearType for the text, so if you disable ClearType in Windows, or if you make the text background transparent (which will cause the text to not use ClearType), the result would be same as if you changed the angle to 899.

 

By the way, the ability to vertically align text messages has already been requested, and you've already kudo'ed it here Smiley Wink:

 

Luis

0 Kudos
Message 9 of 9
(4,417 Views)