enaml.widgets.form

Classes

Form

A Container subclass that arranges its children in two columns.

class enaml.widgets.form.Form(parent=None, **kwargs)[source]

Bases: enaml.widgets.container.Container

A Container subclass that arranges its children in two columns.

The left column is typically Labels, but this is not a requirement. The right are the actual widgets for data entry. The children should be in alternating label/widget order. If there are an odd number of children, the last child will span both columns.

The Form provides an extra constraint variable, ‘midline’, which is used as the alignment anchor for the columns.

midline

The ConstraintVariable giving the midline along which the labels and widgets are aligned.

row_spacing

The spacing to place between the form rows, in pixels.

column_spacing

The spacing to place between the form columns, in pixels.

layout_constraints()[source]

Get the layout constraints for a Form.

A Form supplies default constraints which will arrange the children in a two column layout. User defined ‘constraints’ will be added on top of the generated form constraints.

This method cannot be overridden from Enaml syntax.