LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

different formats for each line in enums & rings?

I don't know if this one is possible but I can't figure it out.Smiley Mad
 
Can you make an enum or ring control have a different format for each selection? 
 
E.G.:
 
Selection 1 [default]
Selection 2 [test mode]
Selection 3 [optional]
Selection 4 [optional]
 
I've tried the formatting options and property nodes, no luck.  Maybe there are possibilities with control customizing I'm not thinking of???
 
Thanks & Regards,
K
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 1 of 6
(2,452 Views)

Hi K.

      I don't think it's possible to have those text properties vary in a text-ring, but you might be able to accomplish your goal using a pict-ring - using images of formatted text.  In the example (attached) Paint was used to create the pictures then import them into the pict-ring.  Here Unclebump shows how to use "Draw Text at Point.vi" to create formatted text in a picture control, though, I have no idea how to copy such pictures out of the pictures control! Smiley Sad

Cheers!

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Message 2 of 6
(2,432 Views)
You might be able to emulate this with a string table.  You wont have quite the functionality of the list box (and there are many nice software engineering features of the enum) but the string table will allow you to decouple the text format (font, properties ...) from the control.  One other option which is equally as messy is using an axciveX or .net form control which might have such properties inate to them.
 
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 6
(2,414 Views)

Thanks for the replies Guys,

This is for a finished project that I was trying to "pretty-up" a bit.  It's just for looks so I won't spend too much time on it.  It would be great if formatting was possible for text-based controls and dialog boxes (I'm always trying to get my dialog pop-ups to look center justified).  I suspect it opens a big can of worms for NI though so I won't hold my breath.

Happy Coding,

K

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 4 of 6
(2,405 Views)
K.,

If you look at the Properties of the enum or text ring, the Strings[] property returns an array. Arrays must have elements of the same type, so you cannot set the font characteristics of one element to be different from those of another element. Attempting to do so returns an error 1073, "This property is writable only when the VI is in edit mode, or this method is available only when the VI is in edit mode." In spite of the implication that it is settable in edit mode, the commonality of the properties of array elements still prevents changes to individual elements. (I tried it).

Lynn
0 Kudos
Message 5 of 6
(2,397 Views)

Thanks Lynn,

I went down that path too.  And right into the same brick wall.Smiley Sad

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 6 of 6
(2,394 Views)