LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Progress bar within a tree cell - is it possible?

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.

 

UnicodeProgressBar.PNG

Message 11 of 17
(1,817 Views)

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).

 

pbars_in_cells1.jpg<<-- Wide column

 

pbars_in_cells2.jpg<<-- Narrow column

 

pbars_in_cells3.jpg<<-- 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 Smiley Very Happy )

 

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.

 

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 12 of 17
(1,812 Views)

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 Smiley Sad)

 

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):

BOM.jpg

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 13 of 17
(1,804 Views)

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.

Message 14 of 17
(1,794 Views)

 


@Darin.K wrote:

 

The caveats are many, as unicode support is limited at best in LV.


I would say that for most people, running into this once is enough to cause them to disable that switch and be happy (or wish) they had SCC.

 


___________________
Try to take over the world!
Message 15 of 17
(1,773 Views)

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

0 Kudos
Message 16 of 17
(1,587 Views)

I don't know of any different solution. You could try using a .NET Treeview control, but that might make your code more complicated.


___________________
Try to take over the world!
0 Kudos
Message 17 of 17
(1,562 Views)