#cp.ui.GridElement

Abstract base class for AX elements which form a grid, such as GridElement and Outline.


#Submodules


#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.GridElement.matches(element) -> boolean
TypeFunction
DescriptionChecks if the element is an GridElement.
Parameters
  • element - An element to check
Returns
  • A boolean
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 96

Signaturecp.ui.GridElement:withColumnsOf(columnInit) -> cp.ui.GridElement.Builder
TypeFunction
DescriptionReturns a new Builder for GridElements with the specified columnInit.
Parameters
  • columnInit - A Column initializer.
Returns
  • A new Builder for GridElements.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 86

Signaturecp.ui.GridElement:withHeaderOf(headerInit) -> cp.ui.GridElement.Builder
TypeFunction
DescriptionReturns a new Builder for GridElements with the specified headerInit.
Parameters
  • headerInit - A Header initializer.
Returns
  • A new Builder for GridElements.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 66

Signaturecp.ui.GridElement:withRowsOf(...) -> function(parent, uiFinder) -> GridElement
TypeFunction
DescriptionA combinator that returns a function expecting a parent and uiFinder and returns a GridElement instance, with the arguments defining the Cell instances that make up the rows of the table.
Parameters
  • ... - One or more arguments to pass to the constructor.
Returns
  • A function that will return a new GridElement instance.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 115

#Constructors

Signaturecp.ui.GridElement(parent, uiFinder, headerInit, rowInit, columnInit) -> cp.ui.GridElement
TypeConstructor
DescriptionCreates a new GridElement instance.
Parameters
  • parent - The parent Element instance.
  • uiFinder - A hs.uielement or axuielementObject that will be used to find this element.
  • headerInit - An initializer function that will be called to create the header Element instance.
  • rowInit - An initializer function that will be called to create each row element.
  • columnInit - An initializer function that will be called to create each column element.
Returns
  • A new GridElement instance.
Notes
  • The headerType, rowType arguments are optional.
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 131

#Fields

Signaturecp.ui.GridElement.columns <table of cp.ui.Column; live?; read-only>
TypeField
DescriptionThe list of Columns which are children of this GridElement.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 260

Signaturecp.ui.GridElement.columnsUI <cp.prop: table of axuielement; live?; read-only>
TypeField
DescriptionThe list of axuielements which are children of this GridElement.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 253

Signaturecp.ui.GridElement.firstRow <cp.ui.Element>
TypeField
DescriptionAn Element of the rowInit type that will always point at the first row (if available).
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 181

Signaturecp.ui.GridElement.header <cp.ui.Element>
TypeField
DescriptionThe Element representing the AXHeader of the GridElement.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 167

Signaturecp.ui.GridElement.headerUI <cp.prop: axuielement; read-only; live>
TypeField
DescriptionReturns the header UI element.
Parameters
  • None
Returns
  • The header UI element.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 154

Signaturecp.ui.GridElement.lastRow <cp.ui.Element>
TypeField
DescriptionAn Element of the rowInit type that will always point at the last row (if available).
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 193

Signaturecp.ui.GridElement.rowsUI <cp.prop: table of axuielement; live?; read-only>
TypeField
DescriptionThe list of Rows which are children of this GridElement.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 174

Signaturecp.ui.GridElement.selectedColumns <table of cp.ui.Column; live?; read-only>
TypeField
DescriptionThe list of Columns which are selected in this GridElement.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 274

Signaturecp.ui.GridElement.selectedColumnsUI <cp.prop: table of axuielement; live?>
TypeField
DescriptionThe list of axuielement AXColumns which are selected in this GridElement.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 267

Signaturecp.ui.GridElement.selectedRows <table of cp.ui.Row; live?; read-only>
TypeField
DescriptionThe list of Rows which are selected in this GridElement.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 232

Signaturecp.ui.GridElement.selectedRowsUI <cp.prop: table of cp.ui.Row; live?>
TypeField
DescriptionThe list of Rows which are selected in this GridElement.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 223

Signaturecp.ui.GridElement.visibleColumns <table of cp.ui.Column; live?; read-only>
TypeField
DescriptionThe list of Columns which are visible in this GridElement.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 288

Signaturecp.ui.GridElement.visibleColumnsUI <cp.prop: table of axuielement; live?; read-only>
TypeField
DescriptionThe list of Columns which are visible in this GridElement.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 281

Signaturecp.ui.GridElement.visibleRows <table of cp.ui.Row; live?; read-only>
TypeField
DescriptionThe list of Rows which are visible in this GridElement.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 246

Signaturecp.ui.GridElement.visibleRowsUI <cp.prop: table of cp.ui.Row; live?; read-only>
TypeField
DescriptionThe list of Rows which are visible in this GridElement.
NotesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 239

#Methods

Signaturecp.ui.GridElement:doSelectRow(path) -> [Statement](cp.rx.go.Statement.md)
TypeMethod
DescriptionSelects the row at the sub-level named in the path table.
Parameters
  • path - A table of names to navigate through to find the Row to select.
Returns
  • The selected Row, or nil if not found.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 452

Signaturecp.ui.GridElement:fetchColumn(columnsUI) -> table of cp.ui.Columns
TypeMethod
DescriptionReturns a table of the same length as columnsUI. If provided items in the table are not valid columns in this table, then nil will be put in the matching index. Note that this will break the standard #/looping behaviour for tables at that point.
Parameters
  • columnsUI - The list of AXColumn axuielements to find.
Returns
  • A table with the same number of elements, containing the matching Column instances.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 308

Signaturecp.ui.GridElement:findCell(rowNumber, columnId) -> hs.axuielement | nil
TypeMethod
DescriptionFinds a specific Cell.
Parameters
  • rowNumber - The row number.
  • columnId - The Column ID.
Returns
  • A hs.axuielement object for the cell, or nil if the cell cannot be found.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 376

Signaturecp.ui.GridElement:findColumnIndex(id) -> number | nil
TypeMethod
DescriptionFinds the Column Index based on an AXIdentifier ID.
Parameters
  • id - The AXIdentifier of the column index you want to find.
Returns
  • A column index as a number, or nil if no index can be found.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 355

Signaturecp.ui.GridElement:row(index) -> cp.ui.Element | nil
TypeMethod
DescriptionReturns an Element at the specified index.
Parameters
  • index - The index of the Element to return.
Returns
  • The Element at the specified index.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 205

Signaturecp.ui.GridElement:selectRow(row) -> nil
TypeMethod
DescriptionAttempts to select the provided cp.ui.Row.
Parameters
  • row - The cp.ui.Row to select.
Returns
  • nil
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 421

Signaturecp.ui.GridElement:selectRowAt(path) -> cp.ui.Row
TypeMethod
DescriptionSelects the row at the sub-level named in the path table.
Parameters
  • path - A table of names to navigate through to find the Row to select.
Returns
  • The selected Row, or nil if not found.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 439

Signaturecp.ui.GridElement:selectRows(rows) -> nil
TypeMethod
DescriptionAttempts to select the provided list of cp.ui.Rows.
Parameters
  • rows - The list of cp.ui.Rows to select.
Returns
  • nil
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 395

Signaturecp.ui.GridElement:visitRow(path, actionFn) -> cp.ui.Row
TypeMethod
DescriptionVisits the row at the sub-level named in the names table, and executes the actionFn.
Parameters
  • names - The array of names to navigate down
  • actionFn - A function to execute when the target row is found.
Returns
  • The row that was visited, or nil if not.
NotesNone
ExamplesNone
Sourcesrc/extensions/cp/ui/GridElement.lua line 341