HISE Docs

ScriptButton

Create a reference to a Button UI component and modify its values.

const var Button1 = Content.getComponent("Button1");


Class methods

addToMacroControl

Adds the knob / button to a macro controller (from 0 to 7).

ScriptButton.addToMacroControl(int macroIndex)



changed

Call this to indicate that the value has changed (the onControl callback will be executed.

ScriptButton.changed()



createLocalLookAndFeel

Returns a local look and feel if it was registered before.

ScriptButton.createLocalLookAndFeel(ScriptContentComponent *contentComponent, Component *componentToRegister)



fadeComponent

Toggles the visibility and fades a component using the global animator.

ScriptButton.fadeComponent(bool shouldBeVisible, int milliseconds)



get

returns the value of the property.

ScriptButton.get(String propertyName)



getAllProperties

Returns a list of all property IDs as array.

ScriptButton.getAllProperties()



getChildComponents

Returns list of component's children

ScriptButton.getChildComponents()



getGlobalPositionX

Returns the absolute x-position relative to the interface.

ScriptButton.getGlobalPositionX()



getGlobalPositionY

Returns the absolute y-position relative to the interface.

ScriptButton.getGlobalPositionY()



getHeight

Returns the height of the component.

ScriptButton.getHeight()



getId

Returns the ID of the component.

ScriptButton.getId()



getLocalBounds

Returns a [x, y, w, h] array that was reduced by the given amount.

ScriptButton.getLocalBounds(float reduceAmount)



getValue

Returns the current value.

ScriptButton.getValue()



getValueNormalized

Returns the normalized value.

ScriptButton.getValueNormalized()



getWidth

Returns the width of the component.

ScriptButton.getWidth()



grabFocus

Call this method in order to grab the keyboard focus for this component.

ScriptButton.grabFocus()



loseFocus

Call this method in order to give away the focus for this component.

ScriptButton.loseFocus()



sendRepaintMessage

Manually sends a repaint message for the component.

ScriptButton.sendRepaintMessage()



set

Sets the property.

ScriptButton.set(String propertyName, var value)



setColour

sets the colour of the component (BG, IT1, IT2, TXT).

ScriptButton.setColour(int colourId, int colourAs32bitHex)



setConsumedKeyPresses

Registers a selection of key presses to be consumed by this component.

ScriptButton.setConsumedKeyPresses(var listOfKeys)



setControlCallback

Pass a inline function for a custom callback event.

ScriptButton.setControlCallback(var controlFunction)



setKeyPressCallback

Adds a callback to react on key presses (when this component is focused).

ScriptButton.setKeyPressCallback(var keyboardFunction)



setLocalLookAndFeel

Attaches the local look and feel to this component.

ScriptButton.setLocalLookAndFeel(var lafObject)



setPopupData

Sets a FloatingTile that is used as popup.

ScriptButton.setPopupData(var jsonData, var position)



setPosition

Sets the position of the component.

ScriptButton.setPosition(int x, int y, int w, int h)



setPropertiesFromJSON

Restores all properties from a JSON object.

ScriptButton.setPropertiesFromJSON( var jsonData)



setStyleSheetClass

Sets the given class selectors for the component stylesheet.

ScriptButton.setStyleSheetClass( String classIds)


This will write the given CSS class selectors to the component so that it can change what selectors are applied to the component.

The argument expects a string that follows the syntax of defining class selectors in HTML: a whitespace separated list of class selectors.

".classone .classtwo .classthree"

Calling this method will update the classes for the component and invalidate the style sheet to be recalculated. This can be used to alter the appearance of a UI component.

For a change of a single property using the setStyleSheetProperty function might be a better tool.


setStyleSheetProperty

Sets a variable for this component that can be queried from a style sheet.

ScriptButton.setStyleSheetProperty( String variableId,  var value,  String type)



setStyleSheetPseudoState

Programatically sets a pseudo state (:hover, :active, :checked, :focus, :disabled) that will be used by the CSS renderer.

ScriptButton.setStyleSheetPseudoState( String pseudoState)



setTooltip

Shows a informative text on mouse hover.

ScriptButton.setTooltip( String tooltip)



setValue

Sets the current value

ScriptButton.setValue(var newValue)



setValueNormalized

Sets the current value from a range 0.0 ... 1.0.

ScriptButton.setValueNormalized(double normalizedValue)



setValueWithUndo

Sets the current value and adds it to the undo list. Don't call this from onControl!

ScriptButton.setValueWithUndo(var newValue)



setZLevel

Changes the depth hierarchy (z-axis) of sibling components (Back, Default, Front or AlwaysOnTop).

ScriptButton.setZLevel(String zLevel)



showControl

Hides / Shows the control.

ScriptButton.showControl(bool shouldBeVisible)



updateContentPropertyInternal

This updates the internal content data object from the script processor.

ScriptButton.updateContentPropertyInternal(int propertyId,  var newValue)



updateValueFromProcessorConnection

Updates the value from the processor connection. Call this method whenever the module state has changed and you want to refresh the knob value to show the current state.

ScriptButton.updateValueFromProcessorConnection()