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

Latest commit

 

History

History
109 lines (91 loc) · 8.56 KB

cp.ui.TextField.md

File metadata and controls

109 lines (91 loc) · 8.56 KB

docs » cp.ui.TextField


Text Field Module.

API Overview

API Documentation

Functions

Signature cp.ui.TextField.matches(element[, subrole]) -> boolean
Type Function
Description Checks to see if an element matches what we think it should be.
Parameters
  • element - An axuielementObject to check.
  • subrole - (optional) If provided, the field must have the specified subrole.
Returns
  • true if matches otherwise false

Fields

Signature cp.ui.TextField.value <cp.prop: string>
Type Field
Description The current value of the text field.

Methods

Signature cp.ui.TextField:clear() -> self
Type Method
Description Clears the value of a Text Field.
Parameters
  • None
Returns
  • Self
Signature cp.ui.TextField:doConfirm() -> cp.rx.go.Statement
Type Method
Description A Statement that will confirm the current text value.
Signature cp.ui.TextField:doFocus() -> cp.rx.go.Statement
Type Method
Description A Statement that will attempt to focus on the current TextField.
Signature cp.ui.TextField:forceFocus()
Type Method
Description Configures the TextField to force a focus on the field before editing.
Signature cp.ui.TextField:getValue() -> string
Type Method
Description Gets the value of the Text Field.
Parameters
  • None
Returns
  • The value of the Text Field as a string.
Signature cp.ui.TextField:loadLayout(layout) -> none
Type Method
Description Loads a Text Field layout.
Parameters
  • layout - A table containing the Text Field layout settings - created using cp.ui.TextField:saveLayout().
Returns
  • None
Signature cp.ui.TextField:saveLayout() -> table
Type Method
Description Saves the current Text Field layout to a table.
Parameters
  • None
Returns
  • A table containing the current Text Field Layout.
Signature cp.ui.TextField:setValue(value) -> self
Type Method
Description Sets the value of the Text Field.
Parameters
  • value - The value you want to set the Text Field to as a string.
Returns
  • Self
Signature cp.ui.TextField(parent, uiFinder[, convertFn]) -> TextField
Type Method
Description Creates a new TextField. They have a parent and a finder function.
Parameters
  • parent - The parent object.
  • uiFinder - The function will return the axuielement for the TextField.
  • getConvertFn - (optional) If provided, will be passed the string value when returning.
  • setConvertFn - (optional) If provided, will be passed the number value when setting.
Returns
  • The new TextField.