IDialog

class IDialog

Bases: ImpactCOMWrapperBase

Description:

Represents a dialog window capable of displaying various controls.

Remarks:

Use IGUI.make_dialog to create an “empty” dialog. Use IDialog.add_button, IDialog.add_tab and IDialog.fields to add elements to the dialog. Use the IDialog.show_modal method to display the dialog.

Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance

property fields

Gets Fields.

Description:

Gets the fields displayed by this dialog.

Returns:

The value of Fields.

Return type:

fields (IDialogFields)

add_button(button_type)
Description:

Adds a button to the dialog.

Remarks:

Note that, in all versions prior to Impact 8.0, a Close button was automatically added to every dialog. In Impact 8.0 onwards, a Close button is only added if you choose not to add any buttons yourself.

Parameters:

button_type (ipDialogButtonType) – Specifies the type of button to add.

add_custom_button(label)
Description:

Adds a button with customised text to the dialog.

Parameters:

label (str) – Specifies the custom label for the button.

add_tab(label)
Description:

Adds a tab page to the dialog.

Remarks:

The return value of this function may be used as the Number parameter in the enable_tab method.

Parameters:

label (str) – Specifies the label for the tab page.

enable_button(button_type, enable)
Description:

Enables or disables the specified button.

Parameters:
  • button_type (ipDialogButtonType) – Specifies the type of button to enable or disable.

  • enable (bool) – Specifies if the button is enabled or disabled.

enable_tab(number, enable)
Description:

Enables or disables the specified tab page.

Parameters:
  • number (int) – Specifies the number of the tab page to enable or disable.

  • enable (bool) – Specifies if the tab page is enabled or disabled.

show_modal(callback)
Description:

Displays the dialog on the screen for user interaction.

Returns:

Returns the button that was pressed by the user to close the dialog.

Parameters:

callback (win32com.client.Dispatch) – Specifies a callback method that may be used to respond to interaction with the dialog and its fields. For simple dialogs where callback features are not required, this parameter may be null (Nothing in VBScript). A callback method must be a Sub which defines a single parameter to accept an IDialogCallbackParams interface. (In VBScript, use the get_ref function, giving it the sub name.)

Examples:

Examples