BsGUIDropDownHitBox.h 926 B

1234567891011121314151617181920212223242526272829303132
  1. #pragma once
  2. #include "BsPrerequisites.h"
  3. #include "BsGUIElementContainer.h"
  4. namespace BansheeEngine
  5. {
  6. class GUIDropDownHitBox : public GUIElementContainer
  7. {
  8. public:
  9. static const String& getGUITypeName();
  10. static GUIDropDownHitBox* create(bool captureMouse);
  11. static GUIDropDownHitBox* create(bool captureMouse, const GUIOptions& layoutOptions);
  12. void setBounds(const RectI& bounds) { mBounds.clear(); mBounds.push_back(bounds); }
  13. void setBounds(const Vector<RectI>::type& bounds) { mBounds = bounds; }
  14. Event<void()> onFocusLost;
  15. Event<void()> onFocusGained;
  16. private:
  17. GUIDropDownHitBox(bool captureMouse, const GUILayoutOptions& layoutOptions);
  18. virtual bool commandEvent(const GUICommandEvent& ev);
  19. virtual bool mouseEvent(const GUIMouseEvent& ev);
  20. virtual bool _isInBounds(const Vector2I position) const;
  21. Vector<RectI>::type mBounds;
  22. bool mCaptureMouse;
  23. };
  24. }