01-27-2011 06:36 PM
I have searched around and found nothing on the topic.. what i am looking at here is this.
I have currently set up two tabs that are identical, each representing a component on a device and the component is selected when the user clicks on the tab.
For example, if i switch to tab two, i select component two.
Now these tabs are identical, same controls same indicators and so on.. what i want to know is if it is possible to make it so that say.. if i tell it i have 5 components, it would show 5 identical tabs. if i told it it had 20 components it would bring up 20 and so on. At the moment i am looking at having to create each tab one by one and then hiding them..
Thanks for your time and any help at all is greatly appreciated 🙂
01-27-2011 07:02 PM
01-27-2011 10:47 PM
altenbach--this problem could be phrased a little more generally though: some, but not all types of controls could appear on each tab, while other controls are unique to particular tabs. I've encountered exactly this situation, and I don't have a good way to duplicate the exact location of the common controls on each tab. Can "copy and paste" be done "in place" somehow?
01-28-2011 12:09 AM
Have you tried right-clicking an existing tab page and select "duplicate page"?
01-28-2011 12:44 AM
I will try the "duplicate page" option when I get back on Tuesday lol. Sounds simple enough... but even so, that just means I have to make a whole bunch and then hide them all again...
Your original idea sounds the best even though it will mean re doing all the code.. definitely sounds a lot simpler. Thanks 🙂 I will explore the options.
01-28-2011 09:04 AM
Where do we find "duplicate page"?--I don't see it as a right-click option. I see in the help that there is a "duplicate page" function associated with VI scripting. What would be really be nice is "duplicate control on all pages", so that individual changes can be made after the pages already have stuff on them.
01-28-2011 09:12 AM
I would strongly second altenbach's original post. It is far easier and scalable to create all the controls you need on a single interface, then hide/show them and populate them with appropriate values as needed. Maintaining twenty or more tabs with virtually identical controls would be difficult, at best and highly error prone. If you really need different functionality in the tabs, I would recommend you use subpanels and implement as different VIs (using LabVIEW classes makes this even easier/better). From your questions, you can probably implement twenty different options with only a few subVIs.
Full disclosure - I consider tabs a poor UI choice when there are more than four or five leaves. At that point, you are usually better off using a selector of some sort and subpanels to implement the functionality. It is much easier to maintain, as well.
01-28-2011 09:13 AM
@bracker wrote:
altenbach--this problem could be phrased a little more generally though: some, but not all types of controls could appear on each tab, while other controls are unique to particular tabs. I've encountered exactly this situation, and I don't have a good way to duplicate the exact location of the common controls on each tab. Can "copy and paste" be done "in place" somehow?
Using altenbach's approach would be best. If you have a handful of specific controls but most are common you can control this by showing/hiding control. When the user selects the type of device you could show/hide the controls which are not common to all. Using this approach you could place controls on top of each other as long as only one would be visible at a time. This saves on diagram space and gives you a clean interface. Internally you use an array of clusters. If you may have different clusters you can decide if the differences are significant enough to warrant using different cluster definitions or simply having a few parameters that do not apply to all devices included in a single cluster definition. The controls on the front panel itself do not need to be in a cluster since they are only there for the UI. This gives you a bit more freedom in laying out the front panel. Anything that uses typedefs (ENUMs for example) should share the same typedef though.
If you feel very ambitious and think you may reuse this control in several applications you could implement this as an X-Control.
01-28-2011 10:05 AM
Guys, thanks.
You've brought up a few of the issues I was thinking about a couple of months ago; at the time, I just settled for a tab control (I only have 3 tabs, so my issue is a little different than Ryzhawk's in that sense). I need more time to look into your suggestions, which I can't do at work today, but I'll come back with a few more questions in a day or so.
01-28-2011 11:39 AM
@bracker wrote:
Where do we find "duplicate page"?--I don't see it as a right-click option. I see in the help that there is a "duplicate page" function associated with VI scripting. What would be really be nice is "duplicate control on all pages", so that individual changes can be made after the pages already have stuff on them.
You need to right-click on a tab or on the tab border in order to get the correct right-click menu. Try it!
(If you right-click inside the main area, you get the palette of course)