Internationalisation
Bundled Plugins API
ScrollBar
Provides access to AXScrollBar axuielement values.

API Overview

API Documentation

Constants

Signature
cp.ui.ScrollBar.HORIZONTAL_ORIENTATION <string>
Type
Constant
Description
The value for AXOrientation when it is horizontal.
Signature
cp.ui.ScrollBar.VERTICAL_ORIENTATION <string>
Type
Constant
Description
The value for AXOrientation when it is vertical.

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.

Fields

hidden

Signature
cp.ui.ScrollBar.hidden <cp.prop: boolean; read-only, live?>
Type
Field
Description
Is true if the ScrollBar is currently hidden.
Signature
cp.ui.ScrollBar.horizontal <cp.prop: boolean; read-only>
Type
Field
Description
Is true if the ScrollBar is horizontal, otherwise false.
Signature
cp.ui.ScrollBar.orientation <cp.prop: string; read-only>
Type
Field
Description
The AXOrientation string.

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.

vertical

Signature
cp.ui.ScrollBar.vertical <cp.prop: boolean; read-only>
Type
Field
Description
Is true if the ScrollBar is vertical, otherwise false.

Methods

Signature
cp.ui.ScrollBar:loadLayout(layout)
Type
Method
Description
Loads the provided layout table of configuration parameters.
Parameters
  • layout - the table of parameters.

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.
Signature
cp.ui.ScrollBar:saveLayout() -> table
Type
Method
Description
Saves the ScrollBar layout configuration.
Returns
  • a table with the configuration parameters.
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.
Last modified 1mo ago