Developer Resources

BoxLayout

Overview

Layout class that allows controls to be positioned and sized automatically in a horizontal or vertical row.

Base Class

Layout

Constructor

BoxLayout()
BoxLayout(orientation : Integer)

Arguments

orientation
Determines the manner in which to position and size the layout object's components, depending on whether it's Layout.Horizontal or Layout.Vertical.

Methods

BoxLayout.add
Adds a form component or another layout object to the layout object for it to position and size automatically.
BoxLayout.addSpacer
Adds a pixel size spacer to the layout object.
BoxLayout.addStretchSpacer
Adds a stretch spacer to the layout object.
BoxLayout.clear
Removes all items from the Layout object.
BoxLayout.insert
Inserts a form component or another layout object into the layout object for it to position and size automatically.
BoxLayout.insertSpacer
Inserts a pixel size spacer into the layout object.
BoxLayout.insertStretchSpacer
Inserts a stretch spacer into the layout object.

Inherited Methods

Layout.layout
Positions and sizes the contents of the layout object.
Layout.show
Shows or hides the contents of the layout object.

BoxLayout.add

function BoxLayout.add(item : FormComponent, proportion : Integer, layout_flags : Integer, border_size : Integer)
function BoxLayout.add(item : Layout, proportion : Integer, layout_flags : Integer, border_size : Integer)

Arguments

item
The form component or layout object to add to be positioned and sized by this layout object.
proportion
The relative size of this item to all the other items, subject to the layout_flags.
layout_flags
Combination of Layout.Top, Layout.Bottom, Layout.Left, Layout.Right, Layout.All, Layout.Expand, and Layout.Center, and Layout.Shaped.
border_size
The space around the contained elements, subject to the layout_flags.

Description

Adds a form component item or another layout item to the layout object for it to position and size automatically, based on the rules specified by proportion, layout_flags, and border_size. Proportion determines the size of this item relative to the total proportions of the items. So, if this item has proportion of 1 and there is another item with a proportion of 2, this item will occupy 1/3 of the overall space of the layout object (1 / 1 + 2), subject to the layout behavior specified in layout_flags. Layout_flags is a combination of Layout.Top, Layout.Bottom, Layout.Left, Layout.Right, Layout.All, Layout.Expand, and Layout.Center, and Layout.Shaped. Border_size determines the space around the contained elements, subject to the layout_flags.

BoxLayout.addSpacer

BoxLayout.addSpacer(size : Integer)

Arguments

size
The pixel size of the spacer to add to the layout object. If the layout object has a horizontal layout, then size is the width in pixels of the spacer. If the layout object has a vertical layout, then size is the height in pixels of the spacer.

Description

Adds a spacer with the specified pixel size to the layout object. If the layout object has a horizontal layout, then size is the width of the spacer. If the layout object has a vertical layout, then size is the height of the spacer.

BoxLayout.addStretchSpacer

BoxLayout.addStretchSpacer(size : Integer)

Arguments

size
The proportion of the space the stretch spacer will take up relative to all the other proportionally sized items in the layout object.

Description

Adds a spacer with the specified proportional size to the layout object.

BoxLayout.clear

function BoxLayout.clear()

Description

Removes all items from the Layout object.

BoxLayout.insert

function BoxLayout.insert(index : Integer | FormComponent | Layout, item : FormComponent | Layout, proportion : Integer, layout_flags : Integer, border_size : Integer)

Arguments

index
If index is an integer, then it's the zero-based index where the item is to be inserted in the layout object. If index is a FormComponent or Layout object, it's the index of the FormComponent or Layout object before which the item will be inserted.
item
The form component or layout object to add to be positioned and sized by this layout object.
proportion
The relative size of this item to all the other items, subject to the layout_flags.
layout_flags
Combination of Layout.Top, Layout.Bottom, Layout.Left, Layout.Right, Layout.All, Layout.Expand, and Layout.Center, and Layout.Shaped.
border_size
The space around the contained elements, subject to the layout_flags.

Description

Inserts a form component item or another layout item into the layout object for it to position and size automatically, based on the rules specified by proportion, layout_flags, and border_size. The item is inserted at the specified index or else before the index of the specified FormComponent or Layout item. Proportion determines the size of this item relative to the total proportions of the items. So, if this item has proportion of 1 and there is another item with a proportion of 2, this item will occupy 1/3 of the overall space of the layout object (1 / 1 + 2), subject to the layout behavior specified in layout_flags. Layout_flags is a combination of Layout.Top, Layout.Bottom, Layout.Left, Layout.Right, Layout.All, Layout.Expand, and Layout.Center, and Layout.Shaped. Border_size determines the space around the contained elements, subject to the layout_flags.

BoxLayout.insertSpacer

BoxLayout.insertSpacer(index : Integer | FormComponent | Layout, size : Integer)

Arguments

index
If index is an integer, then it's the zero-based index where the spacer is to be inserted in the layout object. If index is a FormComponent or Layout object, it's the index of the FormComponent or Layout object before which the spacer will be inserted.
size
The pixel size of the spacer to add to the layout object. If the layout object has a horizontal layout, then size is the width in pixels of the spacer. If the layout object has a vertical layout, then size is the height in pixels of the spacer.

Description

Inserts a spacer with the specified pixel size to the layout object at the specified index, where the index is the zero-based index if it is an integer, or else the zero-based index of the specified FormComponent or Layout object before which the spacer will be inserted. If the layout object has a horizontal layout, then size is the width of the spacer. If the layout object has a vertical layout, then size is the height of the spacer.

BoxLayout.insertStretchSpacer

BoxLayout.insertStretchSpacer(index : Integer | FormComponent | Layout, size : Integer)

Arguments

index
If index is an integer, then it's the zero-based index where the spacer is to be inserted in the layout object. If index is a FormComponent or Layout object, it's the index of the FormComponent or Layout object before which the spacer will be inserted.
size
The proportion of the space the stretch spacer will take up relative to all the other proportionally sized items in the layout object.

Description

Inserts a stretch spacer with the specified proportional size into the layout object at the given index if index is an Integer or before the index of the given FormComponent or LayoutComponent