Menu.pkg 1.1 KB

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