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

Latest commit

 

History

History
132 lines (111 loc) · 10.9 KB

cp.ui.Sheet.md

File metadata and controls

132 lines (111 loc) · 10.9 KB

docs » cp.ui.Sheet


Sheet UI Module.

API Overview

API Documentation

Functions

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

Constructors

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.

Fields

Signature cp.ui.Sheet.cancel <cp.ui.Button>
Type Field
Description The cancel Button for the Sheet.
Signature cp.ui.Sheet.default <cp.ui.Button>
Type Field
Description The default Button for the Sheet.
Signature cp.ui.Sheet.title <cp.prop: string>
Type Field
Description Gets the title of the sheet.

Methods

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.
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.
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.
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.
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.
Signature cp.ui.Sheet:hide() -> none
Type Method
Description Hides the sheet by pressing the "Cancel" button, if it exists.
Parameters
  • None
Returns
  • None
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.
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.