From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

GUI Challenge: How to Programmatically Show/Hide Cluster Items in an Array of Cluster

We all know it is easy to show/hide the individual items in a Cluster using the items’ “Visible” property nodes. However when the Cluster is now inside an Array (Array of Clusters), this may not have the desired effect. You could still use the “Visible” property nodes, but now this will take effect on all elements in the Array. You cannot Show/Hide the Cluster’s items in only one or a few elements of the array. This is because the property nodes affect all elements of the Array in the same way.

 

Suppose you want to create a User Interface containing an Array of Clusters, (for example a Sequence where each element is a Step in the Sequence).  You want to show only relevant items in the Cluster, and hide the rest, but on an Array element by element basis. I have been faced with this situation numerous times so this is a common enough scenario. So I decided to share my solution for that. This procedure shows with an example, how to do just that.

 

Please see the PDF document for procedure and the VI example.

 

Hope this is helpful to others. If there is sufficient interest, I can post a follow-up on how to change more complex properties (Strings[] used in Combo Box, Ring Menu, etc) of items in an Array of Clusters.

Message 1 of 6
(2,877 Views)

H LVUser,

 

so you hide FP elements by placing them behind a (boolean) element with customized images…

Not new (the same principle is used to place colorboxes behind cluster elements to allow individual colors in arrays of clusters) - and also kind of tricky as is visible in your example VI!

 

  • The boolean hiding the button is not sized correctly so there is still a small line of that button visible.
  • It will also fail when you decide to use "Windows-style" controls from system palette: here you need to match the system colors. And those colors may change depeding on the user settings for its account… (Use a colorbox instead to show system frontpanel background color!)

(Don't take me wrong, I really appreciate your effort in creating that example VI together with a full PDF document. I just want to point some problems with your current state of that approach.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 6
(2,864 Views)

Hi GerdW

Thanks for your comments. I too have used Colorbox control to give the appearance of changing colors of items individually. But there is a problem when using it Show/Hide. First, the Colorbox has a T on it when you make it transparent. Second, even when it is transparent, it won't let you control the item behind it. So it may work if you just want to use the items as indicators but will not work if you want to allow user to change the control behind the Colorbox.

 

Regarding your comment about the Boolean not covering one of the items, it is a trivial problem to fix 🙂

I have never used the windows-style controls, but that too is an easy one to avoid !

 

Another solution I have used in the past is to use a Multi-column listbox. Each row contains one element of the array. Each column represents one item in the Cluster. Then use floating pop-ups to allow use to edit each element based on the Mouse Down events.

 

Sundaram Raghuraman

CLD (to be renewed!)

LabVIEW User 3.1 -> 2018

 

 

 

 

0 Kudos
Message 3 of 6
(2,843 Views)

Follow-on Example #2:

This image shows an Array of Clusters in which the value of the "Element Type" is used to unhide only the relevant control in the Cluster, and also set the Strings[] property of the combo-box control appropriately.

Also enclosed is the LabVIEW VI for this example.

Array of Controls Example2.JPG

0 Kudos
Message 4 of 6
(2,722 Views)

I haven't tried, but can you put a Tab control in an array? If so, you should be able to have different tabs at the different indexes and thus different control setups. Xcontrols?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 5 of 6
(2,697 Views)

Tabs cannot be inserted into any other container. I think they are meant to be at the highest level.

Same restriction with Splitters.

 

I have not looked into XControls. But worth taking a look I think.

 

Thanks for your comments.

0 Kudos
Message 6 of 6
(2,662 Views)