#cp.ui.SearchField

A TextField with a subrole of AXSearchField.


#API Overview

Functions - API calls offered directly by the extension

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


#API Documentation

#Functions

Signaturecp.ui.SearchField.matchesSearch(element) -> boolean
TypeFunction
DescriptionChecks 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.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/SearchField.lua line 10

#Methods

Signaturecp.ui.SearchField(parent, uiFinder[, convertFn]) -> cp.ui.SearchField
TypeMethod
DescriptionCreates 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>
ExamplesNone
Sourcesrc/extensions/cp/ui/SearchField.lua line 23