#cp.ui.RadioGroup

Represents an AXRadioGroup, providing utility methods.


#API Overview

Functions - API calls offered directly by the extension

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

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

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


#API Documentation

#Functions

Signaturecp.ui.RadioGroup.matches(element) -> boolean
TypeFunction
DescriptionChecks if the provided axuielement is a RadioGroup.
Parameters
  • element - The element to check.
Returns
  • true if the element is a RadioGroup.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/RadioGroup.lua line 27

#Constructors

Signaturecp.ui.RadioGroup(parent, uiFinder[, createOptionFn]) -> cp.ui.RadioGroup
TypeConstructor
DescriptionCreates 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.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/RadioGroup.lua line 40

#Fields

Signaturecp.ui.RadioGroup.optionCount <cp.prop: number; read-only>
TypeField
DescriptionThe number of options in the group.
NotesNone
Sourcesrc/extensions/cp/ui/RadioGroup.lua line 56

Signaturecp.ui.RadioGroup.options <table: cp.ui.Element; read-only>
TypeField
DescriptionA table containing cp.ui.Element available in the radio group.
Returns
  • The cp.prop of options.
NotesNone
Sourcesrc/extensions/cp/ui/RadioGroup.lua line 81

Signaturecp.ui.RadioGroup.optionsUI <cp.prop: axuielement; read-only>
TypeField
DescriptionA cp.prop containing table of axuielement options available in the radio group.
Returns
  • The cp.prop of options.
NotesNone
Sourcesrc/extensions/cp/ui/RadioGroup.lua line 68

Signaturecp.ui.RadioGroup.selectedOption <cp.prop: number>
TypeField
DescriptionThe currently selected option number.
NotesNone
Sourcesrc/extensions/cp/ui/RadioGroup.lua line 102

#Methods

Signaturecp.ui.RadioGroup:doNextOption() -> cp.rx.go.Statement<boolean>
TypeMethod
DescriptionA 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.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/RadioGroup.lua line 179

Signaturecp.ui.RadioGroup:doPreviousOption() -> cp.rx.go.Statement<boolean>
TypeMethod
DescriptionA 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..
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/RadioGroup.lua line 218

Signaturecp.ui.RadioGroup:doSelectOption(index) -> cp.rx.go.Statement<boolean>
TypeMethod
DescriptionA 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.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/RadioGroup.lua line 135

Signaturecp.ui.RadioGroup:nextOption() -> self
TypeMethod
DescriptionSelects the next option in the group. Cycles from the last to the first option.
Parameters
  • None
Returns
  • The RadioGroup.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/RadioGroup.lua line 160

Signaturecp.ui.RadioGroup:previousOption() -> self
TypeMethod
DescriptionSelects the previous option in the group. Cycles from the first to the last item.
Parameters
  • None
Returns
  • The RadioGroup.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/RadioGroup.lua line 199