3 Copyright 2007 Antoine Chavasse <a.chavasse@gmail.com>
5 This file is part of Fail.
7 Fail is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3
9 as published by the Free Software Foundation.
11 Fail is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef FAIL_GUI_GAME_DRAGGABLE_H_
20 #define FAIL_GUI_GAME_DRAGGABLE_H_
22 #include "core/core.h"
23 #include "gui/game/guigame_export.h"
24 #include "Container.h"
28 namespace fail
{ namespace gui
{ namespace game
30 class FLGUIGAME_EXPORT Draggable
: public Widget
40 Draggable( Container
* pParent_
);
42 const e_State
& getState() const { return m_State
; }
43 void setState( const e_State
& x
) { m_State
= x
; }
45 virtual void mouseEnter( const math::Vector2f
& pos
);
46 virtual void mouseExit();
47 virtual bool mouseMotionEvent( const math::Vector2f
& pos
, const math::Vector2f
& rel
);
48 virtual bool mouseButtonEvent( const math::Vector2f
& pos
, e_MouseButton Button
, bool bPressed
);
50 Signal
< math::Vector2f
, math::Vector2f
> m_Dragging
;
54 math::Vector2f m_Offset
;