There are two ways to populate data to the tabs:
//Callback function to respond to the initialization event of the tab genie INT FUNCTION MyTabs_Init(STRING sTabs) // Pre-populate with 2 auto-width tabs LibTabs_AddTab(sTabs, "Tab1", 0); LibTabs_AddTab(sTabs, "Tab2", 0); RETURN TRUE; END
Parameter |
Description |
---|---|
Tab BarName |
MyTabs1 |
Width |
400 |
Height |
30 |
Initialize |
MyTabs_Init("#Name") |
At runtime the tab layout should look like the following:
This is similar to setting a formula in Excel. With binding, cell values are not stored in the tabs control. the control will call the provided Cicode function when it needs the data.
INT FUNCTION MyTabs_InitDyn(STRING sTabs) // Bind callback function for data display LibTabs_SetDataTask(sTabs, "Value", "MyTabs_GetCellValue", "^"#Name^",#Tab"); // Set the number of tabs for the control LibTabs_SetCount(sTabs, 3); RETURN TRUE; END //Function to return the value for a data cell STRING FUNCTION MyTabs_GetCellValue(STRING sTabs, INT nTab) RETURN "Dyn. value for Tab(" + nTab:# + ")"; END
Parameter |
Description |
---|---|
Tabs Name |
MyTabs2 |
Width |
400 |
Height |
30 |
Can Remove Tab |
TRUE |
Initialize |
MyTabs_Initdyn("#Name") |
At runtime the tab layout should look like the following:
See Also
Published June 2018