Skip to content
This repository has been archived by the owner on Jun 9, 2023. It is now read-only.

Latest commit

 

History

History
134 lines (113 loc) · 10.7 KB

cp.ui.PopUpButton.md

File metadata and controls

134 lines (113 loc) · 10.7 KB

docs » cp.ui.PopUpButton


Pop Up Button Module.

API Overview

API Documentation

Functions

Signature cp.ui.PopUpButton.matches(element) -> boolean
Type Function
Description Checks to see if an element matches what we think it should be.
Parameters
  • element - An axuielementObject to check.
Returns
  • true if matches otherwise false

Constructors

Signature cp.ui.PopUpButton(parent, uiFinder) -> cp.ui.PopUpButton
Type Constructor
Description Creates a new PopUpButton.
Parameters
  • parent - The parent table. Should have a isShowing property.
  • uiFinder - The function or cp.prop that provides the current hs._asm.axuielement.
Returns
  • The new PopUpButton instance.

Fields

Signature cp.ui.PopUpButton.menuUI <cp.prop: hs._asm.axuielement; read-only; live?>
Type Field
Description Returns the AXMenu for the PopUpMenu if it is currently visible.
Signature cp.ui.PopUpButton.value <cp.prop: anything; live>
Type Field
Description Returns or sets the current PopUpButton value.

Methods

Signature cp.ui.PopUpButton:doPress() -> cp.rx.go.Statement
Type Method
Description A Statement that presses the PopUpButton.
Parameters
  • None
Returns
Signature cp.ui.PopUpButton:doSelectItem(index) -> cp.rx.go.Statement
Type Method
Description A Statement that will select an item on the PopUpButton by index.
Parameters
  • index - The index number of the item you want to select.
Returns
  • the Statement.
Signature cp.ui.PopUpButton:doSelectValue(value) -> cp.rx.go.Statement
Type Method
Description A Statement that will select an item on the PopUpButton by value.
Parameters
  • value - The value of the item to match.
Returns
  • the Statement.

| Signature | cp.ui.PopUpButton:getValue() -> string | nil | | -----------------------------------------------------|---------------------------------------------------------------------------------------------------------| | Type | Method | | Description | Gets the PopUpButton value. | | Parameters |

  • None
| | Returns |
  • The PopUpButton value as string, or nil if the value cannot be determined.
|

Signature cp.ui.PopUpButton:loadLayout(layout) -> none
Type Method
Description Loads a PopUpButton layout.
Parameters
  • layout - A table containing the PopUpButton layout settings - created using saveLayout.
Returns
  • None
Signature cp.ui.PopUpButton:press() -> self
Type Method
Description Presses the PopUpButton.
Parameters
  • None
Returns
  • self
Signature cp.ui.PopUpButton:saveLayout() -> table
Type Method
Description Saves the current PopUpButton layout to a table.
Parameters
  • None
Returns
  • A table containing the current PopUpButton Layout.
Signature cp.ui.PopUpButton:selectItem(index) -> self
Type Method
Description Select an item on the PopUpButton by index.
Parameters
  • index - The index of the item you want to select.
Returns
  • self
Signature cp.ui.PopUpButton:setValue(value) -> self
Type Method
Description Sets the PopUpButton value.
Parameters
  • value - The value you want to set the PopUpButton to.
Returns
  • self