Class ButtonClickHelper

A CompoundClickHelper specialised for Button-like widgets. Handles pointer clicks and enter key-presses if the widget has a keyboard focus.

GenericClickHelper methods are still available, however, calls to the new methods provided by this class are preferrable; mostly they implement Widget methods.

Hierarchy (view full)

Constructors

Properties

keyboardClickHelper: GenericClickHelper

The helper for handling enter key presses

pointerClickHelper: ClickHelper

The helper for handling pointer clicks

pointerFocused: boolean = false
widget: Widget

The widget that will be auto-scrolled when keyboard focused

Accessors

Methods

  • Handle event from Widget#handleEvent. Does most of the button logic.

    Parameters

    • event: TricklingEvent

      The event from Widget#handleEvent

    • root: Root

      The root from Widget#handleEvent

    • enabled: boolean

      Is the button being clicked enabled? If not, then the click state will remain unchanged, but the event will be captured

    • bounds: Bounds

      The bounding box to be used for detecting pointer clicks

    Returns [wasClick: boolean, capture: boolean]

    Returns a 2-tuple containing, respective, whether a click occurred, and whether the event should be captured