# cp.ui.ComboBox

Combo Box Module.


# API Overview

Functions - API calls offered directly by the extension

  • matches

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

  • ComboBox

# API Documentation

# Functions

# matches

Signature cp.ui.ComboBox.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
Notes None
Examples None
Source src/extensions/cp/ui/ComboBox.lua line 18

# Methods

# ComboBox

Signature cp.ui.ComboBox(parent, uiFinder, listAdaptorFn [, getConvertFn[, setConvertFn]]) -> ComboBox
Type Method
Description Creates a new ComboBox. They have a parent and a finder function.
Parameters
  • parent - The parent object.
  • uiFinder - The function will return the axuielement for the ComboBox.
  • listAdaptorFn - A function that will recieve a List and AXUIElement value and return an Element
  • 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 ComboBox.
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 = ComboBox(parent, function() return ... end, tonumber, tostring)</li><li>
Examples None
Source src/extensions/cp/ui/ComboBox.lua line 57