The TabPanel (gb.form) class implements a tab control. This control is a TabStrip replacement with a fine border around the tab tabs.
If you are working with the two controls TabStrip and TabPanel, the question quickly arises whether you should prefer a TabPanel to a TabStrip. The decision will be easier if you know the following facts:
In the following next section, only the additional properties of the TabPanel (gb.form) class - compared to the TabStrip (gb.qt4) class - are presented:
|Highlight||Boolean||For the value 'True', sets the background of the inactive tabs to dark grey → Figure 12.7.2 to make the active tab more visible or returns the value.|
|Moveable||Boolean||Specifies with the value 'True' whether the tabs can be rearranged (moved) with the mouse via the tab tab or returns the value.|
Table 126.96.36.199 : Selected properties of the class TabPanel
The methods of the TabStrip class have been extended to include the TabPanel.Remove (gb.form) method:
Sub Remove (Index As Integer)
With this method you remove the tab panel with the specified index from the tab, provided that the tab panel does not contain any controls. Otherwise you will get the error message “TabPanel container is not empty”.
The project presented is based on the TabStrip project in → Chapter 12.6.2. The two properties TabPanel.Highlight and TabPanel.Moveable were additionally used. The source code can be read when testing the project because it is displayed in an editor at runtime. The following pictures give an impression of the layout of the 3 tab cards on the TabPanel.
If you switch to the first tab panel, you will see a small section of the project source text. You can also see the changed arrangement of the tabs (below) for the 2nd tab with two tabs, where the property TabPanel.Highlight was not set.
However, you can also view the source text legibly in a TextArea if you maximise the programme window:
Use the button at the bottom left to switch immediately to tab 3 (index = 2) and call up the arguments x and the function values f(x) there with the preset function and the specified argument interval and step size for the arguments in a value table. Note that internally a check is made for valid function values - but that is already out of the scope of TabPanel!
You can move the tab tab - and thus the tab card - with the text 'Colour selection' to the right, for example, by holding down the mouse button, because the property TabPanel.Moveable has been set to the value True, and you will then get this changed arrangement of the tab cards compared to the original → Figure 188.8.131.52:
The possibility of moving register cards at runtime must be responded to appropriately when switching to the register card with the value table → Figure 184.108.40.206, as its index then changes: