05-30-2008 09:09 AM
05-30-2008 09:30 AM
Hi,
to access a control on a tab page, you should always obtain a handle to the tab page (similar to panel handle). Use the GetPanelHandleFromTabPage function to obtain the handle. Now, use this tab page handle in the same way you would use a panel handle to access the controls on a panel.
Example: In your UIR, you create a panel, PNL. On this panel, you create a tab control, MAINTAB. The 4th tab page of this main tab is called TABMAIN4. On this 4th tab page, you create another tab control, called SUBTAB. The 3rd tab page of this tab page is called TABSUB3. On this 3rd tab page, you create a numeric control, called NUMERIC. Below is the code used to access this numeric control:
int pnlHandle;
int maintabHandle;
int subtabHandle;
// Get panel handle.
pnlHandle = LoadPanel (0, "UserInterface.uir", PNL);
// Get handle for 4th tab page on the main tab control.
GetPanelHandleFromTabPage (pnlHandle, PNL_MAINTAB, 3, &maintabHandle);
// Get handle to the 3rd tab page on the sub tab control, which is located
// on the 4th tab page of the main tab control.
GetPanelHandleFromTabPage (maintabHandle, TABMAIN4_SUBTAB, 2, &subtabHandle);
// Adjust the numeric value of a numeric control which is located on the
// 3rd tab page of the sub tab control.
SetCtrlVal (subtabHandle, TABSUB3_NUMERIC, 10);
Hope this helps. If not, please post again...
05-30-2008 09:34 AM
The correct approach when working with tabs is to consider each page of a tab control as a panel (which in effect it is). The panel handle associated with a specific tab page can be obtained with GetPanelHandleFromTabPage, so in your example the panel handle of your tab page "Gestion Acquisition Analogique" can be obtained with
GetPanelHandleFromTabPage (panelHandle, PANELCAN_TAB, 0, &firstTabHandle);
The panel handle of "Voie 1" tab page results from
GetPanelHandleFromTabPage (firstTabHandle, TAB_ACQ_TAB_2, 0, &secondTabHandle);
and finally the habdle of your "Acquisition" tab page is
GetPanelHandleFromTabPage (secondTabHandle, TABPANEL_3_TAB, 0, &thirdTabHandle);
05-30-2008 10:19 AM
05-23-2017 05:27 PM