Class ModelFormattedField

class ooodev.dialog.dl_control.model.model_formatted_field.ModelFormattedField(model)[source]

Bases: ModelPropPartial, UnoControlFormattedFieldModelPartial, UnoControlDialogElementPartial

Parameters:

model (UnoControlModel) –

__init__(model)[source]

Constructor

Parameters:
  • component (UnoControlModel) – UNO Component that implements com.sun.star.awt.UnoControlModel service.

  • model (com.sun.star.awt.UnoControlModel) –

Return type:

None

add_event_listener(listener)

Adds an event listener to the component.

Parameters:

listener (XEventListener) – The event listener to be added.

Return type:

None

add_property_change_listener(name, listener)

Adds a listener for property changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be added.

Return type:

None

add_vetoable_change_listener(name, listener)

Adds a listener for vetoable changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be added.

Return type:

None

create_clone()

Creates a clone of the object.

Returns:

The clone.

Return type:

XCloneable

dispose()

Disposes the component.

Return type:

None

get_property_set_info()

Returns the property set info.

Returns:

The property set info.

Return type:

XPropertySetInfo

get_property_value(name)

Returns the value of a property.

Parameters:

name (str) – The name of the property.

Returns:

The value of the property.

Return type:

Any

remove_event_listener(listener)

Removes an event listener from the component.

Parameters:

listener (XEventListener) – The event listener to be removed.

Return type:

None

remove_property_change_listener(name, listener)

Removes a listener for property changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be removed.

Return type:

None

remove_vetoable_change_listener(name, listener)

Removes a listener for vetoable changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be removed.

Return type:

None

set_font_descriptor(font_descriptor)

Sets the font descriptor of the control.

Parameters:

font_descriptor (FontDescriptor, FontDescriptorStructComp) – UNO Struct - Font descriptor to set.

Return type:

None

Note

The font_descriptor property can also be used to set the font descriptor.

Hint

  • FontDescriptor can be imported from ooo.dyn.awt.font_descriptor.

Return type:

None

Parameters:

font_descriptor (FontDescriptor | FontDescriptorStructComp) –

set_property_value(name, value)

Sets the value of a property.

Parameters:
  • name (str) – The name of the property.

  • value (Any) – The value of the property.

Return type:

None

property align: AlignKind

Get/Sets the horizontal alignment of the text in the control.

Hint

  • AlignKind can be imported from ooodev.utils.kind.align_kind.

Return type:

AlignKind

property background_color: Color

Gets/Set the background color of the control.

Returns:

Color

Return type:

Color

property border: BorderKind

Gets/Sets the border style of the control.

Note

Value can be set with BorderKind or int.

Hint

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

Return type:

BorderKind

property border_color: Color | None

Gets/Sets the color of the border, if present

Not every border style (see Border) may support coloring. For instance, usually a border with 3D effect will ignore the border_color setting.

optional

Returns:

Color or None if not set.

Return type:

Color | None

property context_writing_mode: int

Get or set the context_writing_mode property.

Return type:

int

property effective_default: Any

Gets the default value of the formatted field.

This may be a numeric value (double) or a string, depending on the formatting of the field.

Return type:

Any

property effective_max: float

Gets/Sets the maximum value that can be entered.

This property is ignored if the format of the field is no numeric format.

Return type:

float

property effective_min: float

Gets/Sets the minimum value that can be entered.

This property is ignored if the format of the field is no numeric format.

Return type:

float

property effective_value: Any

Gets/Sets specifies the current value of the formatted field.

This may be a numeric value (float) or a string, depending on the formatting of the field.

Return type:

Any

property enable_visible: bool

Get or set the enable_visible property.

Return type:

bool

property enabled: bool

Gets/Sets whether the control is enabled or disabled.

Return type:

bool

property font_descriptor: FontDescriptorStructComp

Gets/Sets the Font Descriptor.

Setting value can be done with a FontDescriptor or FontDescriptorStructComp object.

Returns:

Font Descriptor

Return type:

FontDescriptorStructComp

Hint

  • FontDescriptor can be imported from ooo.dyn.awt.font_descriptor.

property font_emphasis_mark: FontEmphasisEnum

Gets/Sets the FontEmphasis value of the text in the control.

Note

Value can be set with FontEmphasisEnum or int.

Hint

  • FontEmphasisEnum can be imported from ooo.dyn.text.font_emphasis.

Return type:

FontEmphasisEnum

property font_relief: FontReliefEnum

Gets/Sets FontRelief value of the text in the control.

Note

Value can be set with FontReliefEnum or int.

Hint

  • FontReliefEnum can be imported from ooo.dyn.text.font_relief.

Return type:

FontReliefEnum

property format_key: int

Gets/Sets the format to be used when formatting the field input and output.

This value is meaningful relative to the formats_supplier property only.

Return type:

int

property formats_supplier: com.sun.star.util.XNumberFormatsSupplier

Gets/Sets - supplies the formats the field should work with.

Return type:

XNumberFormatsSupplier

property height: UnitAppFontHeight

Gets/Sets the height of the control.

When setting can be an integer in AppFont Units or a UnitT.

Returns:

Height of the control.

Return type:

UnitAppFontHeight

property help_text: str

Get/Sets the help text of the control.

Return type:

str

property help_url: str

Gets/Sets the help URL of the control.

Return type:

str

property hide_inactive_selection: bool | None

Gets/Sets whether the selection in the control should be hidden when the control is not active (focused).

optional

Return type:

bool | None

property max_text_len: int

Gets/Sets the maximum character count.

There’s no limitation, if set to 0.

Return type:

int

property model: com.sun.star.awt.UnoControlModel

Uno Control Model

Return type:

UnoControlModel

property mouse_wheel_behavior: MouseWheelBehaviorEnum | None

Gets/Sets how the mouse wheel can be used to scroll through the control’s content.

Usually, the mouse wheel scroll through the control’s entry list. Using this property,you can control under which circumstances this is possible.

optional

Note

Value can be set with MouseWheelBehaviorEnum or int.

Hint

  • MouseWheelBehaviorEnum can be imported from ooo.dyn.awt.mouse_wheel_behavior

Return type:

MouseWheelBehaviorEnum | None

property name: str

Gets/Sets the name of the control.

Return type:

str

property picture: str

Gets/Sets the picture for the control

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.

Returns:

The picture URL in the format of file:///path/to/image.png or empty string if no picture is set.

Return type:

str

property printable: bool

Gets/Sets that the control will be printed with the document.

Return type:

bool

property read_only: bool

Gets/Sets if the content of the control cannot be modified by the user.

Return type:

bool

property repeat: bool | None

Gets/Sets whether the mouse should show repeating behavior, i.e. repeatedly trigger an action when keeping pressed.

optional

Return type:

bool | None

property repeat_delay: int | None

Gets/Sets the mouse repeat delay, in milliseconds.

When the user presses a mouse in a control area where this triggers an action (such as spinning the value), then usual control implementations allow to repeatedly trigger this action, without the need to release the mouse button and to press it again. The delay between two such triggers is specified with this property.

optional

Return type:

int | None

property spin: bool

Gets/Sets if the control has a spin button.

Return type:

bool

property step: int

Gets/Sets the step of the control.

Return type:

int

property strict_format: bool

Gets/Sets if the value is checked during the user input.

Return type:

bool

property tab_index: int

Gets/Sets the tab index of the control.

Return type:

int

property tabstop: bool

Gets/Sets that the control can be reached with the TAB key.

Return type:

bool

property tag: str

Gets/Sets the tag of the control.

Return type:

str

property text: str

Gets/Sets the text displayed in the control.

Return type:

str

property text_color: Color

Gets/Sets the text color of the control.

Returns:

Color

Return type:

Color

property text_line_color: Color

Gets/Sets the text line color of the control.

Returns:

Color

Return type:

Color

property treat_as_number: bool

Gets/Sets if the text is treated as a number.

Return type:

bool

property vertical_align: VerticalAlignment | None

Gets/Sets the vertical alignment of the text in the control.

optional

Hint

  • VerticalAlignment can be imported from ooo.dyn.style.vertical_alignment

Return type:

VerticalAlignment | None

property width: UnitAppFontWidth

Gets/Sets the width of the control.

When setting can be an integer in AppFont Units or a UnitT.

Returns:

Width of the control.

Return type:

UnitAppFontWidth

property writing_mode: int | None

Denotes the writing mode used in the control, as specified in the com.sun.star.text.WritingMode2 constants group.

Only LR_TB (0) and RL_TB (1) are supported at the moment.

optional

Return type:

int | None

property x: UnitAppFontX

Gets/Sets the horizontal position of the control.

When setting can be an integer in AppFont Units or a UnitT.

Returns:

Horizontal position of the control.

Return type:

UnitAppFontX

property y: UnitAppFontY

Gets/Sets the vertical position of the control.

When setting can be an integer in AppFont Units or a UnitT.

Returns:

Vertical position of the control.

Return type:

UnitAppFontY