module form_partial

Partial Class. Not intended to be used directly.

Partial Class for Form Component. Not intended to be used directly.

class ooodev.form.partial.form_partial.FormPartial(owner, draw_page, component, lo_inst=None)[source]

Method for adding controls and other form elements to a form.

Parameters:
  • owner (ComponentT) –

  • draw_page (XDrawPage) –

  • component (Form) –

  • lo_inst (LoInst | None) –

__init__(owner, draw_page, component, lo_inst=None)[source]

Constructor

Parameters:
  • owner (ComponentT) – Class that owns this component.

  • draw_page (XDrawPage) – Draw Page

  • component (Form) – Form component

  • lo_inst (LoInst | None) –

Return type:

None

bind_form_to_sql(src_name, cmd)[source]

Bind the form to the database in the src_name URL, and send a SQL cmd

Parameters:
  • src_name (str) – Source Name URL

  • cmd (str) – Command

Return type:

None

bind_form_to_table(src_name, tbl_name)[source]

Bind the form to the database in the src_name URL

Parameters:
  • src_name (str) – Source Name URL

  • tbl_name (str) – Table Name

Return type:

None

find_shape_for_control(ctl)[source]

Find the shape for a control.

Parameters:
Returns:

Shape for the control or None if not found.

Return type:

XShape | None

New in version 0.38.0.

get_control(ctl_model)[source]

Gets the control from the specified control model.

Parameters:

ctl_model (XControlModel) – Control Model

Raises:

Exception – If unable to get control

Returns:

Control

Return type:

XControl

get_control_index(ctl)[source]

Get the index of the control within the form.

Parameters:

ctl (FormCtlBase, XControlModel) – Control object.

Returns:

Control Index within the form or -1 if not found.

Return type:

int

New in version 0.38.0.

get_control_model(ctl_name)[source]

Gets Control Model by Name

Parameters:

ctl_name (str) – Name of control

Raises:

MissingNameError – If control not found

Returns:

Control Model if found; Otherwise, None

Return type:

XControlModel | None

insert_control_button(*, x, y, width, height=6, label='', anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a button control.

By Default the button has tab stop and does focus on click.

Parameters:
  • doc (XComponent) – Component

  • x (int | UnitT) – X Coordinate

  • y (int | UnitT) – Y Coordinate

  • width (int, UnitT, optional) – Button Width.

  • height (int, UnitT, optional) – Button Height. Defaults to 6 mm.

  • label (str, optional) – Button label (text).

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • parent_form (XNameContainer, optional) – Parent form in which to add control.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Button Control

Return type:

FormCtlButton

insert_control_check_box(*, x, y, width, height=6, label='', tri_state=True, state=TriStateKind.NOT_CHECKED, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a check box control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate

  • y (int | UnitT) – Y Coordinate

  • width (int | UnitT) – Width

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • label (str, optional) – Label (text) to assign to checkbox.

  • tri_state (TriStateKind, optional) – Specifies that the control may have the state “don’t know”. Defaults to True.

  • state (TriStateKind, optional) – Specifies the state of the control.Defaults to TriStateKind.CHECKED.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Checkbox Control

Return type:

FormCtlCheckBox

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

  • TriStateKind can be imported from ooodev.utils.kind.tri_state_kind.

insert_control_combo_box(*, x, y, width, height=6, entries=None, max_text_len=0, drop_down=True, read_only=False, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a ComboBox control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate

  • y (int | UnitT) – Y Coordinate

  • width (int | UnitT) – Width

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • entries (Iterable[str], optional) – Combo box entries

  • tri_state (TriStateKind, optional) – Specifies that the control may have the state “don’t know”. Defaults to True.

  • state (TriStateKind, optional) – Specifies the state of the control.Defaults to TriStateKind.CHECKED.

  • max_text_len (int, optional) – Specifies the maximum character count, There’s no limitation, if set to 0. Defaults to 0.

  • drop_down (bool, optional) – Specifies if the control has a drop down button. Defaults to True.

  • read_only (bool, optional) – Specifies that the content of the control cannot be modified by the user. Defaults to False.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

ComboBox Control

Return type:

FormCtlComboBox

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

insert_control_currency_field(*, x, y, width, height=6, min_value=-1000000.0, max_value=1000000.0, spin_button=False, increment=1, accuracy=2, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a currency field control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate

  • y (int | UnitT) – Y Coordinate

  • width (int | UnitT) – Width

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • min_value (float, optional) – Specifies the smallest value that can be entered in the control. Defaults to -1000000.0.

  • max_value (float, optional) – Specifies the largest value that can be entered in the control. Defaults to 1000000.0.

  • spin_button (bool, optional) – When True, a spin button is present. Defaults to False.

  • increment (int, optional) – The step when the spin button is pressed. Defaults to 1.

  • accuracy (int, optional) – Specifies the decimal accuracy. Default is 2 decimal digits

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Currency Field Control

Return type:

FormCtlCurrencyField

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

insert_control_date_field(*, x, y, width, height=6, min_date=datetime.datetime(1900, 1, 1, 0, 0), max_date=datetime.datetime(2200, 12, 31, 0, 0), drop_down=True, date_format=DateFormatKind.SYSTEM_SHORT, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Date field control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate

  • y (int | UnitT) – Y Coordinate

  • width (int | UnitT) – Width

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • date_value (datetime.datetime | None, optional) – Specifics control datetime. Defaults to None.

  • min_date (datetime.datetime, optional) – Specifics control min datetime. Defaults to datetime(1900, 1, 1, 0, 0, 0, 0).

  • max_date (datetime.datetime, optional) – Specifics control Min datetime. Defaults to datetime(2200, 12, 31, 0, 0, 0, 0).

  • drop_down (bool, optional) – Specifies if the control is a dropdown. Defaults to True.

  • date_format (DateFormatKind, optional) – Date format. Defaults to DateFormatKind.SYSTEM_SHORT.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Date Field Control

Return type:

FormCtlDateField

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

  • DateFormatKind can be imported from ooodev.utils.kind.date_format_kind.

insert_control_file(*, x, y, width, height=6, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a file control.

Parameters:
  • x (int | UnitT) – X Coordinate

  • y (int | UnitT) – Y Coordinate

  • width (int, UnitT, optional) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

File Control

Return type:

FormCtlFile

insert_control_formatted_field(*, x, y, width, height=6, min_value=-1000000.0, max_value=1000000.0, spin_button=False, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a currency field control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate

  • y (int | UnitT) – Y Coordinate

  • width (int | UnitT) – Width

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • min_value (float, optional) – Specifies the smallest value that can be entered in the control. Defaults to -1000000.0.

  • max_value (float, optional) – Specifies the largest value that can be entered in the control. Defaults to 1000000.0.

  • spin_button (bool, optional) – When True, a spin button is present. Defaults to False.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Currency Field Control.

Return type:

FormCtlFormattedField

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

insert_control_grid(*, x, y, width, height, label='', anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Grid control.

Parameters:
  • x (int | UnitT) – X Coordinate

  • y (int | UnitT) – Y Coordinate

  • width (int | UnitT) – Width

  • height (int, UnitT) – Height.

  • label (str, optional) – Grid label.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Grid Control

Return type:

FormCtlGrid

insert_control_group_box(*, x, y, width, height, label='', anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Groupbox control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate

  • y (int | UnitT) – Y Coordinate

  • width (int | UnitT) – Width

  • height (int, UnitT) – Height.

  • label (str, optional) – Groupbox label.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Groupbox Control

Return type:

FormCtlGroupBox

insert_control_hidden(*, name='', **kwargs)[source]

Inserts a Hidden control into the form.

Parameters:
  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • kwargs (Any) –

Returns:

Hidden Control.

Return type:

FormCtlHidden

insert_control_image_button(*, x, y, width, height, image_url='', border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts an Image Button control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT) – Height.

  • image_url (PathOrStr, optional) – Image URL. When setting the value it can be a string or a Path object. If a string is passed it can be a URL or a path to a file. Value such as file:///path/to/image.png and /path/to/image.png are valid. Relative paths are supported.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Image Button Control.

Return type:

FormCtlImageButton

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

insert_control_label(*, x, y, width, label, height=6, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Label control.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int, UnitT, optional) – Width.

  • label (str) – Contents of label.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Label Control.

Return type:

FormCtlFixedText

insert_control_list_box(*, x, y, width, height, entries=None, drop_down=True, read_only=False, line_count=5, multi_select=False, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a ListBox control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT) – Height.

  • entries (Iterable[str], optional) – Combo box entries

  • drop_down (bool, optional) – Specifies if the control has a drop down button. Defaults to True.

  • read_only (bool, optional) – Specifies that the content of the control cannot be modified by the user. Defaults to False.

  • line_count (int, optional) – Specifies the number of lines to display. Defaults to 5.

  • multi_select (int, optional) – Specifies if multiple entries can be selected. Defaults to False.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

ListBox Control.

Return type:

FormCtlListBox

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

insert_control_navigation_toolbar(*, x, y, width, height, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Navigation Toolbar control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT) – Height.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Navigation Toolbar Control

Return type:

FormCtlNavigationToolBar

insert_control_numeric_field(*, x, y, width, height=6, min_value=-1000000.0, max_value=1000000.0, spin_button=False, increment=1, accuracy=2, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Numeric field control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • min_value (float, optional) – Specifies the smallest value that can be entered in the control. Defaults to -1000000.0.

  • max_value (float, optional) – Specifies the largest value that can be entered in the control. Defaults to 1000000.0.

  • spin_button (bool, optional) – When True, a spin button is present. Defaults to False.

  • increment (int, optional) – The step when the spin button is pressed. Defaults to 1.

  • accuracy (int, optional) – Specifies the decimal accuracy. Default is 2 decimal digits

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Numeric Field Control.

Return type:

FormCtlNumericField

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

insert_control_pattern_field(*, x, y, width, height=6, edit_mask='', literal_mask='', border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Pattern field control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • edit_mask (str, optional) – Specifies a character code that determines what the user may enter. Defaults to "".

  • literal_mask (str, optional) – Specifies the initial values that are displayed in the pattern field. Defaults to "".

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Pattern Field Control.

Return type:

FormCtlPatternField

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

insert_control_radio_button(*, x, y, width, height=6, label='', state=StateKind.NOT_CHECKED, multiline=False, border=BorderKind.NONE, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a radio button control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • label (str, optional) – Label (text) of control.

  • anchor_type (TextContentAnchorType, optional) – _description_. Defaults to None.

  • state (StateKind, optional) – Specifies the state of the control.Defaults to StateKind.NOT_CHECKED.

  • multiline (bool, optional) – Specifies if the control can display multiple lines of text. Defaults to False.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.NONE.

  • anchor_type – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Radio Button Control.

Return type:

FormCtlRadioButton

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

  • StateKind can be imported from ooodev.utils.kind.state_kind.

insert_control_rich_text(*, x, y, width, height, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Rich Text control.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int, UnitT, optional) – Width.

  • height (int, UnitT, optional) – Height.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Rich Text Control.

Return type:

FormCtlRichText

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

insert_control_scroll_bar(*, x, y, width, height=6, min_value=0, max_value=100, orientation=OrientationKind.HORIZONTAL, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Scrollbar control.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int, UnitT, optional) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • min_value (float, optional) – Specifies the smallest value that can be entered in the control. Defaults to 0.

  • max_value (float, optional) – Specifies the largest value that can be entered in the control. Defaults to 100.

  • orientation (OrientationKind, optional) – Orientation. Defaults to OrientationKind.HORIZONTAL.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Scrollbar Control.

Return type:

FormCtlScrollBar

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

  • OrientationKind can be imported from ooodev.utils.kind.orientation_kind.

insert_control_spin_button(*, x, y, width, height=6, value=0, min_value=-1000000, max_value=1000000, increment=1, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Spin Button control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • value (int, optional) – Specifies the initial value of the control. Defaults to 0.

  • min_value (float, optional) – Specifies the smallest value that can be entered in the control. Defaults to -1000000.0.

  • max_value (float, optional) – Specifies the largest value that can be entered in the control. Defaults to 1000000.0.

  • increment (int, optional) – The step when the spin button is pressed. Defaults to 1.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Spin Button Control.

Return type:

FormCtlSpinButton

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

insert_control_submit_button(*, x, y, width, height=6, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a submit button control.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int, UnitT, optional) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Submit Button Control.

Return type:

FormCtlSubmitButton

insert_control_text_field(*, x, y, width, height, text='', echo_char='', border=BorderKind.NONE, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Text field control.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int, UnitT, optional) – Width.

  • height (int, UnitT, optional) – Height.

  • text (str, optional) – Text value.

  • echo_char (str, optional) – Character used for masking. Must be a single character.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.NONE.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Text Field Control.

Return type:

FormCtlTextField

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

insert_control_time_field(*, x, y, width, height=6, time_value=None, min_time=datetime.time(0, 0), max_time=datetime.time(23, 59, 59, 999999), time_format=TimeFormatKind.SHORT_24H, spin_button=True, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Time field control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • time_value (datetime.time | None, optional) – Specifics the control time. Defaults to None.

  • min_time (datetime.time, optional) – Specifics control min time. Defaults to time(0, 0, 0, 0).

  • max_time (datetime.time, optional) – Specifics control min time. Defaults to a time(23, 59, 59, 999_999).

  • drop_down (bool, optional) – Specifies if the control is a dropdown. Defaults to True.

  • time_format (TimeFormatKind, optional) – Date format. Defaults to TimeFormatKind.SHORT_24H.

  • pin_button (bool, optional) – When True, a spin button is present. Defaults to True.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

  • spin_button (bool) –

Returns:

Time Field Control.

Return type:

FormCtlTimeField

Hint

  • BorderKind can be imported from ooodev.utils.kind.border_kind.

  • TimeFormatKind can be imported from ooodev.utils.kind.time_format_kind.

insert_db_control_check_box(*, x, y, width, height=6, tri_state=True, state=TriStateKind.CHECKED, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a database check box control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • anchor_type (TextContentAnchorType, optional) – _description_. Defaults to None.

  • tri_state (TriStateKind, optional) – Specifies that the control may have the state “don’t know”. Defaults to True.

  • state (TriStateKind, optional) – Specifies the state of the control.Defaults to TriStateKind.CHECKED.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Database Checkbox Control.

Return type:

FormCtlDbCheckBox

insert_db_control_combo_box(*, x, y, width, height=6, entries=None, max_text_len=0, drop_down=True, read_only=False, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Database ComboBox control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • entries (Iterable[str], optional) – Combo box entries

  • tri_state (TriStateKind, optional) – Specifies that the control may have the state “don’t know”. Defaults to True.

  • state (TriStateKind, optional) – Specifies the state of the control.Defaults to TriStateKind.CHECKED.

  • max_text_len (int, optional) – Specifies the maximum character count, There’s no limitation, if set to 0. Defaults to 0.

  • drop_down (bool, optional) – Specifies if the control has a drop down button. Defaults to True.

  • read_only (bool, optional) – Specifies that the content of the control cannot be modified by the user. Defaults to False.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Database ComboBox Control.

Return type:

FormCtlDbComboBox

insert_db_control_currency_field(*, x, y, width, height=6, min_value=-1000000.0, max_value=1000000.0, spin_button=False, increment=1, accuracy=2, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a database currency field control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • min_value (float, optional) – Specifies the smallest value that can be entered in the control. Defaults to -1000000.0.

  • max_value (float, optional) – Specifies the largest value that can be entered in the control. Defaults to 1000000.0.

  • spin_button (bool, optional) – When True, a spin button is present. Defaults to False.

  • increment (int, optional) – The step when the spin button is pressed. Defaults to 1.

  • accuracy (int, optional) – Specifies the decimal accuracy. Default is 2 decimal digits

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Database Currency Field Control.

Return type:

FormCtlDbCurrencyField

insert_db_control_date_field(*, x, y, width, height=6, min_date=datetime.datetime(1900, 1, 1, 0, 0), max_date=datetime.datetime(2200, 12, 31, 0, 0), drop_down=True, date_format=DateFormatKind.SYSTEM_SHORT, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Database Date field control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • date_value (datetime.datetime | None, optional) – Specifics control datetime. Defaults to None.

  • min_date (datetime.datetime, optional) – Specifics control min datetime. Defaults to datetime(1900, 1, 1, 0, 0, 0, 0).

  • max_date (datetime.datetime, optional) – Specifics control Min datetime. Defaults to datetime(2200, 12, 31, 0, 0, 0, 0).

  • drop_down (bool, optional) – Specifies if the control is a dropdown. Defaults to True.

  • date_format (DateFormatKind, optional) – Date format. Defaults to DateFormatKind.SYSTEM_SHORT.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Database Date Field Control.

Return type:

FormCtlDbDateField

insert_db_control_formatted_field(*, x, y, width, height=6, min_value=-1000000.0, max_value=1000000.0, spin_button=False, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Database currency field control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • min_value (float, optional) – Specifies the smallest value that can be entered in the control. Defaults to -1000000.0.

  • max_value (float, optional) – Specifies the largest value that can be entered in the control. Defaults to 1000000.0.

  • spin_button (bool, optional) – When True, a spin button is present. Defaults to False.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Database Currency Field Control.

Return type:

FormCtlDbFormattedField

insert_db_control_list_box(*, x, y, width, height, entries=None, drop_down=True, read_only=False, line_count=5, multi_select=False, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Database ListBox control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT) – Height.

  • entries (Iterable[str], optional) – Combo box entries

  • drop_down (bool, optional) – Specifies if the control has a drop down button. Defaults to True.

  • read_only (bool, optional) – Specifies that the content of the control cannot be modified by the user. Defaults to False.

  • line_count (int, optional) – Specifies the number of lines to display. Defaults to 5.

  • multi_select (int, optional) – Specifies if multiple entries can be selected. Defaults to False.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Database ListBox Control.

Return type:

FormCtlDbListBox

insert_db_control_numeric_field(*, x, y, width, height=6, min_value=-1000000.0, max_value=1000000.0, spin_button=False, increment=1, accuracy=2, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Database Numeric field control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • min_value (float, optional) – Specifies the smallest value that can be entered in the control. Defaults to -1000000.0.

  • max_value (float, optional) – Specifies the largest value that can be entered in the control. Defaults to 1000000.0.

  • spin_button (bool, optional) – When True, a spin button is present. Defaults to False.

  • increment (int, optional) – The step when the spin button is pressed. Defaults to 1.

  • accuracy (int, optional) – Specifies the decimal accuracy. Default is 2 decimal digits

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Database Numeric Field Control.

Return type:

FormCtlDbNumericField

insert_db_control_pattern_field(*, x, y, width, height=6, edit_mask='', literal_mask='', border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Database Pattern field control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • edit_mask (str, optional) – Specifies a character code that determines what the user may enter. Defaults to "".

  • literal_mask (str, optional) – Specifies the initial values that are displayed in the pattern field. Defaults to "".

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Database Pattern Field Control.

Return type:

FormCtlDbPatternField

insert_db_control_radio_button(*, x, y, width, height=6, state=StateKind.NOT_CHECKED, multiline=False, border=BorderKind.NONE, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Database radio button control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • anchor_type (TextContentAnchorType, optional) – _description_. Defaults to None.

  • tri_state (StateKind, optional) – Specifies that the control may have the state “don’t know”. Defaults to True.

  • state (TriStateKind, optional) – Specifies the state of the control.Defaults to StateKind.NOT_CHECKED.

  • multiline (bool, optional) – Specifies if the control can display multiple lines of text. Defaults to False.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.NONE.

  • anchor_type – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Database Radio Button Control.

Return type:

FormCtlDbRadioButton

insert_db_control_text_field(*, x, y, width, height, text='', echo_char='', border=BorderKind.NONE, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Database Text field control.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int, UnitT, optional) – Width.

  • height (int, UnitT, optional) – Height.

  • text (str, optional) – Text value.

  • echo_char (str, optional) – Character used for masking. Must be a single character.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.NONE.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

Returns:

Database Text Field Control.

Return type:

FormCtlDbTextField

insert_db_control_time_field(*, x, y, width, height=6, time_value=None, min_time=datetime.time(0, 0), max_time=datetime.time(23, 59, 59, 999999), time_format=TimeFormatKind.SHORT_24H, spin_button=True, border=BorderKind.BORDER_3D, anchor_type=TextContentAnchorType.AT_PARAGRAPH, name='', styles=None)[source]

Inserts a Database Time field control into the form.

Parameters:
  • x (int | UnitT) – X Coordinate.

  • y (int | UnitT) – Y Coordinate.

  • width (int | UnitT) – Width.

  • height (int, UnitT, optional) – Height. Defaults to 6 mm.

  • time_value (datetime.time | None, optional) – Specifics the control time. Defaults to None.

  • min_time (datetime.time, optional) – Specifics control min time. Defaults to time(0, 0, 0, 0).

  • max_time (datetime.time, optional) – Specifics control min time. Defaults to a time(23, 59, 59, 999_999).

  • drop_down (bool, optional) – Specifies if the control is a dropdown. Defaults to True.

  • time_format (TimeFormatKind, optional) – Date format. Defaults to TimeFormatKind.SHORT_24H.

  • pin_button (bool, optional) – When True, a spin button is present. Defaults to True.

  • border (BorderKind, optional) – Border option. Defaults to BorderKind.BORDER_3D.

  • anchor_type (TextContentAnchorType, optional) – Control Anchor Type. Defaults to TextContentAnchorType.AT_PARAGRAPH

  • name (str, optional) – Name of control. Must be a unique name. If empty, a unique name is generated.

  • styles (Iterable[StyleT], optional) – One or more styles to apply to the control shape.

  • spin_button (bool) –

Returns:

Database Time Field Control.

Return type:

FormCtlTimeField