Plutonium framework API 0.3.0
UI framework libraries for libnx
Loading...
Searching...
No Matches
pu::ui::elm::MenuItem Class Reference

#include <elm_Menu.hpp>

Public Types

using OnKeyCallback = std::function<void()>
 

Public Member Functions

 MenuItem (const std::string &name)
 
std::string GetName ()
 
void SetName (const std::string &name)
 
void AddOnKey (OnKeyCallback on_key_cb, const u64 key=HidNpadButton_A)
 
u32 GetOnKeyCallbackCount ()
 
OnKeyCallback GetOnKeyCallback (const u32 idx)
 
u64 GetOnKeyCallbackKey (const u32 idx)
 
sdl2::TextureHandle::Ref GetIconTexture ()
 
void SetIcon (sdl2::TextureHandle::Ref icon)
 
bool HasIcon ()
 

Static Public Attributes

static constexpr Color DefaultColor = { 10, 10, 10, 0xFF }
 

Member Typedef Documentation

◆ OnKeyCallback

using pu::ui::elm::MenuItem::OnKeyCallback = std::function<void()>

Constructor & Destructor Documentation

◆ MenuItem()

pu::ui::elm::MenuItem::MenuItem ( const std::string & name)
inline

Member Function Documentation

◆ AddOnKey()

void pu::ui::elm::MenuItem::AddOnKey ( OnKeyCallback on_key_cb,
const u64 key = HidNpadButton_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

◆ 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)

◆ SetName()

void pu::ui::elm::MenuItem::SetName ( const std::string & name)
inline

Member Data Documentation

◆ DefaultColor

Color pu::ui::elm::MenuItem::DefaultColor = { 10, 10, 10, 0xFF }
staticconstexpr

The documentation for this class was generated from the following file: