ScriptToolbarDef

ScriptToolbarDef

This class is used to define and create custom toolbars in Harmony using scripting.

Constructor

new ScriptToolbarDef(toolbarDef)

Constructor to be called in scripting.
Parameters:
Name Type Description
toolbarDef Object The definition of the toolbar.
Properties
Name Type Attributes Default Description
id String The unique id of the toolbar. Use of reverse DNS is recommended to avoid conflicts with other organizations.
text String The textual name of the toolbar as will appear in the toolbar menu.
customizable boolean <optional>
true The definition of the toolbar.

Methods

addButton(button)

This method adds a button to a toolbar.
Parameters:
Name Type Description
button Object An object defining the properties of the button.
Properties
Name Type Description
text String The tooltip of the button.
icon String The icon displayed in the toolbar.
checkable boolean If true, the button will be checkable.
action String The action id if the action was added using ScriptManager.addAction or the name of a function in the current file or using the syntax: functionName in file.js.
slot String The slot to call. If action is provided, this item is not needed.
itemParameter String The first parameter value of the slot to call.
shortcut String The shortcut id that can trigger this action.