The Panel component is a container for other components whose border can be changed in various ways. The classes HBox, VBox, HPanel and VPanel are also panels that are initialised with different arrangement values.
You control the type of border on a panel using the Panel.Border property. Other properties of a panel can be found in the following table:
Panel | Data type | Default | Description |
---|---|---|---|
.Arrangement | Integer | 0 | Determines or sets how components are arranged on the panel. See the Arrange class → Chapter 20.7.2 for a list of constants for this property. |
.Border | Integer | 0 | Sets or returns the type of border to be displayed. In the Border class → Chapter 23.2.1 you will find a list of constants for this property. |
.Indent | Boolean | False | Determines or sets whether the components in the container panel are indented. The indentation depth is Desktop.Scale Pixel. |
.Invert | Boolean | False | Determines or sets the value to True if the horizontal or vertical arrangement is inverted. |
Table 18.2.1.1: Selected Panel Properties
The Margin, Padding and Spacing properties have been described in detail in chapter '18.0 Containers'.
One field of use for a panel arises in connection with the use of (at least) two RadioButtons to form groups of RadioButtons → Chapter 16.18 RadioButton.
A panel is also well suited to be used, for example, in an HBox as a dynamic spacer (Panel1.Expand = True):
Figure 18.2.2.1: Panel as a dynamic element
The StatusBar class by Raymond de Bruijne (http://gambas-club.de/viewtopic.php?f=4&t=2928) relies on individual panels for the construction of a StatusBar, where each panel can be formatted in a particular way depending on the display purpose:
Figure 18.2.2.2: Four panels in a StatusBar
Projects