LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can't Write to Text Object of String Control

Well this is annoying:

paul_a_cardinale_0-1720525080452.png

paul_a_cardinale_1-1720525203040.png

I can't think of a reason why they disallowed writing to the text properties of a string control when it's in a strict typedef.

 

Message 1 of 7
(670 Views)

Hi Paul,

 

a strict typedef also defines cosmetics of the frontpanel element, so it makes no sense to start to edit those cosmetics at runtime.

Use a "vanilla" (aka non-strict) typedef instead...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(666 Views)

@GerdW wrote:

a strict typedef also defines cosmetics of the frontpanel element, so it makes no sense to start to edit those cosmetics at runtime.


To me, text selection is part of the functionality of a string, nothing to do with cosmetics.

This should be writable even for a strict typedef-ed control.

0 Kudos
Message 3 of 7
(648 Views)

Hi raphschru,

 


@raphschru wrote:

@GerdW wrote:

a strict typedef also defines cosmetics of the frontpanel element, so it makes no sense to start to edit those cosmetics at runtime.


To me, text selection is part of the functionality of a string, nothing to do with cosmetics.

This should be writable even for a strict typedef-ed control.


Most use cases for text selection (IMHO) are about text formatting (font, style, colors, etc.)...

 

My question: what is the use case for a strictly type-defined string control?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 7
(624 Views)

@GerdW wrote:

Most use cases for text selection (IMHO) are about text formatting (font, style, colors, etc.)...

My question: what is the use case for a strictly type-defined string control?


Most use cases yes, but what if I just want to pre-select some text as part of the user input logic?

 

raphschru_0-1720535691472.png

 

The problem is more that the same property "Selection" of class Text serves 2 different purposes:

1. Changing font, color, ... of some part of the text (which is purely cosmetic).

2. Pre-selecting text for user input (which is more about user input logic).

 

But maybe Paul can give use his specific use case...

 

Regards,

Raphaël.

0 Kudos
Message 5 of 7
(605 Views)

In my use case, the string is contained in a cluster that is strictly typedef'd.

I want to change the value then specify which parts are Unicode using:

paul_a_cardinale_2-1720547007235.png

Since I really want that cluster to remain strictly typedef'd, I worked around it by disconnecting typedefs in the build (making debugging more cumbersome).

0 Kudos
Message 6 of 7
(583 Views)

AND,

 

If you put an XControl in a strictly typedef'd cluster, none of its custom properties that you've created are writeable.

But you can fake it by creating a method that writes to the state of the XControl.

0 Kudos
Message 7 of 7
(510 Views)