01-08-2015 09:57 AM
Kochise,
I haven't been able to follow your "best practices" line, so can't comment. But I played around with a Cluster of clusters and I think you can do what you want with it. Use the "Controls[]" property to aquire an array of references to your set of clusters, and "Controls[]" again to get a 2D array of references to all subcontrols. Then you can easily index out a reference to a specific string, say, and set any property you want (you'll need to cast the control ref to a string type). Easier than other possibilities.
01-08-2015
10:02 AM
- last edited on
10-20-2024
12:01 PM
by
Content Cleaner
You mean, something like that ?
Tried without much luck, hence I disabled it.
This one works instead :
David Koch
01-08-2015 10:28 AM - edited 01-08-2015 10:47 AM
You need to start with a Cluster or clusters (so each contained cluster is a separate control with separate attributes), rather than an Array of clusters (where there is only one contained cluster control for all elements). Like this:
This way has the advantage of allowing all attributes to be set, for any kind of control.
Added later: using references like this also allows one to dynamically register on the individual controls, allowing LOTS of fancy UI work.
01-08-2015 10:40 AM
01-08-2015
12:20 PM
- last edited on
10-20-2024
12:02 PM
by
Content Cleaner
@Kochise wrote:
I don't see why the property of a string cannot be set on an individualbasis. OK to say that at this location there is a string indicator, now
I'd like to change the color. Currently it's set to black, either is pass
or fail. I just wanted to use normative colours such as green vs. red.
In an attempt to get this somewhat back on topic, let me suggest another alternative (although I realize you've already gone with Altenbach's clever picture control solution): separate the outputs (the measurements and results) from the inputs (the rings, etc) for display purposes only. Place a table indicator next to the array of clusters. With a little effort, you should be able to make it all line up nicely, so it looks like it's on the same line. You may need to use the classic controls and make the borders transparent - looks like you've already figured out some of those tricks. Display the results in the table. That way you get individual control over the display of each cell, with minimal changes to your existing interface. You can of course keep the results in the existing cluster as well, if it helps you group the data, and just don't show those elements of the cluster.
@David-A wrote:
I'm a little late to the party here but nathand put together an excellent example a while back that demonstrates the table idea that hoovah mentioned. Its got a slick interface, and like hoovah pointed out you can modify the color of the text since its a table control not an array.
https://forums.ni.com/t5/Example-Code/Click-to-Edit-Table-Using-an-Array-of-Clusters/ta-p/3508160
Thanks for sharing this more widely! Possibly also worth noting that this approach also handles keyboard navigation cleanly, although I think changes in event handling between LabVIEW 2012 and 2013 broke that portion of the code.