BsGUITabButton.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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(BS::GUIWidget& parent, const BS::GUIToggleGroupPtr& toggleGroup, CM::UINT32 index, const CM::HString& text, const BS::GUIElementStyle* style = nullptr);
  14. static GUITabButton* create(BS::GUIWidget& parent, const BS::GUIToggleGroupPtr& toggleGroup, CM::UINT32 index, const CM::HString& text, const BS::GUIOptions& layoutOptions, const BS::GUIElementStyle* style = nullptr);
  15. static GUITabButton* create(BS::GUIWidget& parent, const BS::GUIToggleGroupPtr& toggleGroup, CM::UINT32 index, const BS::GUIContent& content, const BS::GUIElementStyle* style = nullptr);
  16. static GUITabButton* create(BS::GUIWidget& parent, const BS::GUIToggleGroupPtr& toggleGroup, CM::UINT32 index, const BS::GUIContent& content, const BS::GUIOptions& layoutOptions, const BS::GUIElementStyle* style = nullptr);
  17. CM::UINT32 getIndex() const { return mIndex; }
  18. void _setDraggedState(bool active);
  19. boost::signal<void(CM::UINT32, const CM::Vector2I&)> onDragged;
  20. boost::signal<void(CM::UINT32, const CM::Vector2I&)> onDragEnd;
  21. protected:
  22. virtual bool mouseEvent(const BS::GUIMouseEvent& ev);
  23. private:
  24. CM::UINT32 mIndex;
  25. CM::Vector2I mDragStartPosition;
  26. bool mDraggedState;
  27. BS::GUIButtonState mInactiveState;
  28. static const CM::UINT32 DRAG_MIN_DISTANCE;
  29. GUITabButton(BS::GUIWidget& parent, const BS::GUIElementStyle* style, const BS::GUIToggleGroupPtr& toggleGroup, CM::UINT32 index, const BS::GUIContent& content, const BS::GUILayoutOptions& layoutOptions);
  30. };
  31. }