AspectSelector
Type: AspectSelector
Extends ViewScript class of the AspectSelector view.
Properties
| Property | Description |
|---|---|
| Since version 4.04.23, Named properties may be accessed directly instead of requiring getViewProperty / setViewProperty. The property ID may be identified in the Properties view. |
enabled
| Enables/disables the view. |
index
| Change the current selection of the AspectSelector view. |
View Properties
Properties defined by the view that are normally editable via properties editor.
| Property | Name | Description |
|---|---|---|
title |
Title | The title of the window. |
id |
Script ID | The scripting ID of the window. Can be used as an alternative to the title for searching for windows from scripts. |
tooltip |
Tool Tip | Window tool tip. |
font_size |
Font Size | Size of the text. |
no_match_text |
No Match Text | Text to display if no match is found. |
show_customize_button |
Show Customize Button | Wizard to display if customize button is clicked. |
customize_button_icon |
Customize Icon | Wizard to display if customize button is clicked. |
customize_wizard |
Customize Wizard | Wizard to display if customize button is clicked. |
Methods
| Method | Description |
|---|---|
callListener(eventName, [args])
| Calls all event listeners for the given event name, useful for testing. |
getParent()
| Get the parent window/view (if any) of this view. |
getViewProperties()
| Returns an array of objects containing the view properties. Each element has the fields 'name', 'id', 'value', 'hint'. If the property is a category then it will also have an array field 'properties'. These properties are the ones normally editable via the properties view. |
getViewProperty(id)
| Gets a property value from the view, given the property ID. Property IDs can be listed using getViewProperties. These properties are the ones normally editable via the properties view. |
on(eventName, callback)
| Adds an event listener for the given event name. e.g. view.on("click", function() { ... }); |
pxFromDimension(dimension)
| Convert a dimension string (e.g. "10em", "50dp", "100px") into pixel units, relative to the view object. Returns the size in pixels. |
removeAllListeners([eventName])
| Removes all event listeners for the given event name. If the event name is not given then all listeners for all events are removed. |
removeListener(eventName, callback)
| Removes an event listener for the given event name. e.g. let callback = function() { ... }; view.on("click", callback); view.removeListener("click", callback); |
setViewProperty(id, value)
| Sets a property on the view, given the property ID and value. Property IDs can be listed using getViewProperties These properties are the ones normally editable via the properties view. |
Events
| Event | Description |
|---|---|
afterApply()
| Event raised after the AspectSelector value is applied on selection change. Note that the callback is called within an active undo-scope + calibration update scope. External scripts can bind to the 'afterApply' event to be notified. view.on("afterApply", function() { ... }); |
beforeApply()
| Event raised before the AspectSelector value is applied on selection change. Note that the callback is called within an active undo-scope + calibration update scope. External scripts can bind to the 'beforeApply' event to be notified. view.on("beforeApply", function() { ... }); |
change(index)
| Event raised after the AspectSelector selection changed / was applied. External scripts can bind to the 'change' event to be notified. view.on("change", function(index, value) { ... }); |