class org.aswing.BoxLayout extends EmptyLayout

A layout manager that allows multiple components to be arranged either vertically or horizontally. The components will not be wrapped. The width, height, preferredWidth, preferredHeight doesn't affect the way this layout manager layout the components.

If this boxlayout is set to X_AXIS, it will layout the child componnets evenly regardless the value of width, height, preferredWidth, preferredHeight.

The height of the child components is the same as the parent container.

The following picture illustrates this for X_AXIS:


The picure for Y_AXIS:


Note that this layout will first subtract all of the gaps before it evenly layout the components. If you have a container that is 100 pixel in width with 5 child components, the layout manager is boxlayout, and set to X_AXIS, the gap is 20. You would not see any child componnet in visual. Because the layout mananager will first subtract 20(gap)*5(component) = 100 pixels from the visual area. Then, each component's width would be 0. Pay attention to this when you use this layout manager.

Author paling, ngrebenshikov

Class Fields

static var X_AXIS:Int

Specifies that components should be laid out left to right.

static var Y_AXIS:Int

Specifies that components should be laid out top to bottom.

Instance Fields

Show inherited public instance fieldsHide inherited public instance fields

Inherited from EmptyLayout

function addLayoutComponent(comp:Component, constraints:Dynamic):Void
function getLayoutAlignmentX(target:Container):Float
function getLayoutAlignmentY(target:Container):Float
function invalidateLayout(target:Container):Void
function layoutContainer(target:Container):Void
function maximumLayoutSize(target:Container):IntDimension
function minimumLayoutSize(target:Container):IntDimension
function preferredLayoutSize(target:Container):IntDimension
function removeLayoutComponent(comp:Component):Void

var axis:Int

var gap:Int

A gap between children in pixels

function new(?axis:Int = 0, ?gap:Int = 0): Void

axis

(optional)the layout axis, default is X_AXIS

gap

(optional)the gap between children, default is 0