| 123456789101112131415161718192021222324252627282930313233 |
- $#include "Menu.h"
- /// %Menu %UI element that optionally shows a popup.
- class Menu : public Button
- {
- public:
- /// Construct.
- Menu(Context* context);
- /// Destruct.
- virtual ~Menu();
- /// Set popup element to show on selection.
- void SetPopup(UIElement* element);
- /// Set popup element offset.
- void SetPopupOffset(const IntVector2& offset);
- /// Set popup element offset.
- void SetPopupOffset(int x, int y);
- /// Force the popup to show or hide.
- void ShowPopup(bool enable);
- /// Set accelerator key (set zero key code to disable.)
- void SetAccelerator(int key, int qualifiers);
- /// Return popup element.
- UIElement* GetPopup() const { return popup_; }
- /// Return popup element offset.
- const IntVector2& GetPopupOffset() const { return popupOffset_; }
- /// Return whether popup is open.
- bool GetShowPopup() const { return showPopup_; }
- /// Return accelerator key code, 0 if disabled.
- int GetAcceleratorKey() const { return acceleratorKey_; }
- /// Return accelerator qualifiers.
- int GetAcceleratorQualifiers() const { return acceleratorQualifiers_; }
- int GetAcceleratorQualifiers() const;
- };
|