Layouts are container objects which are used to visually organize graphical objects (controls), such as text, buttons and images on the screen.

lay = app.CreateLayout( type, options? ) → app object: Layout

There are 4 types of layouts: “Linear”, “Absolute”, “Frame” and “Card”.

Layouts are transparent by default but you can set a background image which can be tiled or stretched to fill the layout. You can also set a background color or background gradient.

You can add child objects to the Layout using the AddChild function: lay.AddChild( object );
The alignment of chlld objects within a layout can be set by adding the options “Left”, “Right”, “Bottom” and “VCenter”, by default objects will be aligned “Top,Center”.

Linear Layouts

Linear layouts are probably the most useful type and are used to organize controls in either the default “Vertical” or “Horizontal” direction on screen.

Example - Vertical click to expand contents 

Example - Horizontal click to expand contents 

By default Layouts will auto-size to wrap their contents but you have 3 more options as to how a layout sizes within it's parent: “FillX”, “FillY” and “FillXY”.

Example - Combined click to expand contents 

Frame Layouts

Frame layouts are used to display objects in front or behind each other. Every time the AddChild function is called on a Frame layout, the child object is placed in a new layer in front of the previously added object at the top left of the frame.

Frame Layouts are useful if you wish to do animated Flips or Slides to reveal layers of objects or use transparency.

Example - Image Swap click to expand contents 

Absolute Layouts

Absolute layouts ignore all alignment options and allow the absolute positioning of controls by calling the SetPosition and SetSize functions of each of the child objects. However, you are encouraged use linear layouts for most of your programs, unless it is absolutely necessary.

Card Layouts

Card Layouts are just like frame layouts, but with rounded corners and a shadow by default.
They may be used to display offers with an image and optional info text.

Properties

The following properties are available on the Layout object:

dataObject: { key, value }

Methods

The following methods are available on the Layout object:

Focus()
GetAbsHeight() → Number: integer
GetAbsWidth() → Number: integer
GetChildOrder( child ) → Number: integer
GetHeight( options? ) → Number
GetLeft( options? ) → Number
GetParent() → app object
GetPosition( options? ) → Object: { left, top, width, height }
GetTop( options? ) → Number
GetType() → String: “Layout”
GetVisibility() → String: “Show” or “Hide” or “Gone”
GetWidth( options? ) → Number
Gone()
Hide()
IsEnabled() → Boolean
IsOverlap( obj, depth? ) → Boolean
IsVisible() → Boolean
Method( name, types?, p1?, p2?, p3?, p4? ) → all types
Resize()
SetScale( x, y )
Show()