LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Tabbed panels

Hello all,
I'm always a bit confused when I try to use tabs.

Main is a panel that contains a TAB

Panel=LoadPanel (0, "GenepiInterface.uir", SYNC);
Index = InsertPanelAsTabPage (Main, MAIN_TAB, -1, Panel);

The above puts the SYNC panel inside the last tab of the TAB control. OK.
So if I want to refer to a control on that tabbed panel, I should use:

SetCtrlVal(Panel, SYNC_NUM_0, Val);

Right ?
Then how come a callback placed on that control gives me a value for the
panel which is different than Panel ?
--
Guillaume Dargaud
http://www.gdargaud.net/
"I see no progress in this industry. These clocks are no faster than the
ones they made a hundred years ago." - Henry Ford, while visiting a
museum.


0 Kudos
Message 1 of 4
(3,491 Views)

From recollection, the TAB effectively becomes a child panel, and as such you need to use your 'Index' value as the corresponding panel handle to access controls on the TAB panel. (I must check this recollection when I get back to a CVI machine... )

 

JR

0 Kudos
Message 2 of 4
(3,478 Views)
When I saw that there were some new Tab functions between 8.1 and 8.5 I got
careful and instead of putting my controls in a panel and loading it to a
tab, I filled a tab and copied to another tab. That worked.
--
Guillaume Dargaud
http://www.gdargaud.net/


0 Kudos
Message 3 of 4
(3,472 Views)

The help for InsertPanelAsTabPage says that it copies the panel and puts it into the tab control at the specified index. Therefore, you have to get the panel handle of the new duplicate panel that was inserted into the tab control using GetPanelHandleFromTabPage.

 

Panel=LoadPanel (0, "GenepiInterface.uir", SYNC);
Index = InsertPanelAsTabPage (Main, MAIN_TAB, -1, Panel);
GetPanelHandleFromTabPage(Main, MAIN_TAB, Index, &tabPanel);

 

SetCtrlVal(tabPanel, SYNC_NUM_0, Val);

 

Hope this helps,

 

- jared

0 Kudos
Message 4 of 4
(3,435 Views)