A single entry in a MenuBar dropdown or submenu.
More...
#include <Malena/Graphics/Controls/MenuItem.h>
Public Member Functions | |
| bool | hasSubmenu () const |
Static Public Member Functions | |
| static MenuItem | chk (const std::string &label, bool &ref, std::function< void()> onChange={}) |
| Checkable item that toggles a bool reference. | |
| static MenuItem | disabled (const std::string &label) |
| Greyed-out non-interactive label. | |
| static MenuItem | item (const std::string &label, std::function< void()> action={}, const std::string &shortcut="", const sf::Texture *icon=nullptr) |
| Standard clickable item. | |
| static MenuItem | sep () |
| Horizontal divider line. | |
| static MenuItem | sub (const std::string &label, std::vector< MenuItem > items) |
| Item that opens a submenu. | |
Public Attributes | |
| std::function< void()> | action |
| bool | checked = false |
| bool | enabled = true |
| const sf::Texture * | icon = nullptr |
| std::string | label |
| bool | separator = false |
| std::string | shortcut |
| std::vector< MenuItem > | submenu |
A single entry in a MenuBar dropdown or submenu.
Use the static factory helpers for clean construction:
Definition at line 48 of file MenuItem.h.
|
inlinestatic |
Checkable item that toggles a bool reference.
Definition at line 76 of file MenuItem.h.
|
inlinestatic |
Greyed-out non-interactive label.
Definition at line 109 of file MenuItem.h.
|
inlinenodiscard |
Definition at line 117 of file MenuItem.h.
|
inlinestatic |
Standard clickable item.
Definition at line 62 of file MenuItem.h.
|
inlinestatic |
Horizontal divider line.
Definition at line 101 of file MenuItem.h.
|
inlinestatic |
Item that opens a submenu.
Definition at line 91 of file MenuItem.h.
| std::function<void()> ml::MenuItem::action |
Definition at line 56 of file MenuItem.h.
| bool ml::MenuItem::checked = false |
Definition at line 53 of file MenuItem.h.
| bool ml::MenuItem::enabled = true |
Definition at line 54 of file MenuItem.h.
| const sf::Texture* ml::MenuItem::icon = nullptr |
Definition at line 52 of file MenuItem.h.
| std::string ml::MenuItem::label |
Definition at line 50 of file MenuItem.h.
| bool ml::MenuItem::separator = false |
Definition at line 55 of file MenuItem.h.
| std::string ml::MenuItem::shortcut |
Definition at line 51 of file MenuItem.h.
| std::vector<MenuItem> ml::MenuItem::submenu |
Definition at line 57 of file MenuItem.h.