PERGOLA LOGO

pergola.Layout

System events: NO (does not concern the produced components).

User events and functions: NO (does not concern the produced components).

Currently there is a limited number of layouts, and they are particularly designed for panels (non-resizable). The layouts methods are not designed to be invoked explicitly; their names are assigned as strings to the type property of the layout initialization object. The owner object that requires a Layout instance, defines the layout property. See also Layout in the tutorial.

Listed: class properties/methods; prototype properties and methods; instance properties. Prototype properties and methods inherited by the Class superclass are not listed.

class

None

prototype

PROPERTIES

Only those inherited by pergola.Class.

METHODS

table()

Simulation of basic HTML table. This method is invoked by the build method and must not be invoked explicitly. Example.

The initialization object inherent to this layout type defines these properties:

  • x : table coordinate
  • y : table coordinate
  • rows : number of rows – required
  • cols : number of columns – required
  • spacing : cell spacing
  • attributes : object – collection of <rect> attributes (including the style and class attributes) applied to cells
  • fn : typically a user function to populate the cells

Note: the method defines the cells property (array) of this owner. The elements of the array reference the cells' <g> containers, which can then be easily populated and updated.

combobox()

Embeds a combobox. Example.

The initialization object inherent to this layout type defines these properties:

  • x : container's x
  • y : container's y
  • width : if not specified, will be equal to the panel's width
  • height : if not specified, will be equal to the panel's height
  • list : array of strings (ListItem names)
  • layout : the combobox can in turn define a layout
  • fn : typically a user function to populate the combobox

tabbed()

Create a panel with tabs. A pergola.Tab instance is created for each property in this tabs. Example.

The initialization object inherent to this layout type defines these properties:

  • tabs : object defining the tabs

Note: the properties defined in this tabs become properties of this owner (the panel).

message()

Pergola uses this layout to build the pergola.notification system object. Example.

findDialog()

Pergola uses this layout to build the pergola.findDialog system object. Example.

fileDialog()

Pergola uses this layout to build the pergola.fileDialog system object.

build(object)

this inherits the properties specified in object. object must specify type, representing the name of an existing layout method. Prototype properties specified in object are overridden. Invokes this [type](). Returns this.

instance

name

String. If not passed to the constructor, gets a generated XML name (Class).

id

String. The return value of this name.toXML().

owner

Must be specified in the initialization object. Designates the owner object.

type

Must be specified in the initialization object. String. The name of an existing layout method.