ObjectComboBox#

class ansys.scade.guitools.control.ObjectComboBox(owner, x: int, y: int, w: int, h: int = c.COMBO_BOX_HEIGHT, **kwargs)#

Bases: scade.tool.suite.gui.widgets.ObjectComboBox

Defines an object combo box control with a default height and extensions for serialization.

This class provides an optional map to access an item with a string. This allows to persist the current selection in a file, or restore it from a value.

Parameters#

ownerAny

Owner of the combo box control.

xint

Horizontal position of the combo box control.

yint

Vertical position of the combo box control.

wint

Width of the combo box control.

hint

Height of the combo box control, default csts.COMBO_BOX_HEIGHT.

kwargsAny

Other parameters of scade.tool.suite.gui.widgets.ComboBox.

Initialize the object combo box with the given parameters.

Overview#

get_selected_name

Return the name of the selected item.

on_layout

Declare the constraints with respect to the owner.

select_name

Select the item corresponding to name.

set_items

Set the combo box items, with an optional mapping.

Import detail#

from ansys.scade.guitools.control import ObjectComboBox

Attribute detail#

ObjectComboBox.items: List[Any] = []#
ObjectComboBox.names: List[str] = []#
ObjectComboBox.owner#

Method detail#

ObjectComboBox.get_selected_name() str#

Return the name of the selected item.

ObjectComboBox.on_layout()#

Declare the constraints with respect to the owner.

ObjectComboBox.select_name(name: str)#

Select the item corresponding to name.

ObjectComboBox.set_items(items: List[Any], names: List[str] | None = None)#

Set the combo box items, with an optional mapping.

This mapping is used to serialize the selected item.