BsGUITabButton.h 1.7 KB

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