# Plutonium framework API: pu::ui::elm::MenuItem Class Reference

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)
Color | GetColor ()
void | SetColor (const Color items_clr)
void | AddOnKey (OnKeyCallback on_key_cb, const u64 key=HidNpadButton_A)
i32 | GetOnKeyCallbackCount ()
OnKeyCallback | GetOnKeyCallback (const i32 idx)
u64 | GetOnKeyCallbackKey (const i32 idx)
std::string | GetIconPath ()
void | SetIcon (const std::string &icon_path)
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`
| ) |  |

## GetColor()

Color pu::ui::elm::MenuItem::GetColor | ( |  | ) |

inline

## GetIconPath()

std::string pu::ui::elm::MenuItem::GetIconPath | ( |  | ) |

inline

## GetName()

std::string pu::ui::elm::MenuItem::GetName | ( |  | ) |

inline

## GetOnKeyCallback()

OnKeyCallback pu::ui::elm::MenuItem::GetOnKeyCallback | ( | const i32 | idx | ) |

inline

## GetOnKeyCallbackCount()

i32 pu::ui::elm::MenuItem::GetOnKeyCallbackCount | ( |  | ) |

inline

## GetOnKeyCallbackKey()

u64 pu::ui::elm::MenuItem::GetOnKeyCallbackKey | ( | const i32 | idx | ) |

inline

## HasIcon()

bool pu::ui::elm::MenuItem::HasIcon | ( |  | ) |

inline

## SetColor()

void pu::ui::elm::MenuItem::SetColor | ( | const Color | items_clr | ) |

inline

## SetIcon()

void pu::ui::elm::MenuItem::SetIcon | ( | const std::string & | icon_path | ) |

## SetName()

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

inline

## Member Data Documentation

## DefaultColor

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

staticconstexpr

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

- Plutonium/include/pu/ui/elm/elm_Menu.hpp