LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String with multiple styles

Is there anyway of marking up strings with multiple styles, fonts, colors within the same indicator? I would like to programatically build strings which are not so monotonous, is, some words in italics or bold possible different sizes and colors depending on the word, my only work around is embedding an activeX web-browser control,and setting the properties to look like a string control. This works but it would be very cool if the string control allowed for markup in addition to just formatting special escape characters. Has anyone found a purely labview way of doing this. A labview display control which could parse an XML like string would be awesome for improving labview's user interface. Any thoughts? (When I have embedded IE in my applications and loaded web graphics to look like user interfaces it has impressed the users, they didn't even know that the program was written in labview).

-Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 1 of 6
(3,237 Views)
String controls support the properties you mention. The attached VI shows a string control with two fonts and several variations of color and style. The underlining was done programmatically to demonstrate the process. There is no markup, as such. The properties can be queried from the string control as well as set. If you wanted to, you could probably convert HTML to the string control in a straightforward manner, especially if you only needed a subset to make your programming easier. LabVIEW parses HTML quite well. I have a few primitive VIs I created to parse XML I can share if you need them.

One last thing, you can also programmatically change the size of the text box, whether or not scroll bars are present, etc. using the property nodes.
0 Kudos
Message 2 of 6
(3,228 Views)
Sorry I am using LV 7.0, please save as previous format. Thanks,
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 6
(3,223 Views)
When writing properties in a property node, if there is a cluster, use the "All Elements" way to write the entire cluster. This sometimes makes a difference in how the property node works. For example, when I use the above example fontformatting.vi as provided, and it writes each individual item in text selection separately, then I write to change the text background color, the property intended to operate only on the selection operates instead on the whole string. However, if I write the text selection cluster as a cluster (All Elements) the property node operates properly as it I would expect.
0 Kudos
Message 4 of 6
(3,194 Views)
Sorry about that, here it is. The previous would not have helped you much, anyway. I forgot to make the text string the default value, so when I opened it again, the string was gone, with all my formatting. I fixed it with this one (LV7.0).
Message 5 of 6
(3,189 Views)
DFGray,

Thanks,the vi worked great,
Paul
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 6
(3,150 Views)