Represents a menu item.
More...
#include <elm_Menu.hpp>
|
using | OnKeyCallback = std::function<void()> |
| Represents a function called when the specific key is pressed over a the MenuItem.
|
|
◆ OnKeyCallback
Represents a function called when the specific key is pressed over a the MenuItem.
◆ MenuItem()
pu::ui::elm::MenuItem::MenuItem |
( |
const std::string & | name | ) |
|
|
inline |
Creates a new instance of a MenuItem.
- Parameters
-
◆ AddOnKey()
void pu::ui::elm::MenuItem::AddOnKey |
( |
OnKeyCallback | on_key_cb, |
|
|
const u64 | key = HidNpadButton_A ) |
Adds a new OnKeyCallback to the MenuItem.
- Parameters
-
on_key_cb | Function to call when the key is pressed. |
key | Key to call the function on. Default is A. |
◆ GetIconTexture()
sdl2::TextureHandle::Ref pu::ui::elm::MenuItem::GetIconTexture |
( |
| ) |
|
|
inline |
◆ GetName()
std::string pu::ui::elm::MenuItem::GetName |
( |
| ) |
|
|
inline |
◆ GetOnKeyCallback()
OnKeyCallback pu::ui::elm::MenuItem::GetOnKeyCallback |
( |
const u32 | idx | ) |
|
|
inline |
◆ GetOnKeyCallbackCount()
u32 pu::ui::elm::MenuItem::GetOnKeyCallbackCount |
( |
| ) |
|
|
inline |
Gets the amount of OnKeyCallbacks in the MenuItem.
- Returns
- Amount of OnKeyCallbacks in the MenuItem.
◆ GetOnKeyCallbackKey()
u64 pu::ui::elm::MenuItem::GetOnKeyCallbackKey |
( |
const u32 | idx | ) |
|
|
inline |
◆ HasIcon()
bool pu::ui::elm::MenuItem::HasIcon |
( |
| ) |
|
|
inline |
◆ SetIcon()
void pu::ui::elm::MenuItem::SetIcon |
( |
sdl2::TextureHandle::Ref | icon | ) |
|
Sets the icon of the MenuItem.
- Parameters
-
◆ SetName()
void pu::ui::elm::MenuItem::SetName |
( |
const std::string & | name | ) |
|
|
inline |
Sets the name of the MenuItem.
- Parameters
-
◆ DefaultColor
Color pu::ui::elm::MenuItem::DefaultColor = { 10, 10, 10, 0xFF } |
|
staticconstexpr |
The documentation for this class was generated from the following file: