12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #ifndef MENU_BUTTON_H
- #define MENU_BUTTON_H
- #include "scene/gui/button.h"
- #include "scene/gui/popup_menu.h"
- class MenuButton : public Button {
- GDCLASS(MenuButton, Button);
- bool clicked;
- bool switch_on_hover;
- bool disable_shortcuts;
- PopupMenu *popup;
- void _unhandled_key_input(Ref<InputEvent> p_event);
- Array _get_items() const;
- void _set_items(const Array &p_items);
- void _gui_input(Ref<InputEvent> p_event);
- protected:
- static void _bind_methods();
- public:
- virtual void pressed();
- PopupMenu *get_popup() const;
- void set_switch_on_hover(bool p_enabled);
- bool is_switch_on_hover();
- void set_disable_shortcuts(bool p_disabled);
- MenuButton();
- ~MenuButton();
- };
- #endif
|