i'm using array of cluster to allow user entering differents setting
But in some case i would like to adapt viewing to hide some parameters or displaying 0 or a null field
my problem is when creating a ref on control in the list how to know wich line is concerned to modify the good one
here a vi for example
when case 1 is seleced in first column other ctl can be any of choices
when case 2 is selected i would like the mofify two others to be 0 and none
is there an other way than playing with coordonate and size of elements to know which line is the current one ?
Solved! Go to Solution.
This is one of those times when an X-control can be pretty handy. in this case, If your cluster was an X-control the control itself would respond to the data change on the ring and cause the desired changes to the rest of the cluster elements. There is an shipping example for X-controls and the help covers the basics fairly well.
Unfortunately i don't have X-control fonctionality
You can't get a reference to an individual element of an array - all array elements are the same. They can have different values but not different properties, so for example you cannot disable a control on one row and leave it enabled in another row. Likewise if you want to modify the items in a ring, every row in the array will be affected. If you're willing to put in more time to get a good-looking interface, you can do it with a table indicator and some individual controls. As the user navigates through the table, move the appropriate control over that cell in the table and make it visible. When the user moves off that cell, update the value in the table and hide the control. This gives you full control over what options the user has at each location, at the cost of some extra programming. Here's an example from an application I wrote (sorry, I can't pull the user interface code out of the proprietary parts easily). The first column (Product) is a ring that is populated as necessary. The second column uses a numeric control and the third is an enum (the only possible values are "This Week" and "Next Week". The remaining columns are display only, calculated from the values in the first three columns.
thank you for details.
what do you mean with table indicator , a multicolumn list ?
Could you post 2,3 pictures of FP to illustrate how it appears to user ?
The picture I posted does show how it appears to the user. The user can click on any of the cells in the first three columns (and can use tab to move between them). When the user navigates to a cell, a control of the appropriate type (enum, numeric, ring) appears at that location, as shown with the Week enum in row 3, so the user can make a selection. When the user navigates away from that cell, the value is copied to an array of strings, and the control is hidden. By a table indicator I mean exactly that - there is a front panel object called a "table" and you can make it an indicator. It displays an array of strings.
Which version of LabVIEW are you using (Base, Professional, etc)? This code relies heavily on the event structure, and if you do not have XControls, I wonder if you also do not have the event structure.
I have full version + builder ( a mistake i know ) , yes event is available , ok with table
what picture are you talking about ?
I linked to an image hosted on lavag.org (I'd posted it there in a somewhat related discussion a while ago) - does it not show up for you? Here it is again, attached directly.
I was able to simplify that VI to the point where I can post the code to demonstrate the idea. Here it is in both 8.6 and 9 (it seems to have lost some font formatting when saving back to 8.6). I haven't used XControls at all but it seems like the sort of thing that could be converted to one easily if I had the time and need for it.