BsGUITabButton.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  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, GUITabbedTitleBar* titleBar, CM::UINT32 index, const CM::WString& text, const BS::GUIElementStyle* style = nullptr);
  14. static GUITabButton* create(BS::GUIWidget& parent, const BS::GUILayoutOptions& layoutOptions, GUITabbedTitleBar* titleBar, CM::UINT32 index, const CM::WString& text, const BS::GUIElementStyle* style = nullptr);
  15. CM::UINT32 getIndex() const { return mIndex; }
  16. boost::signal<void(CM::UINT32)> onDragged;
  17. protected:
  18. virtual bool mouseEvent(const BS::GUIMouseEvent& ev);
  19. private:
  20. GUITabbedTitleBar* mTitleBar;
  21. CM::UINT32 mIndex;
  22. CM::Int2 mDragStartPosition;
  23. static const CM::UINT32 DRAG_MIN_DISTANCE;
  24. GUITabButton(BS::GUIWidget& parent, const BS::GUIElementStyle* style, GUITabbedTitleBar* titleBar, CM::UINT32 index, const CM::WString& text, const BS::GUILayoutOptions& layoutOptions);
  25. };
  26. }