Jazz2::UI::Windows::MenuRow class

Row of a menu.

Base classes

class Element
Element of the interface.

Constructors, destructors, conversion operators

MenuRow(MenuEntry&& entry) explicit
Creates a new instance.

Public functions

void Run()
Runs the entry, after the menu it's in is closed.
auto IsEntryEnabled() -> bool
Returns true if the entry can be used now.
auto Measure(const Context& context, Vector2f available) -> Vector2f override
Returns the size the element wants, in pixels.
auto MeasureDependsOnAvailable() const -> bool override
Returns false if 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.
auto AcceptsPointer() const -> bool override
Returns true if the element takes the pointer itself.
auto OnPointerDown(const PointerEvent& event) -> bool override
Called when the pointer is pressed over the element, returns true to keep getting it until released.
void OnPointerUp(const PointerEvent& event, bool inside) override
Called when the pointer is released, inside tells whether it's still over the element.
auto YieldsToScroll() const -> bool override
Returns true if a press on the element may become scrolling of the list it's in.

Public variables

MenuEntry Entry
The entry.
bool Highlighted
Whether it's highlighted as the item the keys of the keyboard are at.

Function documentation

Vector2f Jazz2::UI::Windows::MenuRow::Measure(const Context& context, Vector2f available) override

Returns the size the element wants, in pixels.

The available size is what the parent can give, a size without limit is a very large number.

bool Jazz2::UI::Windows::MenuRow::YieldsToScroll() const override

Returns true if a press on the element may become scrolling of the list it's in.

A finger dragged over a button scrolls the list then, the button isn't clicked. Elements that are dragged themselves keep the press.