Welcome | Get started | Dive | Contribute | Topics | Reference | Changes | More

lino.core.layouts

See Introduction to layouts.

Functions

DEBUG_LAYOUTS(lo)

Classes

ActionParamsLayout([main, datasource, ...])

A Layout description for an action parameter panel.

BaseLayout([main, datasource, hidden_elements])

Base class for all Layouts (FormLayout, ColumnsLayout and ParamsLayout).

ColumnsLayout([main, datasource, ...])

A layout for describing the columns of a table.

DetailLayout([main, datasource, hidden_elements])

DummyPanel()

A layout panel that does not exist in the current configuration but might exist as a real panel in some other configuration.

FieldLayout([main, datasource, hidden_elements])

FormLayout([main, datasource, hidden_elements])

Base class for layout descriptions of detail and insert windows.

InsertLayout([main, datasource, hidden_elements])

ParamsLayout([main, datasource, hidden_elements])

A Layout description for a table parameter panel.

Exceptions

LayoutError

class lino.core.layouts.DummyPanel

Bases: object

A layout panel that does not exist in the current configuration but might exist as a real panel in some other configuration.

class lino.core.layouts.BaseLayout(main=None, datasource=None, hidden_elements=None, **kw)

Bases: object

Base class for all Layouts (FormLayout, ColumnsLayout and ParamsLayout).

A Layout instance just holds the string templates. It is designed to be subclassed by applications programmers.

In some cases we still use the (deprecated) methods set_detail_layout, set_insert_layout, add_detail_panel and add_detail_tab on the Actor.

window_size: None | tuple[int, str] = None

A tuple (width, height) that specifies the size of the window to be used for this layout.

For example, specifying window_size=(50, 30) means “50 characters wide and 30 lines high”. The height value can also be the string 'auto'.

main = None

The description of the main element of this layout.

For a ColumnsLayout this is the same as column_names.

remove_element(*args)

Removes specified element names from this layout’s main template.

update(**kw)

Update the template of one or more panels.

add_panel(name, tpl, label=None, **options)

Adds a new panel to this layout.

Arguments:

  • name is the internal name of the panel

  • tpl the template string

  • label an optional label

  • any further keyword are passed as options to the new panel

add_tabpanel(name, tpl=None, label=None, **options)

Add a tab panel to an existing layout. Arguments: see BaseLayout.add_panel(). The difference with BaseLayout.add_panel() is that this potentially turns the existing main panel to a tabbed panel.

Arguments:

  • name is the internal name of the panel

  • tpl the template string

  • label an optional label

class lino.core.layouts.FormLayout(main=None, datasource=None, hidden_elements=None, **kw)

Bases: FieldLayout

Base class for layout descriptions of detail and insert windows.

Lino instantiates this for every detail_layout and for every insert_layout.

class lino.core.layouts.ColumnsLayout(main=None, datasource=None, hidden_elements=None, **kw)

Bases: FieldLayout

A layout for describing the columns of a table.

Lino automatically creates one instance of this for every table using the string specified in that table’s column_names attribute.

class lino.core.layouts.ParamsLayout(main=None, datasource=None, hidden_elements=None, **kw)

Bases: BaseLayout

A Layout description for a table parameter panel.

Lino instantiates this for every actor with parameters, based on that actor’s params_layout.

class lino.core.layouts.ActionParamsLayout(main=None, datasource=None, hidden_elements=None, **kw)

Bases: ParamsLayout

A Layout description for an action parameter panel.

Lino instantiates this for every params_layout of a custom action.

A subclass of ParamsLayout.