Class: MenuItemBase

ui.MenuItemBase

Element representing the base class for menu items.

Properties:
Name Type Description
selected bool

[readonly] Whether the menu item is currently selected.

highlighted bool

[readonly] Whether the menu item is currently highlighted (not necessarily selected).

menu fengshui.Template

(default: null) A template for a submenu.

menuOpened bool

[readonly] Whether the submenu is currently opened.

Extends

Methods

closeMenu ()

Closes the submenu.

hasSiblingMenuOpen ()bool

Returns whether one of the sibling menu items has a submenu opened.

Returns:
Type Description
bool Whether a sibling menu item has a submenu opened.

selectItem (activate)

Selects this menu item.

Name Type Description
activate bool

Whether the item should be activated to open its submenu.

showMenu ()

Shows the submenu if there is one.

toSibling (direction, f)

Directs a function to the previous or next sibling.

Name Type Description
direction number

If -1, targets the previous sibling. If 1, targets the next sibling.

f function

The function to execute. Takes the sibling instance as parameter.

unselectSiblings ()

Unselects all sibling menu items.