# cp.ui.ScrollBar

Provides access to AXScrollBar axuielement values.


# API Overview

Constants - Useful values which cannot be changed

  • HORIZONTAL_ORIENTATION
  • VERTICAL_ORIENTATION

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

  • ScrollBar

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

  • hidden
  • horizontal
  • orientation
  • value
  • vertical

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

  • loadLayout
  • matches
  • saveLayout
  • shiftValueBy

# API Documentation

# Constants

# HORIZONTAL_ORIENTATION

Signature cp.ui.ScrollBar.HORIZONTAL_ORIENTATION <string>
Type Constant
Description The value for AXOrientation when it is horizontal.
Notes None
Source src/extensions/cp/ui/ScrollBar.lua line 15

# VERTICAL_ORIENTATION

Signature cp.ui.ScrollBar.VERTICAL_ORIENTATION <string>
Type Constant
Description The value for AXOrientation when it is vertical.
Notes None
Source src/extensions/cp/ui/ScrollBar.lua line 10

# Constructors

# ScrollBar

Signature cp.ui.ScrollBar(parent, uiFinder) -> cp.ui.ScrollBar
Type Constructor
Description Creates a new ScrollBar instance with the specified parent and uiFinder.
Parameters
  • parent - the parent object.
  • uiFinder - a function or cp.prop that provides the AXScrollBar axuielement.
Returns
  • The new ScrollBar.
Notes None
Examples None
Source src/extensions/cp/ui/ScrollBar.lua line 33

# Fields

# hidden

Signature cp.ui.ScrollBar.hidden <cp.prop: boolean; read-only, live?>
Type Field
Description Is true if the ScrollBar is currently hidden.
Notes None
Source src/extensions/cp/ui/ScrollBar.lua line 69

# horizontal

Signature cp.ui.ScrollBar.horizontal <cp.prop: boolean; read-only>
Type Field
Description Is true if the ScrollBar is horizontal, otherwise false.
Notes None
Source src/extensions/cp/ui/ScrollBar.lua line 60

# orientation

Signature cp.ui.ScrollBar.orientation <cp.prop: string; read-only>
Type Field
Description The AXOrientation string.
Notes None
Source src/extensions/cp/ui/ScrollBar.lua line 44

# value

Signature cp.ui.ScrollBar.value <cp.prop: number; live?>
Type Field
Description Is the numeric scroll value, typically between 0.0 and 1.0. May be set.
Notes None
Source src/extensions/cp/ui/ScrollBar.lua line 76

# vertical

Signature cp.ui.ScrollBar.vertical <cp.prop: boolean; read-only>
Type Field
Description Is true if the ScrollBar is vertical, otherwise false.
Notes None
Source src/extensions/cp/ui/ScrollBar.lua line 51

# Methods

# loadLayout

Signature cp.ui.ScrollBar:loadLayout(layout)
Type Method
Description Loads the provided layout table of configuration parameters.
Parameters
  • layout - the table of parameters.
Returns
    Notes None
    Examples None
    Source src/extensions/cp/ui/ScrollBar.lua line 115

    # matches

    Signature cp.ui.ScrollBar.matches(element) -> boolean
    Type Method
    Description Checks if the element is a ScrollBar.
    Parameters
    • element - The axuielement being matched.
    Returns
    • true if matches, otherwise false.
    Notes None
    Examples None
    Source src/extensions/cp/ui/ScrollBar.lua line 20

    # saveLayout

    Signature cp.ui.ScrollBar:saveLayout() -> table
    Type Method
    Description Saves the ScrollBar layout configuration.
    Parameters
    • None
    Returns
    • a table with the configuration parameters.
    Notes None
    Examples None
    Source src/extensions/cp/ui/ScrollBar.lua line 100

    # shiftValueBy

    Signature cp.ui.ScrollBar:shiftValueBy(amount) -> number
    Type Method
    Description Attempts to shift the value by the specified amount.
    Parameters
    • amount - The amount to shift by.
    Returns
    • The new value, or nil if not available.
    Notes None
    Examples None
    Source src/extensions/cp/ui/ScrollBar.lua line 83