Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Latest commit

 

History

History
141 lines (119 loc) · 10.6 KB

cp.ui.Slider.md

File metadata and controls

141 lines (119 loc) · 10.6 KB

docs » cp.ui.Slider


Slider Module.

API Overview

API Documentation

Functions

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

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

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

Methods

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.
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.
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.
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