LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Find Tab page name with scripting

Solved!
Go to solution

Looking for a pointer or to finish me off please.

I've got a UI with buttons (boolean) on it.
I've also got a tab control on it and some more buttons on pages of the tab control.
I want to use VI scripting to perform some tasks (in this case static code tests) on the buttons.
I can split out the split out the controls using traverse FP for GObjects into those of ClassName=Boolean and then sub divide them into those whose Owner is ClassName=Panel or Page...
However from here I can't seem to get a reference to allow me to determine the tab control page name on which the controls actually sit

James_W_0-1648736099486.png


Ideas please? - I'm missing something fundamentally obvious I think.

Thanks

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 1 of 23
(3,298 Views)

@James_W wrote:

Looking for a pointer or to finish me off please.

I've got a UI with buttons (boolean) on it.
I've also got a tab control on it ......
Ideas please? - I'm missing something fundamentally obvious I think.

Thanks

James


James my friend, the obvious thing you're doing wrong it using those Tab Containers.  I HATE THEM!

 

I suspect that the owning class is pane or container 

 

Class hierarchy should be vi fp panel, pane (if there is a splitter) container of type tab. Pages/panes of tab names.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 23
(3,286 Views)

Seems like you would have to get the reference to your tab control in question, and make a list of which controls are on which page as so, and then look each control up

 

I'm not sure of your specifics or what you're trying to do, but if you don't really care about the Booleans not on the tab control, then I feel like you'd be better off traversing to find that tab control ref, then from it you can neatly get an array of references for the controls of each page.

 

Spoiler
FireFistRedhawk_1-1648738647618.png

 

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 3 of 23
(3,281 Views)
Solution
Accepted by James_W

You can use the To More Specific Class function to cast the Owner reference to the Page class, then read properties of the page:

 

tab.png

Message 4 of 23
(3,269 Views)

@JÞB wrote:

@James_W wrote:

Looking for a pointer or to finish me off please.

I've got a UI with buttons (boolean) on it.
I've also got a tab control on it ......
Ideas please? - I'm missing something fundamentally obvious I think.

Thanks

James


James my friend, the obvious thing you're doing wrong it using those Tab Containers.  I HATE THEM!

 

I suspect that the owning class is pane or container 

 

Class hierarchy should be vi fp panel, pane (if there is a splitter) container of type tab. Pages/panes of tab names.


The fact that you hate tab controls doesn't make it wrong to use them.

"If you weren't supposed to push it, it wouldn't be a button."
Message 5 of 23
(3,262 Views)

@James_W wrote:

Looking for a pointer or to finish me off please.


In general, 'finishing someone off' means to kill that person.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos