Module wonderful.layout.box

The box layout.

Classes and inheritance

Margin The margin class.
Padding The padding class.
BoxLayout The box layout.
VBoxLayout A specialized version of BoxLayout that uses a vertical layout direction.
HBoxLayout A specialized version of BoxLayout that uses a horizontal layout direction.

Tables

Direction The enum of directions in which children can be layed out.

Class Margin

Margin:__new__(layout, l, t, r, b) Construct a new instance.
Margin:set(l, t, r, b) Set the margins.
Margin:setLeft(l) Set the left margin.
Margin:setTop(t) Set the top margin.
Margin:setRight(r) Set the right margin.
Margin:setBottom(b) Set the bottom margin.
Margin:getLeft() Get the left margin.
Margin:getTop() Get the top margin.
Margin:getRight() Get the right margin.
Margin:getBottom() Get the bottom margin.

Class Padding

Padding:__new__(layout, l, t, r, b) Construct a new instance.
Padding:set(l, t, r, b) Set the paddings.
Padding:setLeft(l) Set the left padding.
Padding:setTop(t) Set the top padding.
Padding:setRight(r) Set the right padding.
Padding:setBottom(b) Set the bottom padding.
Padding:getLeft() Get the left padding.
Padding:getTop() Get the top padding.
Padding:getRight() Get the right padding.
Padding:getBottom() Get the bottom padding.

Class BoxLayout

BoxLayout:__new__(args) Construct a new instance.
BoxLayout:setDirection(direction) Set the direction in which to lay children out.
BoxLayout:getDirection() Get the direction in which children are laid out.
BoxLayout:isVertical() Check if the box is laid out vertically.
BoxLayout:isReversed() Check if the box is laid out in reverse order.
BoxLayout:getPadding() Return the layout's padding.
BoxLayout:insertChild(index, element[, stretch]) Insert an element at a given index.
BoxLayout:removeChild(index) Remove an element at a given index.
BoxLayout:replaceChild(index, child[, stretch]) Replace an element at a given index.

Class VBoxLayout

VBoxLayout:__new__(args) Construct a new instance.
VBoxLayout:setDirection(reversed) Set the direction in which to lay children out.

Class HBoxLayout

HBoxLayout:__new__(args) Construct a new instance.
HBoxLayout:setDirection(reversed) Set the direction in which to lay children out.


Classes and inheritance

Margin
The margin class.
Padding
The padding class.
BoxLayout
The box layout.

Parent classes:

VBoxLayout
A specialized version of BoxLayout that uses a vertical layout direction.

Parent classes:

HBoxLayout
A specialized version of BoxLayout that uses a horizontal layout direction.

Parent classes:

Tables

Direction
The enum of directions in which children can be layed out.

Fields:

  • TopToBottom The first child is at the top, consequent ones are put below it.
  • BottomToTop The first child is at the bottom, consequent ones are put above it.
  • LeftToRight The first child is at the left, consequent ones are put to the right of it.
  • RightToLeft The first child is at the right, consequent ones are put to the left of it.

Class Margin

Margin:__new__(layout, l, t, r, b)
Construct a new instance.

Parameters:

  • layout BoxLayout the layout to which to be bind the instance
  • l optional int the left margin
  • t optional int the top margin
  • r optional int the right margin
  • b optional int the bottom margin
Margin:set(l, t, r, b)
Set the margins. A shorthand for setting each margin individually.

Parameters:

  • l optional int the left margin
  • t optional int the top margin
  • r optional int the right margin
  • b optional int the bottom margin
Margin:setLeft(l)
Set the left margin.

Parameters:

  • l optional int the left margin
Margin:setTop(t)
Set the top margin.

Parameters:

  • t optional int the top margin
Margin:setRight(r)
Set the right margin.

Parameters:

  • r optional int the right margin
Margin:setBottom(b)
Set the bottom margin.

Parameters:

  • b optional int the bottom margin
Margin:getLeft()
Get the left margin.

Returns:

    int the left margin
Margin:getTop()
Get the top margin.

Returns:

    int the left margin
Margin:getRight()
Get the right margin.

Returns:

    int the right margin
Margin:getBottom()
Get the bottom margin.

Returns:

    int the bottom margin

Class Padding

Padding:__new__(layout, l, t, r, b)
Construct a new instance.

Parameters:

  • layout BoxLayout the layout to which to be bind the instance
  • l optional int the left padding
  • t optional int the top padding
  • r optional int the right padding
  • b optional int the bottom padding
Padding:set(l, t, r, b)
Set the paddings. A shorthand for setting each padding individually.

Parameters:

  • l optional int the left padding
  • t optional int the top padding
  • r optional int the right padding
  • b optional int the bottom padding
Padding:setLeft(l)
Set the left padding.

Parameters:

  • l optional int the left padding
Padding:setTop(t)
Set the top padding.

Parameters:

  • t optional int the top padding
Padding:setRight(r)
Set the right padding.

Parameters:

  • r optional int the right padding
Padding:setBottom(b)
Set the bottom padding.

Parameters:

  • b optional int the bottom padding
Padding:getLeft()
Get the left padding.

Returns:

    int the left padding
Padding:getTop()
Get the top padding.

Returns:

    int the left padding
Padding:getRight()
Get the right padding.

Returns:

    int the right padding
Padding:getBottom()
Get the bottom padding.

Returns:

    int the bottom padding

Class BoxLayout

BoxLayout:__new__(args)
Construct a new instance.

Parameters:

  • args keyword argument table
    • direction number the direction in which to lay children out

See also:

BoxLayout:setDirection(direction)
Set the direction in which to lay children out.

Automatically issues composition request.

Parameters:

BoxLayout:getDirection()
Get the direction in which children are laid out.

Returns:

    number one of Direction values
BoxLayout:isVertical()
Check if the box is laid out vertically.

Returns:

    boolean
BoxLayout:isReversed()
Check if the box is laid out in reverse order.

Returns:

    boolean
BoxLayout:getPadding()
Return the layout's padding.

Use the instance's methods to modify values.

Returns:

    Padding

Usage:

    layout:getPadding():setTop(10)
BoxLayout:insertChild(index, element[, stretch])
Insert an element at a given index.

Parameters:

  • index int the index
  • element the element
  • stretch number the stretch value (optional)

Returns:

    Margin the element's margin

See also:

Usage:

    layout:insertChild(1, element):set(10, 20, nil, nil)
BoxLayout:removeChild(index)
Remove an element at a given index.

Parameters:

  • index int the index

Returns:

    the removed element

Or

    `false` no element at the given index

See also:

BoxLayout:replaceChild(index, child[, stretch])
Replace an element at a given index.

The margin values default to that of the replaced element.

If the margin is nil, it defaults to the replaced element's margin. The same is true for the stretch.

Parameters:

  • index int the index
  • child the element
  • stretch number the stretch value (optional)

Returns:

  1. the replaced element
  2. Margin the element's margin

Or

    `false` no element at the given index

See also:

Usage:

    select(2, layout:replace(element, element)):setTop(10)

Class VBoxLayout

VBoxLayout:__new__(args)
Construct a new instance.

Parameters:

  • args keyword argument table
    • reversed boolean whether to set the direction to bottom-to-top (default false)
VBoxLayout:setDirection(reversed)
Set the direction in which to lay children out.

Automatically issues composition request.

Parameters:

  • reversed boolean whether to set the direction to bottom-to-top

Class HBoxLayout

HBoxLayout:__new__(args)
Construct a new instance.

Parameters:

  • args keyword argument table
    • reversed boolean whether to set the direction to right-to-left
HBoxLayout:setDirection(reversed)
Set the direction in which to lay children out.

Automatically issues composition request.

Parameters:

  • reversed boolean whether to set the direction to right-to-left
generated by LDoc 1.4.6 Last updated 2019-07-27 21:32:05