# cp.ui.Sheet

Sheet UI 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

  • Sheet

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

  • cancel
  • default
  • title

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

  • containsText
  • doCancel
  • doDefault
  • doHide
  • doPress
  • hide
  • pressCancel
  • pressDefault

# API Documentation

# Functions

# matches

Signature cp.ui.Sheet.matches(element) -> boolean
Type Function
Description Checks to see if an element matches what we think it should be.
Parameters
  • element - An axuielementObject to check.
Returns
  • true if matches otherwise false
Notes None
Examples None
Source src/extensions/cp/ui/Sheet.lua line 16

# Constructors

# Sheet

Signature cp.ui.Sheet(parent, uiFinder) -> Sheet
Type Constructor
Description Creates a new Sheet instance.
Parameters
  • parent - The parent object.
  • uiFinder - The UI, either a cp.prop or a function.
Returns
  • A new Browser object.
Notes None
Examples None
Source src/extensions/cp/ui/Sheet.lua line 29

# Fields

# cancel

Signature cp.ui.Sheet.cancel <cp.ui.Button>
Type Field
Description The cancel Button for the Sheet.
Notes None
Source src/extensions/cp/ui/Sheet.lua line 57

# default

Signature cp.ui.Sheet.default <cp.ui.Button>
Type Field
Description The default Button for the Sheet.
Notes None
Source src/extensions/cp/ui/Sheet.lua line 50

# title

Signature cp.ui.Sheet.title <cp.prop: string>
Type Field
Description Gets the title of the sheet.
Notes None
Source src/extensions/cp/ui/Sheet.lua line 43

# Methods

# containsText

Signature cp.ui.Sheet:containsText(value[, plain]) -> boolean
Type Method
Description Checks if there are any child text elements containing the exact text or pattern, from beginning to end.
Parameters
  • textPattern - The text pattern to check.
  • plain - If true, the text will be compared exactly, otherwise it will be considered to be a pattern. Defaults to false.
Returns
  • true if an element's AXValue matches the text pattern exactly.
Notes None
Examples None
Source src/extensions/cp/ui/Sheet.lua line 171

# doCancel

Signature cp.ui.Sheet:doCancel() -> cp.rx.go.Statement <boolean>
Type Method
Description Attempts to hide the Sheet (if visible) by pressing the Cancel button.
Parameters
  • None
Returns
  • A Statement to execute, resolving to true if the button was present and clicked, otherwise false.
Notes None
Examples None
Source src/extensions/cp/ui/Sheet.lua line 94

# doDefault

Signature cp.ui.Sheet:doDefault() -> cp.rx.go.Statement <boolean>
Type Method
Description Attempts to press the default Button.
Parameters
  • None
Returns
  • A Statement to execute, resolving to true if the button was present and clicked, otherwise false.
Notes None
Examples None
Source src/extensions/cp/ui/Sheet.lua line 107

# doHide

Signature cp.ui.Sheet:doHide() -> cp.rx.go.Statement <boolean>
Type Method
Description Attempts to hide the Sheet (if visible) by pressing the Cancel button.
Parameters
  • None
Returns
  • A Statement to execute, resolving to true if the button was present and clicked, otherwise false.
Notes None
Examples None
Source src/extensions/cp/ui/Sheet.lua line 77

# doPress

Signature cp.ui.Sheet:doPress(buttonFromLeft) -> cp.rx.go.Statement <boolean>
Type Method
Description Attempts to press the indicated button from left-to-right, if it can be found.
Parameters
  • buttonFromLeft - The number of the button from left-to-right.
Returns
  • a Statement to execute, resolving in true if the button was found and pressed, otherwise false.
Notes None
Examples None
Source src/extensions/cp/ui/Sheet.lua line 120

# hide

Signature cp.ui.Sheet:hide() -> none
Type Method
Description Hides the sheet by pressing the "Cancel" button, if it exists.
Parameters
  • None
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/ui/Sheet.lua line 64

# pressCancel

Signature cp.ui.Sheet:pressCancel() -> self, boolean
Type Method
Description Presses the Cancel button.
Parameters
  • None
Returns
  • The Sheet object.
  • true if successful, otherwise false.
Notes None
Examples None
Source src/extensions/cp/ui/Sheet.lua line 141

# pressDefault

Signature cp.ui.Sheet:pressDefault() -> self, boolean
Type Method
Description Presses the Default button.
Parameters
  • None
Returns
  • The Sheet object.
  • true if successful, otherwise false.
Notes None
Examples None
Source src/extensions/cp/ui/Sheet.lua line 156