Class BuilderItem

class ooodev.gui.menu.popup.builder.BuilderItem(*, text='', command='', style=0, checked=False, enabled=True, default=False, help_text='', help_command='', tip_help_text='', shortcut='', module=None, submenu=None)[source]

Bases: Item

Class that represents a popup item for the popup menu builder.

Parameters:
  • text (str) –

  • command (str | Command) –

  • style (int | MenuItemStyleEnum) –

  • checked (bool) –

  • enabled (bool) –

  • default (bool) –

  • help_text (str) –

  • help_command (str) –

  • tip_help_text (str) –

  • shortcut (str) –

  • module (ModuleNamesKind | str | None) –

  • submenu (List[Item] | None) –

__init__(*, text='', command='', style=0, checked=False, enabled=True, default=False, help_text='', help_command='', tip_help_text='', shortcut='', module=None, submenu=None)[source]

Constructor

Parameters:
  • text (str, optional) – Text.

  • command (str, Command, optional) – Command.

  • style (int, MenuItemStyleEnum, optional) – Style. Defaults to 0.

  • checked (bool, optional) – Check state. Defaults to False.

  • enabled (bool, optional) – Enable State. Defaults to True.

  • default (bool, optional) – Specifies if entry is default. Defaults to False.

  • help_text (str, optional) – Help Text.

  • help_command (str, optional) – Help command.

  • tip_help_text (str, optional) – Tip Help Text.

  • shortcut (str, optional) – Shortcut.

  • module (Any, optional) – Module. Defaults to None.

  • submenu (List[Item] | None) –

Return type:

None

Hint

  • MenuItemStyleEnum is an enum and can be imported from ooo.dyn.awt.menu_item_style.

  • ModuleNamesKind is an enum and can be imported from ooodev.utils.kind.module_names_kind.

  • Command can be imported from ooodev.gui.menu.common.command.

submenu_add_popup(*, text='', command='', style=0, checked=False, enabled=True, default=False, help_text='', help_command='', tip_help_text='', shortcut='', module=None)[source]

Adds a new popup item to the submenu.

Parameters:
  • text (str, optional) – Text.

  • command (str, optional) – Command.

  • style (int, MenuItemStyleEnum, optional) – Style. Defaults to 0.

  • checked (bool, optional) – Check state. Defaults to False.

  • enabled (bool, optional) – Enable State. Defaults to True.

  • default (bool, optional) – Specifies if entry is default. Defaults to False.

  • help_text (str, optional) – Help Text.

  • help_command (str, optional) – Help command.

  • tip_help_text (str, optional) – Tip Help Text.

  • shortcut (str, optional) – Shortcut.

  • module (Any, optional) – Module. Defaults to None.

Returns:

The new popup item.

Return type:

PopupItem

Hint

  • MenuItemStyleEnum is an enum and can be imported from ooo.dyn.awt.menu_item_style.

  • ModuleNamesKind is an enum and can be imported from ooodev.utils.kind.module_names_kind.

  • Command can be imported from ooodev.gui.menu.common.command.

submenu_add_separator()[source]

Adds a new separator to the submenu.

Returns:

The new separator.

Return type:

SepItem

submenu_insert_popup(idx, *, text='', command='', style=0, checked=False, enabled=True, default=False, help_text='', help_command='', tip_help_text='', shortcut='', module=None)[source]

Inserts a new popup item to the submenu.

Parameters:
  • idx (int) – Index.

  • text (str, optional) – Text.

  • command (str, Command, optional) – Command.

  • style (int, MenuItemStyleEnum, optional) – Style. Defaults to 0.

  • checked (bool, optional) – Check state. Defaults to False.

  • enabled (bool, optional) – Enable State. Defaults to True.

  • default (bool, optional) – Specifies if entry is default. Defaults to False.

  • help_text (str, optional) – Help Text.

  • help_command (str, optional) – Help command.

  • tip_help_text (str, optional) – Tip Help Text.

  • shortcut (str, optional) – Shortcut.

  • module (Any, optional) – Module. Defaults to None.

Returns:

The new popup item.

Return type:

PopupItem

Hint

  • MenuItemStyleEnum is an enum and can be imported from ooo.dyn.awt.menu_item_style.

  • ModuleNamesKind is an enum and can be imported from ooodev.utils.kind.module_names_kind.

  • Command can be imported from ooodev.gui.menu.common.command.

submenu_insert_separator(idx)[source]

Adds a new separator to the submenu.

Returns:

The new separator.

Return type:

SepItem

Parameters:

idx (int) –

to_dict()[source]
Return type:

Dict[str, Any]

property checked: bool

Gets/Sets Check state.

Return type:

bool

property command: str | Command

Gets/Sets Command.

Return type:

str | Command

property default: bool

Gets/Sets if entry is default.

Return type:

bool

property enabled: bool

Gets/Sets Enable State.

Return type:

bool

property help_command: str

Gets/Sets Help command.

Return type:

str

property help_text: str

Gets/Sets Help Text.

Return type:

str

property is_separator: bool

Gets if item is a separator.

Return type:

bool

property module: Any

Gets/Sets Module.

Return type:

Any

property shortcut: str

Gets/Sets Shortcut.

Return type:

str

property style: int

Gets/Sets Style.

Return type:

int

property submenu: list[Item]

Gets Submenu.

property text: str

Gets/Sets Text.

Return type:

str

property tip_help_text: str

Gets/Sets Tip Help Text.

Return type:

str