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