Dragger.h 807 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. GWEN
  3. Copyright (c) 2010 Facepunch Studios
  4. See license in Gwen.h
  5. */
  6. #pragma once
  7. #ifndef GWEN_CONTROLS_DRAGGER_H
  8. #define GWEN_CONTROLS_DRAGGER_H
  9. #include "Gwen/Controls/Base.h"
  10. #include "Gwen/Gwen.h"
  11. #include "Gwen/Skin.h"
  12. namespace Gwen
  13. {
  14. namespace ControlsInternal
  15. {
  16. class GWEN_EXPORT Dragger : public Controls::Base
  17. {
  18. public:
  19. GWEN_CONTROL( Dragger, Controls::Base );
  20. virtual void OnMouseMoved( int x, int y, int deltaX, int deltaY );
  21. virtual void OnMouseClickLeft( int x, int y, bool bDown );
  22. virtual void Render( Skin::Base* skin );
  23. virtual void SetTarget( Controls::Base* pBase ){ m_pTarget = pBase; }
  24. Gwen::Event::Caller onDragged;
  25. protected:
  26. bool m_bDepressed;
  27. Gwen::Point m_HoldPos;
  28. Controls::Base* m_pTarget;
  29. };
  30. }
  31. }
  32. #endif