Menu.pkg 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. $#include "Menu.h"
  2. /// %Menu %UI element that optionally shows a popup.
  3. class Menu : public Button
  4. {
  5. public:
  6. /// Construct.
  7. Menu(Context* context);
  8. /// Destruct.
  9. virtual ~Menu();
  10. /// Set popup element to show on selection.
  11. void SetPopup(UIElement* element);
  12. /// Set popup element offset.
  13. void SetPopupOffset(const IntVector2& offset);
  14. /// Set popup element offset.
  15. void SetPopupOffset(int x, int y);
  16. /// Force the popup to show or hide.
  17. void ShowPopup(bool enable);
  18. /// Set accelerator key (set zero key code to disable.)
  19. void SetAccelerator(int key, int qualifiers);
  20. /// Return popup element.
  21. UIElement* GetPopup() const { return popup_; }
  22. /// Return popup element offset.
  23. const IntVector2& GetPopupOffset() const { return popupOffset_; }
  24. /// Return whether popup is open.
  25. bool GetShowPopup() const { return showPopup_; }
  26. /// Return accelerator key code, 0 if disabled.
  27. int GetAcceleratorKey() const { return acceleratorKey_; }
  28. /// Return accelerator qualifiers.
  29. int GetAcceleratorQualifiers() const { return acceleratorQualifiers_; }
  30. int GetAcceleratorQualifiers() const;
  31. };