diff options
Diffstat (limited to 'include/cru/ui/components/PopupButton.h')
-rw-r--r-- | include/cru/ui/components/PopupButton.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/cru/ui/components/PopupButton.h b/include/cru/ui/components/PopupButton.h index 37420ff6..c8ef9c50 100644 --- a/include/cru/ui/components/PopupButton.h +++ b/include/cru/ui/components/PopupButton.h @@ -3,6 +3,7 @@ #include "cru/ui/Base.h" #include "cru/ui/components/Menu.h" #include "cru/ui/controls/Button.h" +#include "cru/ui/controls/IconButton.h" #include "cru/ui/controls/Popup.h" #include "cru/ui/controls/TextBlock.h" @@ -35,4 +36,25 @@ class CRU_UI_API PopupMenuTextButton : public Component { Event<Index> menu_item_selected_event_; }; + +class CRU_UI_API PopupMenuIconButton : public Component { + public: + PopupMenuIconButton(); + ~PopupMenuIconButton() override; + + public: + ui::controls::Control* GetRootControl() override { return &button_; } + + ui::controls::IconButton* GetButton() { return &button_; } + + void SetMenuItems(std::vector<String> items); + + IEvent<Index>* MenuItemSelectedEvent() { return &menu_item_selected_event_; } + + private: + ui::controls::IconButton button_; + PopupMenu popup_menu_; + + Event<Index> menu_item_selected_event_; +}; } // namespace cru::ui::components |