Gridlayout
Gridlayout is a very powerful layout manager that can implement many complex layout S. It implies that it places all controls in a grid-like layout. ^__ ^ gridlayout has two constructors.
Gridlayout Constructor
Constructor description
Public gridlayout () creates a default gridlayout layout.
Public gridlayout (INT numcolumns, Boolean makecolumnsequalwidth)
Create a gridlayout layout with numcolumns columns. If makecolumnsequalwidth is true, all components have the same width.
Degree.
Gridlayout has six common data members, which are relatively important.Numcolumns.
Gridlayout data member
Attribute description
Int horizontalspacing ----------------------- controls the component width between two grids in a row, in pixels.
Boolean makecolumnsequalwidth ----- if true, all columns must have the same width.
Int marginheight ---------------------------- controls the distance between the top and bottom components from the edge, in pixels.
Int marginwidth ---------------------------- controls the distance from the left and right components to the edge, in pixels.
Int numcolumns ----------------------------- number of the gridlayout columns.
Int verticalspacing ------------------------- controls the width of the components between two networks in a column, in pixels.
You can use gridlayout to set the griddata class to layout more complex components. griddata has two constructors.
** Griddata Constructor
Constructor description
Public griddata () creates a default griddata object.
Public griddata (INT style) initializes the specified style layout.
Like other layout classes, gridlayout also provides some common data members to control its status. It also provides some constants that you can use to construct a function. you can use the bitwise mark "|" to connect several different effects, but be careful not to conflict with the style.
** Griddata data member
Attribute description
Boolean grabexcesshorizontalspace if it is true, it indicates that the grid in the layout is automatically filled with excess horizontal space. The default value is false.
Boolean grabexcessverticalspace: if it is true, it indicates that the grid in the layout is automatically filled with redundant vertical space. The default value is false.
Int heighthint the smallest height in this row, in pixels. The default value is SWT. default.
Horizontal Alignment of components in the int horizontalalignment mesh. Possible values include beginning, center, end, and fill.
Int horizontalindent: horizontal indent of the grid on the left. The default value is 0.
Int horizontalspan sets the number of columns occupied by the grid. The default value is 1.
The vertical alignment of components in the int verticalalignment mesh. The possible values are beginning, center, end, and fill.
Int verticalspan sets the number of rows occupied by the grid. The default value is 1.
Int widthhint the smallest width in this column, in pixels. The default value is SWT. default.
Griddata constant
Constant description
Beginning is a non-style value that specifies horizontal or vertical alignment.
Center is a non-style value that specifies that the component is centered in the grid, horizontally or vertically.
End is a non-style value that specifies the horizontal or vertical alignment.
Fill is a non-style value that specifies the component to fill the grid, horizontally or vertically.
Fill_both sets horizontalalignment and verticalignment to fill, and grabexcesshorizontalspace and grabexcessverticalspace to true.
Fill_horizontal sets horizontalalignment to fill, and sets grabexcesshorizontalspace to true.
Fill_vertical: Set verticalignment to fill, and set grabexcessverticalspace to true.
Grab_horizontal sets grabexcesshorizontalspace to true.
Grab_vertical sets grabexcessverticalspace to true.
Horizontal_align_beginning sets horizontalalignment to beginning.
Horizontal_align_center sets horizontalalignment to center.
Horizontal_align_end sets horizontalalignment to end.
Horizontal_align_fill sets horizontalalignment to fill.
Vertical_align_beginning: Set verticalignment to beginning.
Vertical_align_center: Set verticalignment to center.
Vertical_align_end: Set verticalignment to end.
Set verticalignment to fill.