05-13-2009 02:50 PM
Hello,
On my FP, I have an array control that can hold more elements than can fit on the screen, so I am showing the control's scrollbar to allow access to all elements. Unfortunately, when the user scrolls to the end, they see 1 unfilled array element... If the user clicks on this element, then it grows the size of the array, which I do not want to have happen. Is there a way to prevent LabVIEW from displaying the extra element while also showing the scrollbar?
(As a work-around, I can use the Event Structure to detect a value change, and if the array size changes, I can revert the array back to the "OldVal", but I'd prefer not seeing the unfilled element in the first place.)
Thanks,
Alan
05-13-2009 07:16 PM
05-13-2009 07:28 PM - edited 05-13-2009 07:28 PM
05-21-2010 01:37 PM
Wow... I just spent a bit of time designing a new control that had an array of clusters with the scrollbarbecause I had more items than would fit onscreen. When testing it, I encountered the 'extra element' problem (I had never used scrollbars on arrays before, and did not imagine that this would be how they worked).
I'm very disappointed in NI's implementation of the array scrollbar. I can think of NUMEROUS applications where one would want to do what we are doing - create a dynamic list of elements, and allow the user to view/select ONLY THOSE ELEMENTS. One should not have to resort to using an X-Control to obtain a 'scroll only to last element' behavior.
05-21-2010 02:47 PM
What about disabling the array control with a property node? Does the user have to click on the array for any reason? If it is just for display, can you use an indicator instead of a control?
05-21-2010 02:54 PM
Or customize the array...
1) Find a slider that you would like to use for the slide.
2) Set is as U32 and set range action to Coerce if out of range.
3) Customize >>> Save as a control.
4) Pop-up on the array container and hide scroll bar but make sure index display is still shown.
5) Customize the Array container Goto blow-torch mode.
6) Pop-up on the index control and choose "Replace" with the control you saved in step #3 above.
7) Exit blow-torch mode and close the Control editor and replace the control you stated with with the new version.
😎 Pop-up on the new scrool bar and create a property node for the range.
9) Run the VI and after the property node executes, you have an array control where you can limit the range of values.
A quick hack of that is attached.
Ben
05-21-2010 02:54 PM
05-21-2010 02:59 PM - edited 05-21-2010 03:00 PM
Post colision!
There is still another way.
Notes:
You can make the top of my slider 0 and the bottom 5 or what ever.
You can alos pop-up and hide the scale.
Also not that NO extra code is required in this example.
Ben
12-09-2011 01:48 PM
Ben, this is a nice idea. I have run into a problem though: I can only replace the index control with an old-fashioned slider, not an actual scroll bar control - LabVIEW just beeps at me when I try it. So, the result looks strange. The only way I've been able to get an actual scroll bar is to build an XControl.
12-09-2011 03:06 PM
Thank you Code Ferret!
I logged SR# 1775861 to verify the above procedure still works.
If I hear something I will update.
Ben