# cp.ui.StaticText

Static Text Module.


# API Overview

Functions - API calls offered directly by the extension

  • matches

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

  • value

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

  • clear
  • loadLayout
  • saveLayout
  • StaticText

# API Documentation

# Functions

# matches

Signature cp.ui.StaticText.matches(element) -> boolean
Type Function
Description Checks if the element is a Static Text element.
Parameters
  • element - The axuielement to check.
Returns
  • If true, the element is a Static Text element.
Notes None
Examples None
Source src/extensions/cp/ui/StaticText.lua line 17

# Fields

# value

Signature cp.ui.StaticText.value <cp.prop: anything>
Type Field
Description The current value of the text field.
Notes None
Source src/extensions/cp/ui/StaticText.lua line 67

# Methods

# clear

Signature cp.ui.StaticText:clear() -> self
Type Method
Description Clears the value of a Static Text box.
Parameters
  • None
Returns
  • Self
Notes None
Examples None
Source src/extensions/cp/ui/StaticText.lua line 122

# loadLayout

Signature cp.ui.StaticText:loadLayout(layout) -> none
Type Method
Description Loads a Static Text layout.
Parameters
  • layout - A table containing the Static Text layout settings - created using cp.ui.StaticText:saveLayout().
Returns
  • None
Notes None
Examples None
Source src/extensions/cp/ui/StaticText.lua line 155

# saveLayout

Signature cp.ui.StaticText:saveLayout() -> table
Type Method
Description Saves the current Static Text layout to a table.
Parameters
  • None
Returns
  • A table containing the current Static Text Layout.
Notes None
Examples None
Source src/extensions/cp/ui/StaticText.lua line 140

# StaticText

Signature cp.ui.StaticText(parent, uiFinder[, convertFn]) -> StaticText
Type Method
Description Creates a new StaticText. They have a parent and a finder function.
Parameters
  • parent - The parent object.
  • uiFinder - The function will return the axuielement for the StaticText.
  • convertFn - (optional) If provided, will be passed the string value when returning.
Returns
  • The new StaticText.
Notes
  • Additionally, an optional convert function can be provided, with the following signature:
  • function(textValue) -> anything
  • The value will be passed to the function before being returned, if present. All values passed into value(x) will be converted to a string first via tostring.
  • For example, to have the value be converted into a number, simply use tonumber like this:
  • lua</li><li>local numberField = StaticText(parent, function() return ... end, tonumber)</li><li>
Examples None
Source src/extensions/cp/ui/StaticText.lua line 30