template<class TItem>
Jazz2::UI::Menu::ScrollableMenuSection class

Simplifies creation of unified scrollable menu sections.

Base classes

class MenuSection
Base class of a menu section.

Constructors, destructors, conversion operators

ScrollableMenuSection()

Public functions

auto GetClipRectangle(const Recti& contentBounds) -> Recti override
Allows to override clip rectangle of the middle layer.
void OnShow(IMenuContainer* root) override
Called when the section is shown.
void OnUpdate(float timeMult) override
Called when the section should be updated.
void OnDrawClipped(Canvas* canvas) override
Called when the section should be drawn — the middle clipped layer.
void OnTouchEvent(const TouchEvent& event, Vector2i viewSize) override
Called when a touch event is triggered.

Protected types

struct ListViewItem
Item in ScrollableMenuSection.

Protected functions

void EnsureVisibleSelected()
void OnExecuteSelected() pure virtual
void OnLayoutItem(Canvas* canvas, ListViewItem& item) virtual
void OnDrawEmptyText(Canvas* canvas, std::int32_t& charOffset) virtual
void OnDrawItem(Canvas* canvas, ListViewItem& item, std::int32_t& charOffset, bool isSelected) pure virtual
void OnHandleInput() virtual
void OnBackPressed() virtual
void OnSelectionChanged(ListViewItem& item) virtual
void OnTouchUp(std::int32_t newIndex, Vector2i viewSize, Vector2i touchPos) virtual

Protected static variables

static std::int32_t ItemHeight constexpr
static std::int32_t TopLine constexpr
static std::int32_t BottomLine constexpr