CompSelector()

For use with DuAEF.DuScriptUI.
A drop down selector.
This is not a real class, and cannot be instanciated.
Use DuAEF.DuScriptUI.addCompSelector to create a Selector.
The Selector inherits the Group object from ScriptUI and has all of its properties and methods.

new CompSelector()

Properties:
Name Type Attributes Default Description
id int <optional>
0 The current compitem id, 0 if None
comps Array.<CompItem> <optional>
The compositions listed in the selector.
onChange Selector~onChange The function to execute when the index changes.
You can set your own function here, which must take no argument.
The method is called after the index has changed.
filterComps Selector~filterComps A function which gets the comps to set in the selector.
The default function will get all the comps in the project,
You can set your own function here, which must take no argument.
The function must return an array of CompItem.

Methods

static getComp() → {CompItem|null}

Gets the selected comp
Returns:
CompItem | null - the selected comp

static setComps(compsopt)

Sets the comp list
Parameters:
Name Type Attributes Description
comps Array.<CompItem> <optional>
The list of compositions. By default, will use CompSelector.filterComps() to get the comps.

static setCurrentId(index)

Changes the selection and the current comp id of the selector
Parameters:
Name Type Description
index int The new comp id

Type Definitions

filterComps() → {Array.<CompItem>}

A function which gets the comps to set in the selector.
The default function will get all the comps in the project,
assign another function to this callback if you need to filter these comps.
The function must return an array of CompItem.
Returns:
Array.<CompItem> - The compositions to set in the selector.

onChange()

The function to execute when the index changes.
The method is called after the index has changed.