# cp.ui.RadioGroup

Represents an AXRadioGroup, providing utility methods.


# API Overview

Functions - API calls offered directly by the extension

  • matches

Constructors - API calls which return an object, typically one that offers API methods

  • RadioGroup

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

  • optionCount
  • options
  • optionsUI
  • selectedOption

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

  • doNextOption
  • doPreviousOption
  • doSelectOption
  • nextOption
  • previousOption

# API Documentation

# Functions

# matches

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

# Constructors

# RadioGroup

Signature cp.ui.RadioGroup(parent, uiFinder[, createOptionFn]) -> cp.ui.RadioGroup
Type Constructor
Description Creates a new RadioGroup.
Parameters
  • parent - The parent table.
  • uiFinder - The function which will find the axuielement representing the RadioGroup.
  • createOptionFn - If provided a function that receives the RadioGroup and an axuielement for a given option within the group.
Returns
  • The new RadioGroup instance.
Notes None
Examples None
Source src/extensions/cp/ui/RadioGroup.lua line 40

# Fields

# optionCount

Signature cp.ui.RadioGroup.optionCount <cp.prop: number; read-only>
Type Field
Description The number of options in the group.
Notes None
Source src/extensions/cp/ui/RadioGroup.lua line 56

# options

Signature cp.ui.RadioGroup.options <table: cp.ui.Element; read-only>
Type Field
Description A table containing cp.ui.Element available in the radio group.
Returns
  • The cp.prop of options.
Notes None
Source src/extensions/cp/ui/RadioGroup.lua line 81

# optionsUI

Signature cp.ui.RadioGroup.optionsUI <cp.prop: axuielement; read-only>
Type Field
Description A cp.prop containing table of axuielement options available in the radio group.
Returns
  • The cp.prop of options.
Notes None
Source src/extensions/cp/ui/RadioGroup.lua line 68

# selectedOption

Signature cp.ui.RadioGroup.selectedOption <cp.prop: number>
Type Field
Description The currently selected option number.
Notes None
Source src/extensions/cp/ui/RadioGroup.lua line 102

# Methods

# doNextOption

Signature cp.ui.RadioGroup:doNextOption() -> cp.rx.go.Statement<boolean>
Type Method
Description A Statement that selects the next option in the group. Cycles from the last to the first option.
Parameters
  • None
Returns
  • The Statement, that resolves to true if successful or sends an error if not.
Notes None
Examples None
Source src/extensions/cp/ui/RadioGroup.lua line 179

# doPreviousOption

Signature cp.ui.RadioGroup:doPreviousOption() -> cp.rx.go.Statement<boolean>
Type Method
Description A Statement that selects the previous option in the group. Cycles from the first to the last item.
Parameters
  • None
Returns
  • The Statement, which resolves to true if successful or sends an error if not..
Notes None
Examples None
Source src/extensions/cp/ui/RadioGroup.lua line 218

# doSelectOption

Signature cp.ui.RadioGroup:doSelectOption(index) -> cp.rx.go.Statement<boolean>
Type Method
Description A Statement which will attempt to select the option at the specified index.
Parameters
  • index - The index to select. Must be between 1 and optionCount.
Returns
  • The Statement, which will resolve to true if successful or send an error if not.
Notes None
Examples None
Source src/extensions/cp/ui/RadioGroup.lua line 135

# nextOption

Signature cp.ui.RadioGroup:nextOption() -> self
Type Method
Description Selects the next option in the group. Cycles from the last to the first option.
Parameters
  • None
Returns
  • The RadioGroup.
Notes None
Examples None
Source src/extensions/cp/ui/RadioGroup.lua line 160

# previousOption

Signature cp.ui.RadioGroup:previousOption() -> self
Type Method
Description Selects the previous option in the group. Cycles from the first to the last item.
Parameters
  • None
Returns
  • The RadioGroup.
Notes None
Examples None
Source src/extensions/cp/ui/RadioGroup.lua line 199