Module Duplex.UISpinner

UISpinner makes it possible to select among a list of options

This UIComponent has been deprecated in Duplex 0.98

Flexible operating mode depend on if the unit-size is set to 1 or 2: 1 ( ) - single dial, will trigger event for each quantized value 2 [<][>] - two buttons, for next/previous style operation

Supported input methods

  • use "button" type input (next/previous buttons)
  • use "dial" or "slider" (outputs quantized values)

Functions

__init (app, map) Initialize the UISpinner class
do_change (msg) A value was changed (fader, dial)
do_press (msg) A button was pressed
set_orientation (value) Set the slider orientation (only relevant when assigned to buttons)
get_orientation () Get the orientation
set_range (minimum, maximum) Set a new value range, clipping the current index when needed (you can set just one value, since we skip nil values)
set_index (idx, skip_event_handler) Set index to specified value
draw () Update the appearance - inherited from UIComponent
set_size (size) Override UIComponent with this method
add_listeners ()

Add event listeners

DEVICE_EVENT.BUTTON_PRESSED
DEVICE_EVENT.VALUE_CHANGED
remove_listeners () Remove previously attached event listeners
_determine_index_by_pos (column, row) Determine index by position
_invoke_handler () Trigger the external handler method


Functions

__init (app, map)
Initialize the UISpinner class

Parameters:

do_change (msg)
A value was changed (fader, dial)

Parameters:

Returns:

    bool or nil
do_press (msg)
A button was pressed

Parameters:

Returns:

    bool or nil
set_orientation (value)
Set the slider orientation (only relevant when assigned to buttons)

Parameters:

get_orientation ()
Get the orientation

Returns:

    Duplex.Globals.ORIENTATION
set_range (minimum, maximum)
Set a new value range, clipping the current index when needed (you can set just one value, since we skip nil values)

Parameters:

  • minimum (number)
  • maximum (number)
set_index (idx, skip_event_handler)
Set index to specified value

Parameters:

  • idx (int)
  • skip_event_handler (bool) skip event handler
draw ()
Update the appearance - inherited from UIComponent

See also:

set_size (size)
Override UIComponent with this method

Parameters:

  • size (int) the size in units

See also:

add_listeners ()

Add event listeners

DEVICE_EVENT.BUTTON_PRESSED
DEVICE_EVENT.VALUE_CHANGED

See also:

remove_listeners ()
Remove previously attached event listeners

See also:

_determine_index_by_pos (column, row)
Determine index by position

Parameters:

  • column (int)
  • row (int)

Returns:

    (int)
_invoke_handler ()
Trigger the external handler method
generated by LDoc 1.4.2