Internationalisation
Bundled Plugins API
Slider
Slider Module.

API Overview

API Documentation

Functions

matches

Signature
cp.ui.Slider.matches(element) -> boolean
Type
Function
Description
Checks if the provided hs._asm.axuielement is a Slider.
Parameters
  • element - The axuielement to check.
Returns
  • true if it's a match, or false if not.

Constructors

Slider

Signature
cp.ui.Slider(parent, uiFinder) -> cp.ui.Slider
Type
Constructor
Description
Creates a new Slider
Parameters
  • parent - The parent object. Should have an isShowing property.
  • uiFinder - The function which returns an hs._asm.axuielement for the slider, or nil.
Returns
  • A new Slider instance.

Fields

maxValue

Signature
cp.ui.Slider.maxValue <cp.prop: number; read-only>
Type
Field
Description
Gets the maximum value of the slider.

minValue

Signature
cp.ui.Slider.minValue <cp.prop: number; read-only>
Type
Field
Description
Gets the minimum value of the slider.

value

Signature
cp.ui.Slider.value <cp.prop: number>
Type
Field
Description
Sets or gets the value of the slider.

Methods

decrement

Signature
cp.ui.Slider:decrement() -> self
Type
Method
Description
Decrements the slider by one step.
Parameters
  • None
Returns
  • Self
Signature
cp.ui.Slider:getMaxValue() -> number
Type
Method
Description
Gets the maximum value of the slider.
Parameters
  • None
Returns
  • The value as a number.
Signature
cp.ui.Slider:getMinValue() -> number
Type
Method
Description
Gets the minimum value of the slider.
Parameters
  • None
Returns
  • The value as a number.

getValue

Signature
cp.ui.Slider:getValue() -> number
Type
Method
Description
Gets the value of the slider.
Parameters
  • None
Returns
  • The value of the slider as a number.

increment

Signature
cp.ui.Slider:increment() -> self
Type
Method
Description
Increments the slider by one step.
Parameters
  • None
Returns
  • Self
Signature
cp.ui.Slider:loadLayout(layout) -> none
Type
Method
Description
Loads a Slider layout.
Parameters
  • layout - A table containing the Slider layout settings - created using [saveLayout](#saveLayout].
Returns
  • None
Signature
cp.ui.Slider:saveLayout() -> table
Type
Method
Description
Saves the current Slider layout to a table.
Parameters
  • None
Returns
  • A table containing the current Slider Layout.

setValue

Signature
cp.ui.Slider:setValue(value) -> self
Type
Method
Description
Sets the value of the slider.
Parameters
  • value - The value you want to set the slider to as a number.
Returns
  • Self
Signature
cp.ui.Slider:shiftValue(value) -> self
Type
Method
Description
Shifts the value of the slider.
Parameters
  • value - The value you want to shift the slider by as a number.
Returns
  • Self
Last modified 1mo ago