BsGUITabButton.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIToggle.h"
  4. #include "BsGUIToggleGroup.h"
  5. #include "BsImageSprite.h"
  6. #include "BsEvent.h"
  7. namespace BansheeEngine
  8. {
  9. class GUITabButton : public GUIToggle
  10. {
  11. public:
  12. static const String& getGUITypeName();
  13. static GUITabButton* create(const GUIToggleGroupPtr& toggleGroup, UINT32 index, const HString& text,
  14. const String& styleName = StringUtil::BLANK);
  15. static GUITabButton* create(const GUIToggleGroupPtr& toggleGroup, UINT32 index, const HString& text,
  16. const GUIOptions& layoutOptions, const String& styleName = StringUtil::BLANK);
  17. static GUITabButton* create(const GUIToggleGroupPtr& toggleGroup, UINT32 index, const GUIContent& content,
  18. const String& styleName = StringUtil::BLANK);
  19. static GUITabButton* create(const GUIToggleGroupPtr& toggleGroup, UINT32 index, const GUIContent& content,
  20. const GUIOptions& layoutOptions, const String& styleName = StringUtil::BLANK);
  21. UINT32 getIndex() const { return mIndex; }
  22. void _setDraggedState(bool active);
  23. Event<void(UINT32, const Vector2I&)> onDragged;
  24. Event<void(UINT32, const Vector2I&)> onDragEnd;
  25. protected:
  26. virtual bool mouseEvent(const GUIMouseEvent& ev);
  27. private:
  28. UINT32 mIndex;
  29. Vector2I mDragStartPosition;
  30. bool mDraggedState;
  31. GUIButtonState mInactiveState;
  32. static const UINT32 DRAG_MIN_DISTANCE;
  33. GUITabButton(const String& styleName, const GUIToggleGroupPtr& toggleGroup, UINT32 index, const GUIContent& content, const GUILayoutOptions& layoutOptions);
  34. };
  35. }