ooodev.adapter.awt.message_box_factory_partial module

class ooodev.adapter.awt.message_box_factory_partial.MessageBoxFactoryPartial(component, interface=com.sun.star.awt.XMessageBoxFactory)[source]

Bases: object

Partial class for XMessageBoxFactory.

Parameters:
  • component (XMessageBoxFactory) –

  • interface (UnoInterface | None) –

__init__(component, interface=com.sun.star.awt.XMessageBoxFactory)[source]

Constructor

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

  • interface (UnoInterface, optional) – The interface to be validated. Defaults to XMessageBoxFactory.

Return type:

None

create_message_box(parent, title, msg, boxtype=MessageBoxType.MESSAGEBOX, buttons=MessageBoxButtonsEnum.BUTTONS_OK)[source]

creates a message box.

This parameter must not be null.

A combination of com.sun.star.awt.MessageBoxButtons

A com.sun.star.awt.MessageBoxType.INFOBOX ignores this parameter, instead it uses a com.sun.star.awt.MessageBoxButtons.BUTTONS_OK.

Parameters:
  • parent (XWindowPeer) – The parent window.

  • title (str) – The title of the message box.

  • msg (str) – The message of the message box.

  • boxtype (MessageBoxType, int, optional) – determines the type of message box to display. Defaults to Type.MESSAGEBOX.

  • buttons (MessageBoxButtonsEnum, int, optional) – determines what buttons to display. Defaults to Buttons.BUTTONS_OK.

Returns:

the created message box.

Return type:

XMessageBox

Note

If boxtype is an integer, the following values are valid:

  • 0: MESSAGEBOX

  • 1: INFOBOX

  • 2: WARNINGBOX

  • 3: ERRORBOX

  • 4: QUERYBOX

Hint

Run result.execute() to show the message box.

  • MessageBoxResultsEnum can be imported from ooo.dyn.awt.message_box_results.

  • MessageBoxButtonsEnum can be imported from ooo.dyn.awt.message_box_buttons.

  • MessageBoxType can be imported from ooo.dyn.awt.message_box_type.