02-15-2011 04:15 PM
One can dream of the day where Unicode is fully supported in LV. In the meantime, following the advice in this thread to add the following to the LV ini file
UseUnicode=True
allows me to offer this alternative.
02-15-2011 04:23 PM
OK, so I spent a little time on this, and came up with a couple of subvis that can generate an image that sits atop the second column on a tree control, giving the impression of progress bars in the cells.
It's not particularly well tested, nor coded (never is when I'm mashing something up), but it appears to work.
Snapshots show it copes well with wide and narrow column widths, and also with a column that is cropped by the scrollbars (something that can't be done using real progress bar controls on the front panel programmatically positioned to the cells).
<<-- Wide column
<<-- Narrow column
<<-- Cropped image to nicely fit truncated columns
It does have some caveats however: if you ask the subvis to generate progress bars for cells that are not visible in the control then it falls apart. Probably won't take much coding to cater for this eventuality, but with properly designed calling code this eventuality shouldn't occur. (Nevertheless, I'll probably implement this safety code anyway because I just know someone else in my office will use this in their own project and mess their user interface up )
Also, I have no idea how this looks in a working application (refresh rate / unbuffered redraw visibly flashing) so it could turn out to be fairly useless!
Attached is a zip of the LVLIB (LV2010), in case anybody wants to play. Comments welcome!
Thanks all for your input, especially tst.
02-15-2011 04:34 PM
Darin, that is awesome! Some very clever use of unicode table characters there!
I like this, but are there any potential problems I should consider? I have little experience with the use of Unicode tables, so I'm naive as to what could happen if adopted into a LabVIEW application. Would the .ini file token you used be needed in the applications .ini file? Is there any potential complication with language/font settings? (Forgive my ignorance )
Also, why is this needed to make it work for the tree cell (I have no idea what this single-character hex-based string constant represents):
02-15-2011 04:49 PM
The Byte Order Mark (BOM) signals the Tree control that the text will be Unicode encoded. It isn't necessary for the string indicator because it is set to 'Force Unicode Text'.
The caveats are many, as unicode support is limited at best in LV. You can have some strange behavior where the Unicode encoding is spontaneously lost, or spontaneously appears. In situations where I have control over the application, it works very well for me. Once it works how I want I try to leave it alone.
As for applications, I haven't tried it yet. Let me know if you try.
My main goal is to show another use case where full unicode support would be very useful. Now when you see someone say "wouldn't Unicode support be nice?" perhaps your answer will be "Yes!" And now that I look, about a month before I joined the forums somebody suggested the very thing:
http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Support-Unicode/idi-p/921449
Perhaps in this limited application, the current support will work for you.
02-16-2011 01:25 AM
10-19-2012 09:53 PM
Hi.
I realise this is quite an old post, but was just wandering if there have been any good solution or headway towards this end. This feature seem to be quite usefull in queued task projects. And messing about with unicode and pictures doesn't feel quite right.
Regards
Kas
10-21-2012 08:26 AM
I don't know of any different solution. You could try using a .NET Treeview control, but that might make your code more complicated.