| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- #pragma once
- #include "BsPrerequisites.h"
- #include "BsGUIMenu.h"
- namespace BansheeEngine
- {
- /**
- * @brief Manages display and logic for a context menu.
- * Context menus can be opened anywhere within the GUI
- * and can contain a hierarchy of menu items.
- */
- class BS_EXPORT GUIContextMenu : public GUIMenu
- {
- public:
- GUIContextMenu();
- ~GUIContextMenu();
- /**
- * @brief Opens a context menu at the specified position relative
- * to the provided widget.
- */
- void open(const Vector2I& position, GUIWidget& widget);
- private:
- /**
- * @brief Closes the context menu if open.
- */
- void close();
- /**
- * @brief Called when the context menu is closed externally
- * (e.g. when user selects an item or clicks outside it).
- */
- void onMenuClosed();
- private:
- bool mContextMenuOpen;
- };
- }
|