cheatgui
    Preparing search index...

    Class NumberInputWidget

    A class that represents an input field where only numbers can be entered.

    @ extends Widget implements ValueWidget

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Create a new number input field and initialize it.

      Parameters

      • Optionallabel: string = ''

        The label text.

      • Optionalvalue: number = 0

        The initial value.

      • Optionalcallback: ((value: number) => void) | null = null

        The function to call when the input is changed.

      Returns NumberInputWidget

    Properties

    inputRef: HTMLInputElement
    labelRef: HTMLDivElement
    listeners: { [key: string]: EventCallback[] }
    ref: HTMLDivElement
    view: View

    Methods

    • Bind an input field to an object property.

      Parameters

      • obj: any

        The object to bind the property to.

      • prop: string

        The property to bind.

      Returns this

    • Add a change event listener to the input field.

      Parameters

      • f: (value: number) => void

        The function to call when the input is changed.

      Returns this

    • Set the label of the input field.

      Parameters

      • label: string

        The new label text.

      Returns this