# cp.ui.SearchField

A TextField with a subrole of AXSearchField.


# API Overview

Functions - API calls offered directly by the extension

  • matchesSearch

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

  • SearchField

# API Documentation

# Functions

# matchesSearch

Signature cp.ui.SearchField.matchesSearch(element) -> boolean
Type Function
Description Checks to see if an element is a AXTextField with a subrole of AXSearchField.
Parameters
  • element - An axuielementObject to check.
Returns
  • true if matches, otherwise false.
Notes None
Examples None
Source src/extensions/cp/ui/SearchField.lua line 10

# Methods

# SearchField

Signature cp.ui.SearchField(parent, uiFinder[, convertFn]) -> cp.ui.SearchField
Type Method
Description Creates a new SearchField. They have a parent and a finder function.
Parameters
  • parent - The parent object.
  • uiFinder - The function will return the axuielement for the SearchField.
  • convertFn - (optional) If provided, will be passed the string value when returning.
Returns
  • The new SearchField.
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 = SearchField(parent, function() return ... end, tonumber)</li><li>
Examples None
Source src/extensions/cp/ui/SearchField.lua line 23