Class evab::ListBox¶
template <class TWindowAlgorithm>
List box element with configurable windowing algorithm. More...
#include <evabListBox.h>
Inherits the following classes: evab::ElementBase, TWindowAlgorithm
Public Functions¶
| Type | Name |
|---|---|
| ElementBase * | GetItem (unsigned char aIndex) Gets an item by index. |
| void | Increment (signed char delta) Increments the selection by a delta. |
| ListBox (unsigned char aItemHeight) |
|
| ListBox (unsigned char aItemHeight, ElementBase *(&) aItems) |
|
| virtual bool | OnKey (Keys aKey) override Handles key events, forwarding to selected item. |
| void | Select (unsigned char aIndex) override Selects an item by index. |
| void | SetItemHeight (unsigned char aItemHeight) Sets the height of each item. |
| void | SetItems (ElementBase *(&) aItems) Sets the list of items to display. |
| void | SetItemsPtr (ElementBase * aItems, unsigned char aSize) |
Public Functions inherited from evab::ElementBase¶
| Type | Name |
|---|---|
| void | Draw (Screen * aScreen, Coor aPos, Coor aSize, unsigned char aIsFocused) Draws the element on the specified screen. |
| void | Freeze () Make element insensitive to redraw method. |
| virtual bool | OnKey (Keys aKey) Handles key events for the element. |
Protected Functions¶
| Type | Name |
|---|---|
| virtual void | drawer (Screen * aScreen, Coor aPos, Coor aSize, unsigned char aIsFocused) override Draws the list box. |
| virtual void | freezer () override Hides all items. |
Protected Functions inherited from evab::ElementBase¶
| Type | Name |
|---|---|
| virtual void | drawer (Screen * aScreen, Coor aPos, Coor aSize, unsigned char aIsFocused) = 0 Pure virtual method for drawing the element. |
| virtual void | freezer () Virtual method for freezing the element. |
| bool | isFrozen () Checks if the element is currently freezed. |
| void | redraw () Redraws the element on the current screen. |
Detailed Description¶
Displays a scrollable list of items with navigation support.
Template parameters:
TWindowAlgorithmWindowing algorithm for navigation (Flip/Scroll)
Public Functions Documentation¶
function GetItem¶
Gets an item by index.
inline ElementBase * evab::ListBox::GetItem (
unsigned char aIndex
)
Parameters:
aIndexIndex of the item
Returns:
Pointer to the item, or nullptr if invalid
function Increment¶
Increments the selection by a delta.
inline void evab::ListBox::Increment (
signed char delta
)
Parameters:
deltaAmount to increment (positive or negative)
function ListBox [1/2]¶
inline evab::ListBox::ListBox (
unsigned char aItemHeight
)
function ListBox [2/2]¶
template<int N>
inline evab::ListBox::ListBox (
unsigned char aItemHeight,
ElementBase *(&) aItems
)
function OnKey¶
Handles key events, forwarding to selected item.
inline virtual bool evab::ListBox::OnKey (
Keys aKey
) override
Parameters:
aKeyKey code to process
Returns:
true if the key was handled
Implements evab::ElementBase::OnKey
function Select¶
Selects an item by index.
inline void evab::ListBox::Select (
unsigned char aIndex
) override
Parameters:
aIndexIndex to select
function SetItemHeight¶
Sets the height of each item.
inline void evab::ListBox::SetItemHeight (
unsigned char aItemHeight
)
Parameters:
aItemHeightHeight in tiles
Returns:
Reference to this list box
function SetItems¶
Sets the list of items to display.
template<int N>
inline void evab::ListBox::SetItems (
ElementBase *(&) aItems
)
Parameters:
aItemsArray of element pointers
Returns:
Reference to this list box
function SetItemsPtr¶
inline void evab::ListBox::SetItemsPtr (
ElementBase * aItems,
unsigned char aSize
)
Protected Functions Documentation¶
function drawer¶
Draws the list box.
inline virtual void evab::ListBox::drawer (
Screen * aScreen,
Coor aPos,
Coor aSize,
unsigned char aIsFocused
) override
Parameters:
aScreenScreen to draw onaPosPosition on screenaSizeSize of the elementaIsFocusedFocus state (1 = focused, 0 = not focused)
Implements evab::ElementBase::drawer
function freezer¶
Hides all items.
inline virtual void evab::ListBox::freezer () override
Implements evab::ElementBase::freezer
The documentation for this class was generated from the following file src/evabListBox.h