MenuBarItem class
#include <Jazz2/UI/Windows/Menu.h>
Item of the menu bar, opens its menu.
Base classes
- class Element
- Element of the interface.
Constructors, destructors, conversion operators
- MenuBarItem(MenuBar* bar, StringView label, Function<void(SmallVectorImpl<MenuEntry>&)>&& builder)
- Creates a new instance, the builder fills the menu when it's opened.
Public functions
- void Open(bool fromKeyboard = false)
- Opens the menu,
fromKeyboardhighlights its first item. -
auto GetMnemonicIndex() const -> std::
int32_t - Returns the index of the letter of the label that opens the menu with
Alt, or -1. - auto Measure(const Context& context, Vector2f available) -> Vector2f override
- Returns the size the element wants, in pixels.
- auto MeasureDependsOnAvailable() const -> bool override
- Returns
falseif what Measure() returns doesn't depend on the available size, it's measured once a frame then. - void Draw(Painter& painter) override
- Draws the element and its children.
- void Update(float timeMult) override
- Advances animations of the element and its children.
- auto AcceptsPointer() const -> bool override
- Returns
trueif the element takes the pointer itself. - auto OnPointerDown(const PointerEvent& event) -> bool override
- Called when the pointer is pressed over the element, returns
trueto keep getting it until released.