Menu Button Module.
Signature |
cp.ui.MenuButton.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
|
Signature |
cp.ui.MenuButton(parent, uiFinder) -> MenuButton |
Type |
Constructor |
Description |
Creates a new MenuButton. |
Parameters |
- parent - The parent object. Should have an
isShowing property. - uiFinder - A
cp.prop or function which will return a hs._asm.axuielement , or nil if it's not available.
|
Signature |
cp.ui.MenuButton.menuUI <cp.prop: hs._asm.axuielement; read-only; live?> |
Type |
Field |
Description |
Returns the AXMenu for the MenuButton if it is currently visible. |
Signature |
cp.ui.MenuButton.title <cp.prop: string; read-only> |
Type |
Field |
Description |
Returns the title for the MenuButton. |
Signature |
cp.ui.MenuButton.value <cp.prop: anything> |
Type |
Field |
Description |
Returns or sets the current MenuButton value. |
Signature |
cp.ui.MenuButton:doPress() -> cp.rx.go.Statement |
Type |
Method |
Description |
A Statement that presses the MenuButton . |
Parameters |
|
Returns |
|
Signature |
cp.ui.MenuButton:doSelectItem(index) -> cp.rx.go.Statement |
Type |
Method |
Description |
A Statement that will select an item on the MenuButton by index. |
Parameters |
- index - The index number of the item to match.
|
Returns |
|
Signature |
cp.ui.MenuButton:doSelectItemMatching(pattern[, altPattern]) -> cp.rx.go.Statement |
Type |
Method |
Description |
A Statement that will select an item on the MenuButton by pattern. |
Parameters |
- pattern - The pattern to match.
- [altPattern] - An optional alternate pattern to match if the first pattern fails.
|
Returns |
|
Signature |
cp.ui.MenuButton:doSelectValue(value) -> cp.rx.go.Statement |
Type |
Method |
Description |
A Statement that will select an item on the MenuButton by value. |
Parameters |
- value - The value of the item to match.
|
Returns |
|
Signature |
cp.ui.MenuButton:doShowMenu() -> cp.rx.go.Statement |
Type |
Method |
Description |
A Statement that presses the MenuButton if the menu is not showing. |
Parameters |
|
Returns |
|
| Signature | cp.ui.MenuButton:getTitle() -> string | nil
|
| -----------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| Type | Method |
| Description | Gets the MenuButton
title. |
| Parameters |
|
| Returns | - The
MenuButton
title as string, or nil
if the title cannot be determined.
|
| Signature | cp.ui.MenuButton:getValue() -> string | nil
|
| -----------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| Type | Method |
| Description | Gets the MenuButton
value. |
| Parameters |
|
| Returns | - The
MenuButton
value as string, or nil
if the value cannot be determined.
|
Signature |
cp.ui.MenuButton:loadLayout(layout) -> none |
Type |
Method |
Description |
Loads a MenuButton layout. |
Parameters |
- layout - A table containing the
MenuButton layout settings - created using saveLayout.
|
Returns |
|
Signature |
cp.ui.MenuButton:press() -> self |
Type |
Method |
Description |
Presses the MenuButton. |
Parameters |
|
Returns |
|
Signature |
cp.ui.MenuButton:saveLayout() -> table |
Type |
Method |
Description |
Saves the current MenuButton layout to a table. |
Parameters |
|
Returns |
- A table containing the current
MenuButton Layout.
|
Signature |
cp.ui.MenuButton:selectItem(index) -> boolean |
Type |
Method |
Description |
Select an item on the MenuButton by index. |
Parameters |
- index - The index of the item you want to select.
|
Returns |
true if successfully selected, otherwise false .
|
Signature |
cp.ui.MenuButton:selectItemMatching(pattern) -> boolean |
Type |
Method |
Description |
Select an item on the MenuButton by pattern. |
Parameters |
- pattern - A pattern used to select the
MenuButton item.
|
Returns |
true if successfully selected, otherwise false .
|
Signature |
cp.ui.MenuButton:setValue(value) -> self |
Type |
Method |
Description |
Sets the MenuButton value. |
Parameters |
- value - The value you want to set the
MenuButton to.
|
Returns |
|
Signature |
cp.ui.MenuButton:show() -> self |
Type |
Method |
Description |
Show's the MenuButton. |
Parameters |
|
Returns |
|