fusion_addin_framework.Control¶
- class fusion_addin_framework.Control(parent: Optional[Union[fusion_addin_framework.wrapper.Panel, fusion_addin_framework.wrapper.Dropdown]] = None, controlType: str = 'button', isVisible: bool = True, isPromoted: bool = False, isPromotedByDefault: bool = False, positionID: int = '', isBefore: bool = True)¶
Wraps around Fusions CommandControl object. Besides the documented attributes and methods on this page all attributes and methods of the wrapped class can be accessed with the same attribute and method names as in the wrapped class.
Note that in contrast to the usage of the ‘orignal’ API a commandDefintion is not needed to initialize the commandControl. Instead a commandDefintion can be added as a children of the commandControl by using the
AddinCommandwrapper. If no commandDefintion is provided a dummy defintion is used which doesnt have any functionality connected to its command. Depending on the passed controlType attribute the ControlDefinition of the commandDefintion child will be determined.- Parameters
parent (Union[Panel, Dropdown], optional) – The parent panel or dropdown which contains this control. Defaults to a Panel with the default properties.
controlType (str, optional) – The kind of control which is used to activate the associated command. Possible options are “button”, “checkbox” or “list”. Only “button” control type can be used in the panel directly. Therefore you should set the isPromoted and isPromotedByDefault to False ff you use a checkbox or list. Otherwise an additional button which has no functionality will be created. This is caused by the somewhat misleading behavior of the Fusion API. Defaults to “button”.
isVisible (bool, optional) – Sets if this control is currently visible. Defaults to True.
isPromoted (bool, optional) – Sets if this command has been promoted to the parent panel. This property is ignored in the case where this controls parent isn’t a panel. Defaults to False.
isPromotedByDefault (bool, optional) – Sets if this command is a default command in the panel. This defines the default state of the panel if the UI is reset. This property is ignored in the case where this control isn’t in a panel. Defaults to False.
positionID (int, optional) – Specifies the reference id of the control to position this control relative to. Not setting this value indicates that the control will be created at the end of all other controls in toolbar. The isBefore parameter specifies whether to place the control before or after the reference control.
isBefore (bool, optional) – Specifies whether to place the control before or after the reference control specified by the positionID parameter. This argument is ignored is positionID is not specified. Defaults to True.
- addinCommand(*args, **kwargs)¶
Creates a
AddinCommandas a child of this Control.Calling this method is the same as initialsing a
AddinCommandwith this Control instance as parent parameter. Therefore the same parameters are passed. SeeAddinCommandfor a detailed description of the paramters.- Returns
The newly created or accessed AddinCommand instance.
- Return type
Summary¶
Methods
|
Creates a |
Attributes
|
The addin instance which manages this instance. |
|
The parent wrapper-instance of this wrapper-instance. |
|
The level this instance is in the user interface hierachy. |