12-27-2011 08:50 AM
Hello,
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 ?
Regards
Tinnitus
Solved! Go to Solution.
12-27-2011 11:28 AM - edited 12-27-2011 11:29 AM
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.
12-27-2011 11:33 AM
Hello,
Unfortunately i don't have X-control fonctionality
Regards
Tinnitus
12-27-2011 11:55 AM
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.
12-29-2011 06:02 AM - edited 12-29-2011 06:03 AM
Hello Nathand,
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 ?
Regards
Tinnitus
12-29-2011 10:38 AM
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.
12-29-2011 10:52 AM
Hello,
I have full version + builder ( a mistake i know ) , yes event is available , ok with table
what picture are you talking about ?
12-29-2011 12:07 PM
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.
12-29-2011 12:48 PM
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.
01-18-2012 12:33 PM
See this idea (and give kudos):
http://forums.ni.com/t5/LabVIEW-Idea-Exchange/multicolumn-listbox/idc-p/1842555#M16338