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

#include <elm_Menu.hpp>

Inheritance diagram for pu::ui::elm::Menu:
pu::ui::elm::Element

Public Types

enum class  MoveStatus : u8 { None = 0 , WaitingUp = 1 , WaitingDown = 2 }
 
using OnSelectionChangedCallback = std::function<void()>
 

Public Member Functions

 Menu (const i32 x, const i32 y, const i32 width, const Color items_clr, const Color items_focus_clr, const i32 items_height, const u32 items_to_show)
 
i32 GetX () override
 
void SetX (const i32 x)
 
i32 GetY () override
 
void SetY (const i32 y)
 
i32 GetWidth () override
 
void SetWidth (const i32 width)
 
i32 GetHeight () override
 
void SetOnSelectionChanged (OnSelectionChangedCallback on_selection_changed_cb)
 
void AddItem (MenuItem::Ref &item)
 
void ClearItems ()
 
void ForceReloadItems ()
 
MenuItem::Ref & GetSelectedItem ()
 
std::vector< MenuItem::Ref > & GetItems ()
 
void SetSelectedIndex (const u32 idx)
 
void OnRender (render::Renderer::Ref &drawer, const i32 x, const i32 y) override
 
void OnInput (const u64 keys_down, const u64 keys_up, const u64 keys_held, const TouchPoint touch_pos) override
 
- Public Member Functions inherited from pu::ui::elm::Element
 Element ()
 
virtual ~Element ()
 
bool IsVisible ()
 
void SetVisible (const bool visible)
 
void SetHorizontalAlign (const HorizontalAlign align)
 
HorizontalAlign GetHorizontalAlign ()
 
void SetVerticalAlign (const VerticalAlign align)
 
VerticalAlign GetVerticalAlign ()
 
void SetParentContainer (Container *parent_container)
 
i32 GetProcessedX ()
 
i32 GetProcessedY ()
 

Static Public Attributes

static constexpr Color DefaultScrollbarColor = { 110, 110, 110, 0xFF }
 
static constexpr u8 DefaultItemAlphaIncrementSteps = 15
 
static constexpr float DefaultIconItemSizesFactor = 0.8f
 
static constexpr u32 DefaultIconMargin = 37
 
static constexpr u32 DefaultTextMargin = 37
 
static constexpr u8 DefaultLightScrollbarColorFactor = 30
 
static constexpr u32 DefaultScrollbarWidth = 30
 
static constexpr u32 DefaultShadowHeight = 7
 
static constexpr u8 DefaultShadowBaseAlpha = 160
 
static constexpr s64 DefaultMoveWaitTimeMs = 150
 

Additional Inherited Members

- Protected Attributes inherited from pu::ui::elm::Element
bool visible
 
HorizontalAlign h_align
 
VerticalAlign v_align
 
Containerparent_container
 

Member Typedef Documentation

◆ OnSelectionChangedCallback

using pu::ui::elm::Menu::OnSelectionChangedCallback = std::function<void()>

Member Enumeration Documentation

◆ MoveStatus

enum class pu::ui::elm::Menu::MoveStatus : u8
strong
Enumerator
None 
WaitingUp 
WaitingDown 

Constructor & Destructor Documentation

◆ Menu()

pu::ui::elm::Menu::Menu ( const i32 x,
const i32 y,
const i32 width,
const Color items_clr,
const Color items_focus_clr,
const i32 items_height,
const u32 items_to_show )

Member Function Documentation

◆ AddItem()

void pu::ui::elm::Menu::AddItem ( MenuItem::Ref & item)
inline

◆ ClearItems()

void pu::ui::elm::Menu::ClearItems ( )

◆ ForceReloadItems()

void pu::ui::elm::Menu::ForceReloadItems ( )
inline

◆ GetHeight()

i32 pu::ui::elm::Menu::GetHeight ( )
inlineoverridevirtual

Implements pu::ui::elm::Element.

◆ GetItems()

std::vector< MenuItem::Ref > & pu::ui::elm::Menu::GetItems ( )
inline

◆ GetSelectedItem()

MenuItem::Ref & pu::ui::elm::Menu::GetSelectedItem ( )
inline

◆ GetWidth()

i32 pu::ui::elm::Menu::GetWidth ( )
inlineoverridevirtual

Implements pu::ui::elm::Element.

◆ GetX()

i32 pu::ui::elm::Menu::GetX ( )
inlineoverridevirtual

Implements pu::ui::elm::Element.

◆ GetY()

i32 pu::ui::elm::Menu::GetY ( )
inlineoverridevirtual

Implements pu::ui::elm::Element.

◆ OnInput()

void pu::ui::elm::Menu::OnInput ( const u64 keys_down,
const u64 keys_up,
const u64 keys_held,
const TouchPoint touch_pos )
overridevirtual

Implements pu::ui::elm::Element.

◆ OnRender()

void pu::ui::elm::Menu::OnRender ( render::Renderer::Ref & drawer,
const i32 x,
const i32 y )
overridevirtual

Implements pu::ui::elm::Element.

◆ SetOnSelectionChanged()

void pu::ui::elm::Menu::SetOnSelectionChanged ( OnSelectionChangedCallback on_selection_changed_cb)
inline

◆ SetSelectedIndex()

void pu::ui::elm::Menu::SetSelectedIndex ( const u32 idx)

◆ SetWidth()

void pu::ui::elm::Menu::SetWidth ( const i32 width)
inline

◆ SetX()

void pu::ui::elm::Menu::SetX ( const i32 x)
inline

◆ SetY()

void pu::ui::elm::Menu::SetY ( const i32 y)
inline

Member Data Documentation

◆ DefaultIconItemSizesFactor

float pu::ui::elm::Menu::DefaultIconItemSizesFactor = 0.8f
staticconstexpr

◆ DefaultIconMargin

u32 pu::ui::elm::Menu::DefaultIconMargin = 37
staticconstexpr

◆ DefaultItemAlphaIncrementSteps

u8 pu::ui::elm::Menu::DefaultItemAlphaIncrementSteps = 15
staticconstexpr

◆ DefaultLightScrollbarColorFactor

u8 pu::ui::elm::Menu::DefaultLightScrollbarColorFactor = 30
staticconstexpr

◆ DefaultMoveWaitTimeMs

s64 pu::ui::elm::Menu::DefaultMoveWaitTimeMs = 150
staticconstexpr

◆ DefaultScrollbarColor

Color pu::ui::elm::Menu::DefaultScrollbarColor = { 110, 110, 110, 0xFF }
staticconstexpr

◆ DefaultScrollbarWidth

u32 pu::ui::elm::Menu::DefaultScrollbarWidth = 30
staticconstexpr

◆ DefaultShadowBaseAlpha

u8 pu::ui::elm::Menu::DefaultShadowBaseAlpha = 160
staticconstexpr

◆ DefaultShadowHeight

u32 pu::ui::elm::Menu::DefaultShadowHeight = 7
staticconstexpr

◆ DefaultTextMargin

u32 pu::ui::elm::Menu::DefaultTextMargin = 37
staticconstexpr

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