WebRowLayout

Package: Libraries.Web.Layouts · Inherits from: Libraries.Language.Object, Libraries.Web.Layouts.WebLayout

WebRowLayout places the items inside an element side by side, from left to right. The gap is the space between items, in pixels. Items can wrap onto more lines when there isn't room, and can be spread out so the first sits at the left edge and the last at the right.

Example Code

use Libraries.Web.Page.all
use Libraries.Web.Layouts.WebRowLayout

class Main is WebPage
    action Main
        WebRowLayout row
        row:SetGap(8)
        row:SetWrap(true)

        Division division
        SetLayout(division, row)
        division:AddParagraph("First")
        division:AddParagraph("Second")
        Include(division)
    end
end

Actions

Generate()

Returns the stylesheet declarations for this row. WebSite calls this when it writes the stylesheet; people making pages don't.

Returns

text: The declarations for this row.

GetGap()

Sets the space between items, in pixels.

Returns

number

Example

use Libraries.Web.Layouts.WebRowLayout

WebRowLayout row
row:SetGap(8)

SetAlignedTop(boolean value)

Lines items of different heights up along the top of the row, instead of stretching them to the row's height. A sticky item beside a long one needs this to stay in view.

Parameters

  • value boolean: True to line items up along the top.

SetAtEnd(boolean value)

Gathers the items at the right end of the row, as for a row of buttons at the bottom of a form.

Parameters

  • value boolean: True to put the items at the end.

SetCenteredHorizontally(boolean value)

Gathers the items in the middle of the row, with the room left over split on either side.

Parameters

  • value boolean: True to center the items across the row.

SetCenteredVertically(boolean value)

Lines items of different heights up on their centers, as for text beside an icon. Without this, they stretch to the row's height.

Parameters

  • value boolean: True to center items vertically.

Example

use Libraries.Web.Layouts.WebRowLayout

WebRowLayout row
row:SetCenteredVertically(true)

SetGap(number pixels)

Sets the space between items, in pixels.

Parameters

  • pixels number: The space between items. It can't be negative.

Example

use Libraries.Web.Layouts.WebRowLayout

WebRowLayout row
row:SetGap(8)

SetReversed(boolean value)

Sets whether the items are shown right to left: the last item in the page first. Only the look changes; screen readers and the keyboard keep the page's order. Use it to put a picture first on a phone while the words come first in the page and on wide screens.

Parameters

  • value boolean: True to show the items right to left.

SetSpreadOut(boolean value)

Spreads the items across the row: the first at the left edge, the last at the right, and the rest evenly between.

Parameters

  • value boolean: True to spread the items out.

Example

use Libraries.Web.Layouts.WebRowLayout

WebRowLayout row
row:SetSpreadOut(true)

SetWrap(boolean value)

Sets whether items move onto another line when the row runs out of room, as words do. Without wrapping, they all stay on one line.

Parameters

  • value boolean: True to wrap.

Example

use Libraries.Web.Layouts.WebRowLayout

WebRowLayout row
row:SetWrap(true)

Inherited Actions

3 actions from Libraries.Language.Object