BsGUIDockSlider.h 959 B

12345678910111213141516171819202122232425262728293031
  1. #pragma once
  2. #include "BsEditorPrerequisites.h"
  3. #include "BsGUIButtonBase.h"
  4. #include "BsDockManager.h"
  5. #include "boost/signal.hpp"
  6. namespace BansheeEditor
  7. {
  8. class GUIDockSlider : public BS::GUIButtonBase
  9. {
  10. public:
  11. static const CM::String& getGUITypeName();
  12. static GUIDockSlider* create(BS::GUIWidget& parent, bool horizontal, const BS::GUIElementStyle* style = nullptr);
  13. static GUIDockSlider* create(BS::GUIWidget& parent, bool horizontal, const BS::GUIOptions& layoutOptions, const BS::GUIElementStyle* style = nullptr);
  14. boost::signal<void(const CM::Vector2I&)> onDragged;
  15. protected:
  16. virtual bool mouseEvent(const BS::GUIMouseEvent& ev);
  17. private:
  18. CM::Vector2I mLastDragPosition;
  19. bool mHorizontal;
  20. bool mIsMouseOver;
  21. bool mIsCursorSet;
  22. bool mDragInProgress;
  23. GUIDockSlider(BS::GUIWidget& parent, bool horizontal, const BS::GUIElementStyle* style, const BS::GUILayoutOptions& layoutOptions);
  24. };
  25. }