Widget class
#include <Jazz2/UI/Menu/MenuWidgets.h>
Base class of a menu widget.
Building block of the declarative menu layout. A widget draws itself within a given rectangle, advances its animations, and optionally reacts to navigation or touch. Containers such as StackLayout and ScrollView arrange and drive their children, while leaves such as ListItem render content through the shared menu painters.
Derived classes
- class CanvasWidget
- Row drawn entirely by a caller-provided callback.
- class ChoiceItem
- Setting row that cycles through values.
- class CustomValueItem
- Setting row with a custom-drawn value.
- class ListContainer
- Base of vertical lists of selectable children.
- class ListItem
- Selectable text item.
- class Slider
- Setting row with a value bar adjusted left/right.
- class TextInput
- Editable text row.
Constructors, destructors, conversion operators
Public functions
- auto GetHeight() const -> float virtual
- Returns the height the widget occupies in a vertical layout.
- void OnUpdate(float timeMult) virtual
- Advances the widget's animations.
-
void Draw(IMenuContainer* root,
Canvas* canvas,
const Rectf& bounds,
std::
int32_t& charOffset) virtual - Draws the widget within the given bounds.
- auto OnNavigate(const WidgetInput& input, IMenuContainer* root) -> bool virtual
- Handles navigation input; returns
trueif it was consumed. -
auto OnTouchEvent(const nCine::
TouchEvent& event, Vector2i viewSize, IMenuContainer* root) -> bool virtual - Handles a touch event; returns
trueif it was consumed. - void Activate(IMenuContainer* root) virtual
- Called when the widget is activated (e.g., by Fire or a tap).
- void OnSelected() virtual
- Called when the widget becomes selected.
-
auto OnKeyPressed(const nCine::
KeyboardEvent& event, IMenuContainer* root) -> bool virtual - Handles a key press while capturing text input; returns
trueif consumed. -
void OnTextInput(const nCine::
TextInputEvent& event) virtual - Handles a text input event while capturing text input.
- auto IsCapturingInput() const -> bool virtual
- Returns
truewhile the widget (or a descendant) is capturing raw text input, which restricts navigation.