template<class TItem>
ScrollableMenuSection class
Simplifies creation of unified scrollable menu sections.
Base classes
- class MenuSection
- Base class of a menu section.
Constructors, destructors, conversion operators
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
- Generic item in ScrollableMenuSection.
Protected functions
- void EnsureVisibleSelected()
- Makes currently selected item visible in the viewport.
- void OnExecuteSelected() pure virtual
- Called when the selected item should be executed.
- void OnLayoutItem(Canvas* canvas, ListViewItem& item) virtual
- Called when an item layout should be calculated.
-
void OnDrawEmptyText(Canvas* canvas,
std::
int32_t& charOffset) virtual - Called when an information about empty list should be drawn.
-
void OnDrawItem(Canvas* canvas,
ListViewItem& item,
std::
int32_t& charOffset, bool isSelected) pure virtual - Called when an item should be drawn.
- void OnHandleInput() virtual
- Called when input should be handled.
- void OnBackPressed() virtual
- Called when back button is pressed.
- void OnSelectionChanged(ListViewItem& item) virtual
- Called when selected item is changed.
-
void OnTouchUp(std::
int32_t newIndex, Vector2i viewSize, Vector2i touchPos) virtual - Called when a touch event is released.
Protected static variables
-
static std::
int32_t ItemHeight constexpr -
static std::
int32_t TopLine constexpr -
static std::
int32_t BottomLine constexpr