Views
1 week ago

tornadofx-guide

7. Layouts and Menus

7. Layouts and Menus gives you more explicit control over the positions of controls. gridpane { button("North") { useMaxWidth = true gridpaneConstraints { columnRowIndex(0,0) marginBottom = 10.0 columnSpan = 2 } } button("West").gridpaneConstraints { columnRowIndex(0,1) } button("East").gridpaneConstraints { columnRowIndex(1,1) } } button("South") { useMaxWidth = true gridpaneConstraints { columnRowIndex(0,2) marginTop = 10.0 columnSpan = 2 } } These are all the gridpaneConstraints attributes you can modify on a given Node . Some are expressed as simple properties that can be assigned while others are assignable through functions. 100

7. Layouts and Menus columnIndex: Int rowIndex: Int Attribute columnRowIndex(columnIndex: Int, rowIndex: Int) columnSpan: Int rowSpan: Int hGrow: Priority vGrow: Priority vhGrow: Priority fillHeight: Boolean fillWidth: Boolean fillHeightWidth: Boolean hAlignment: HPos vAlignment: VPos margin: Int marginBottom: Int marginTop: Int marginLeft: Int marginRight: Int marginLeftRight: Int marginTopBottom: Int Description The column index for the given control The row index for the given control Specifes the row and column index The number of columns the control occupies The number of rows the control occupies The horizonal grow priority The vertical grow priority Specifies the same priority for vGrow and hGrow Sets whether the Node fills the height of its area Sets whether the Node filles the width of its area Sets whether the Node fills its area for both height and width The horizonal alignment policy The vertical alignment policy The margin for all four sides of the Node The margin for the bottom side of the Node The margin for the top side of the Node The left margin for the left side of the Node The right margin for the right side of the Node The right and left margins for the Node The top and bottom marins for a Node Additionally, if you need to configure ColumnConstraints , you can call gridpaneColumnConstraints on any child Node , or constraintsForColumn(columnIndex) on the GridPane itself. 101

Guide
Guides
GUIDE
GUIDE
GUIDE TO
guide
Guide
GUIDE
THE GUIDING
GUIDE
Guide
Guide
GUIDE
GUIDE
GUIDE
GUIDE
GUIDE
Guide
Guide
guide
Guide
guide
GUIDE
Guide
Guide
GUIDE
Guide
GUIDE
Guide
GUIDE