# cp.ui.Slider

Slider Module.


# API Overview

Functions - API calls offered directly by the extension

  • matches

Constructors - API calls which return an object, typically one that offers API methods

  • Slider

Fields - Variables which can only be accessed from an object returned by a constructor

  • maxValue
  • minValue
  • value

Methods - API calls which can only be made on an object returned by a constructor

  • decrement
  • getMaxValue
  • getMinValue
  • getValue
  • increment
  • loadLayout
  • saveLayout
  • setValue
  • shiftValue

# API Documentation

# Functions

# matches

Signature cp.ui.Slider.matches(element) -> boolean
Type Function
Description Checks if the provided hs.axuielement is a Slider.
Parameters
  • element - The axuielement to check.
Returns
  • true if it's a match, or false if not.
Notes None
Examples None
Source src/extensions/cp/ui/Slider.lua line 12

# 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.axuielement for the slider, or nil.
Returns
  • A new Slider instance.
Notes None
Examples None
Source src/extensions/cp/ui/Slider.lua line 25

# Fields

# maxValue

Signature cp.ui.Slider.maxValue <cp.prop: number; read-only>
Type Field
Description Gets the maximum value of the slider.
Notes None
Source src/extensions/cp/ui/Slider.lua line 53

# minValue

Signature cp.ui.Slider.minValue <cp.prop: number; read-only>
Type Field
Description Gets the minimum value of the slider.
Notes None
Source src/extensions/cp/ui/Slider.lua line 46

# value

Signature cp.ui.Slider.value <cp.prop: number>
Type Field
Description Sets or gets the value of the slider.
Notes None
Source src/extensions/cp/ui/Slider.lua line 39

# Methods

# decrement

Signature cp.ui.Slider:decrement() -> self
Type Method
Description Decrements the slider by one step.
Parameters
  • None
Returns
  • Self
Notes None
Examples None
Source src/extensions/cp/ui/Slider.lua line 147

# getMaxValue

Signature cp.ui.Slider:getMaxValue() -> number
Type Method
Description Gets the maximum value of the slider.
Parameters
  • None
Returns
  • The value as a number.
Notes None
Examples None
Source src/extensions/cp/ui/Slider.lua line 117

# getMinValue

Signature cp.ui.Slider:getMinValue() -> number
Type Method
Description Gets the minimum value of the slider.
Parameters
  • None
Returns
  • The value as a number.
Notes None
Examples None
Source src/extensions/cp/ui/Slider.lua line 104

# 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.
Notes None
Examples None
Source src/extensions/cp/ui/Slider.lua line 60

# increment

Signature cp.ui.Slider:increment() -> self
Type Method
Description Increments the slider by one step.
Parameters
  • None
Returns
  • Self
Notes None
Examples None
Source src/extensions/cp/ui/Slider.lua line 130

# loadLayout

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
Notes None
Examples None
Source src/extensions/cp/ui/Slider.lua line 196

# saveLayout

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.
Notes None
Examples None
Source src/extensions/cp/ui/Slider.lua line 181

# 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
Notes None
Examples None
Source src/extensions/cp/ui/Slider.lua line 73

# shiftValue

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
Notes None
Examples None
Source src/extensions/cp/ui/Slider.lua line 87