setCallbacks

Set or unset event callback functions.

Signatures

  •   ParamateControls.<ControlName>.setCallbacks(options)

Details

The paramate GUI controls contain a number of predefined callback events that are called at different stages on processing the controls. The callback functions to these events can be used to monitor or to augment the behavior of the GUI control.

This function allows to set or unset one or more event callback functions. To unset a callback function, the respective value is set to undefined.

Example

 [...]
 let point3D = new ParamateControls.TransformPoint(viewPort, controls);
 [...]
 point3D.setCallbacks({ onMouseMainDown: function(){ console.log('mouse down'); },
                        onMouseMainUp: undefined });
 }
 

Remark

Note that this function is designed for dynamically changing the callback functions during the lifetime of an GUI control object. It is discouraged to call the function immediately after the object's construction since this inflicts race conditions between the initialization of the callbacks and early events taking place already.

Parameters

options

Argument object that can be filled with callback definitions for one or more events:

{
  onMouseMainDown: <function>|undefined,
  onMouseMainMove: <function>|undefined,
  onMouseMainUp: <function>|undefined,
  onConfigure: <function>|undefined,
   onShow: <function>|undefined,
   onHide: <function>|undefined,
   onValueChange: <function>|undefined
}

options.onMouseMainDown

(optional) Function to be called in the mouseDown event handler or value undefined.

options.onMouseMainMove

(optional) Function to be called in the mouseMove event handler or value undefined.

options.onMouseMainUp

(optional) Function to be called in the mouseUp event handler or value undefined.

options.onConfigure

(optional) Function to be called when the configurator is updated by the system or value undefined.

options.onShow

Function to be called when the configurator is shown again (after hiding) or value undefined.

options.onHide

Function to be called when the configurator is hidden or value undefined.

options.onValueChange

Function to be called when the value of the configurator changed or value undefined.

Return value

none

See also