LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

get references to all controls on front panel

Highlighted
Hi everyone

I thought this should be quite easy, but it is proving more trouble than I originally thought.

My goal is to, only once, set all the controls on the front panel to have their "skip when tabbing" property set to false.

Now the front panel has all kinds of nested tab structures etc. Is there a quick n easy way to get the references of *all* the front panel controls, regardless of whether they live inside a tab control or not.

As I said, I only want to do this once, so I suppose I could go around manually changing the property on each control Smiley Sad

The openg toolkit does not seem to have any tricks up its sleeve for this, or maybe I am missing something.

Thanks
nrp
nrp
CLA
0 Kudos
Message 1 of 10
(9,124 Views)
Highlighted
You're not missing anything. You have to do this recursively because of the class hierarchy.
0 Kudos
Message 2 of 10
(9,118 Views)
Highlighted
The only way I have found is to do an iterative process. Get the array of references to the controls. Loop through the array and find the compound controls (tabs, clusters, radio buttons, ...). Then get references to the controls inside the compound controls and repeat until all controls are the elementary ones.

Lynn
0 Kudos
Message 3 of 10
(9,117 Views)
Highlighted
In the "Application Control" pallete get the "this vi ref" wired into a property node->Front Panel. Wire that reference into another proprety node and select Controls[]. That gives you an array of references for all of the controls, put that into a FOR loop with a property node inside with skip when tabbing selected and a flase wired into it.
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
Message 4 of 10
(9,112 Views)
Highlighted

@TWGomez wrote:
In the "Application Control" pallete get the "this vi ref" wired into a property node->Front Panel. Wire that reference into another proprety node and select Controls[]. That gives you an array of references for all of the controls, put that into a FOR loop with a property node inside with skip when tabbing selected and a flase wired into it.

That will not return references to controls embedded inside of the those controls, which is what nrp is looking for. Smiley Wink
0 Kudos
Message 5 of 10
(9,110 Views)
Highlighted
For tabs get a reference to the tab. Property node Pages[] indexed to FOR loop. Poperty node for Controls on Page into FOR Loop, property node for desired control change....
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
Message 6 of 10
(9,098 Views)
Highlighted
thanks for the answers, although I was hoping for something slightly less troublesome than iterating through all the compound structures!

At least, for my app, I only need to go down two levels (a tab control within a tab control).

Maybe I will do it manually, maybe not, we will see how I feel in two hours or so after gymn, that normally motivates me to try new things in labview  Smiley Tongue
nrp
CLA
0 Kudos
Message 7 of 10
(9,092 Views)
Highlighted

Hi there,

 

hope helps the next, with the same problem...

 

http://digital.ni.com/public.nsf/allkb/D7A289CB44CD1EAB86256DC0007E4195

 

cheers chris

0 Kudos
Message 8 of 10
(6,856 Views)
Highlighted

This should do what you want:

 

https://lavag.org/files/file/28-get-reference-to-all-controls/

 

edit: just saw the date on OP, anyways solution above for future searches

Message 9 of 10
(6,807 Views)
Highlighted

@Neil.Pate wrote:
...
Now the front panel has all kinds of nested tab structures etc. Is there a quick n easy way to get the references of *all* the front panel controls, regardless of whether they live inside a tab control or not.
......
 

You can use the Traverse for GObjects.vi (Application Control / VI Scripting Palette). It works.

Here is the the Context Help:

 

Searches a target for objects of a particular type and returns an array of references to those objects. The target can be a front panel, a block diagram, or any object that can contain other objects, such as a For Loop, a cluster, or a user-defined control. This VI also recursively finds objects nested within other container objects.

 

traverse.png


 

 

 

Message 10 of 10
(6,795 Views)