File Duplex/UIButton.lua

Functions

UIButton:__init (display) Initialize the UIButton class
UIButton:add_listeners () Add event listeners to the button (press, release, change, hold)
UIButton:do_change (msg) User changed value via fader, dial ...
UIButton:do_hold (msg) User held button for a while (exact time is specified in preferences).
UIButton:do_press (msg) User pressed button
UIButton:do_release (msg) User released button
UIButton:draw () Update the appearance of the button
UIButton:flash (delay, ...) Easy way to animate the appearance of the button
UIButton:force_update () Force the button to update: some controllers handle their internal state by themselves, and as a result, we never know their actual state.
UIButton:remove_listeners () Remove previously attached event listeners
UIButton:set (fg_val) Shorthand method for setting the foreground palette
UIButton:test (group_name, column, row) Expanded UIComponent test.


Functions

UIButton:__init (display)
Initialize the UIButton class

Parameters:

  • display: (Duplex.Display)
UIButton:add_listeners ()
Add event listeners to the button (press, release, change, hold)
UIButton:do_change (msg)
User changed value via fader, dial ...

Parameters:

  • msg: (Duplex.Message)

Return value:

    (Boolean), true when message was handled
UIButton:do_hold (msg)
User held button for a while (exact time is specified in preferences). Note that this event is only supported by controllers that transmit the "release" event

Parameters:

  • msg: (Duplex.Message)

Return value:

    (Boolean), true when message was handled
UIButton:do_press (msg)
User pressed button

Parameters:

  • msg: (Duplex.Message)

Return value:

    (Boolean), true when message was handled
UIButton:do_release (msg)
User released button

Parameters:

  • msg: (Duplex.Message)

Return value:

    (Boolean), true when message was handled
UIButton:draw ()
Update the appearance of the button
UIButton:flash (delay, ...)
Easy way to animate the appearance of the button

Parameters:

  • delay: (Number) number of ms between updates
  • ...: (Vararg) palette entries
UIButton:force_update ()
Force the button to update: some controllers handle their internal state by themselves, and as a result, we never know their actual state. For those controls, we "force-update" them by changing the canvas so that it always get output the next time the display is updated
UIButton:remove_listeners ()
Remove previously attached event listeners

See also:

UIButton:set (fg_val)
Shorthand method for setting the foreground palette

Parameters:

  • fg_val: (Table), new color/text values
UIButton:test (group_name, column, row)
Expanded UIComponent test. Look for group name, event handlers, then proceed with the standard UIComponent test

Parameters:

  • group_name: (String) control-map group name
  • column: (Number)
  • row: (Number)

Return value:

    (Boolean), false when criteria is not met

Valid XHTML 1.0!