revitron.ui.form

This submodule contains a collection of basic form elements.

Classes:

CheckBox()

A simple checkbox component.

Label()

A simple label component.

SelectBox()

A dropdown field.

TextBox()

A text input field

class CheckBox[source]

Bases: object

A simple checkbox component.

Methods:

create(window, containerName, key, input[, ...])

A helper function that creates checkbox form element.

static create(window, containerName, key, input, title=None)[source]

A helper function that creates checkbox form element.

Parameters
  • window (object) – The parent window object

  • containerName (string) – The name of the parent container

  • key (string) – The key that references the value in the window values dictionary

  • input (mixed) – The input value

  • title (string, optional) – The checkbox title. Defaults to the key.

class Label[source]

Bases: object

A simple label component.

Methods:

create(window, containerName, text)

A helper function that creates a label component.

static create(window, containerName, text)[source]

A helper function that creates a label component.

Parameters
  • window (object) – The parent window object

  • containerName (string) – The name of the parent container

  • text (string) – The label text

class SelectBox[source]

Bases: object

A dropdown field.

Methods:

create(window, containerName, key, options, ...)

Create a select dropdown in a specific container of a given window.

static create(window, containerName, key, options, input, title=None)[source]

Create a select dropdown in a specific container of a given window.

Parameters
  • window (Window) – The Revitron Window object

  • containerName (string) – The name of the target container

  • key (string) – The key

  • options (dict|list) – The dict or list of options

  • input (dict|string) – The value for the field - a configuration dict where ‘key’ stores the value, or simply a string

  • title (string, optional) – An optional title. Defaults to None.

class TextBox[source]

Bases: object

A text input field

Methods:

create(window, containerName, key, input[, ...])

Create a text box in a specific container of a given window.

static create(window, containerName, key, input, title=None, default='')[source]

Create a text box in a specific container of a given window.

Parameters
  • window (Window) – The Revitron Window object

  • containerName (string) – The name of the target container

  • key (string) – The key

  • input (dict|string) – The value for the field - a configuration dict where ‘key’ stores the value, or simply a string

  • title (string, optional) – An optional title. Defaults to None.