LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Long pull down menu of tab control. References to controls on page of tab control.

Folks,
 
two questions regarding a tab control:
 
1.
 
I am using a tab control for offering the user various sub menus. The tabs are switched invisible. Instead I am using the page labels display for control of the tab. The list of available sub-menus (tabs) has already become quite long so that a pull down menu with a scrollbar appears (See attached screenshot). However, the scrollbar is not very convenient and not actually needed. Does anyone know how I could avoid this scrollbar?
 
2.
 
I would like to get all the references of all controls of one particular page of that tab. I played around with the property nodes but could not yet find a solution. Any hint would be helpful.
 
Thanks in advance,
Peter
 
 
0 Kudos
Message 1 of 6
(3,860 Views)
Your screenshot doesn't show what kind of pulldown you're using. I'd guess you're probably using the "System->Combo Box" control, as that has a scrollbar. While there's a property for that control to not display the vertical scrollbar, it doesn't work. Try the regular menu ring control.

As for the controls on a page, just access the "Pages" property, index out the page you want, and then use the "Controls on Page[]" property, as shown in this picture:


Message Edited by smercurio_fc on 11-28-2006 11:01 AM

Message 2 of 6
(3,841 Views)

Smercurio,

thanks for your advice. Unfortunately I am not yet finished.

1) I cannot find any item "scroll bar off" in the list of the properties of the menu ring.

2) Please, have a look into the attached vi "tab_control_page_1_release.vi". How can I get access to the references of the tab control pages inside the condition inside the for loop?I want to write a sub vi which releases the tab control in the calling vi from the disabled state.

Thanks,

Peter

0 Kudos
Message 3 of 6
(3,802 Views)
You misunderstood my comment. There is no "scroll bar off" for the menu ring. I was saying that I guessed you were using a System->Combo Box control since you didn't say what kind of pull-down you were using. The Combo Box has a "scroll bar visible", but I could not get it to actually work. I was recommending using a menu ring instead.

As for your VI, a subVI it uses was missing, but it doesn't matter, as you're taking the long way around. You don't need to resort to the VI Server functions to access the tab control on the main VI. If you want to do what you want in a subVI then all you need to do is use a reference control and pass in a reference to the tab control. This will allow you to directly access the tab control in your subVI. You can find more information in the LabVIEW manual, but I've attached a very simple example.
Message 4 of 6
(3,797 Views)

Smercurio,

thanks for your fast response.

1) May be, I am a bit slow this evening but I still cannot fully understand your remark. I am using a menu ring. But as the list of ring items becomes longer, a scroll bar appears. I'd like to switch off this scroll bar since it is tedious for the user if he needs to scroll before he can select. Also, the list is not yet that long that the scroll bar would actually already be needed. See my attached "menu_ring.vi".

2) Sorry for having forgotten the sub-vi "Get Caller path.vi" which I attach now. It is simply delivering the path of the calling main vi. Of course, your solution works. But it would be much more elegant if the sub-vi didn't need to be provided with the tab control ref number but rather found this ref-number itself. That's what I want to achieve with my "tab_control_page_1_release.vi".

Peter

Download All
0 Kudos
Message 5 of 6
(3,788 Views)
I was suggesting to use a menu ring because you didn't say what kind of pull-down control you're using. There's like 5 different ones. I had suggested the menu ring to see if that would make a difference. As far as I know you can't control the appearance of the scrollbar in a menu ring. It's dependent on the font that you're using, and the number of items. In LabVIEW 8.2 there's a ComboBox control and that has a "Scrollbar Visible" property, but I could not get it to work. So, it looks like you're stuck with the scrollbar. Whatever you do, it's eventually going to show up based on the number of items in your list.

The reference control is actually the most elegant way of doing it since you're not incurring the VI Server overhead and the code is simpler. Indeed, in your "tab_control_page_1_reference" VI you need to typecast the control reference you get inside the loop using the "To More Specific Class" to make the generic control reference a tab control reference so you can access the properties and methods that are specific to a tab control. Of course, ALL OF THIS is eliminated by simply having a tab control rerence as an input in the first place! There was a very good reason why NI provided control references. This is one of them. Your criteria that it should find the reference on its own is not very convincing to me, and not likely to change the way I program. 

A side comment: you don't need that subVI that you're using to get the path. If the VI that you're tring to access is in memory you only need to provide the name of the VI to the Open VI Reference input as a string by (in your case) peeling off the first element of the Call Chain function's output. You only need the full path when you want to access a VI that is not loaded into memory. Since you're accessing your main VI, it is, by definition, in memory.
0 Kudos
Message 6 of 6
(3,774 Views)