cheatgui
    Preparing search index...

    Class SliderWidget

    A class representing a slider where you can select a value from a specific range.

    @ extends Widget implements ValueWidget

    Hierarchy (View Summary)

    Implements

    Index

    Constructors

    • Create a new slider and initialize it.

      Parameters

      • options: {
            callback?: ((value: number, currentValue: number) => void) | null;
            label?: string;
            max?: number;
            min?: number;
            step?: number;
            value?: number;
        }

        The options for the slider

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

          The function to call when the slider is changed

        • Optionallabel?: string

          The label text

        • Optionalmax?: number

          The maximum value

        • Optionalmin?: number

          The minimum value

        • Optionalstep?: number

          The step size

        • Optionalvalue?: number

          The initial value

      Returns SliderWidget

    Properties

    accuracy: number = 0
    labelRef: HTMLDivElement
    listeners: { [key: string]: EventCallback[] }
    max: number = 100
    min: number = 0
    ref: HTMLDivElement
    sliderRef: HTMLDivElement
    step: number = 1
    thumbRef: HTMLDivElement
    value: number = 0
    view: View

    Methods

    • Bind a slider 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 slider.

      Parameters

      • f: (value: number, currentValue: number) => void

        The function to call when the slider is changed.

      Returns this

    • Set the label of the slider.

      Parameters

      • text: string

        The new label text.

      Returns this

    • Set the maximum value of the slider.

      Parameters

      • max: number

        The new maximum value.

      Returns this

    • Set the minimum value of the slider.

      Parameters

      • min: number

        The new minimum value.

      Returns this

    • Set the step size of the slider.

      Parameters

      • step: number

        The new step size.

      Returns this