diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-01-10 09:51:44 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-01-10 09:51:44 +0000 |
commit | 6bad1095f41a98b72b9e8e49a2a44ea72508fb7c (patch) | |
tree | e7a6466ececbfa2b445fd976557f9601040e75a4 /guilib/GUISpinControl.cpp | |
parent | 2ebfc8547d04f17a9c21690a4ce49c46d8b4ec48 (diff) |
cleanup: Replaced OnMouseClick/DoubleClick/Wheel/Drag with OnMouseEvent
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@26626 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUISpinControl.cpp')
-rw-r--r-- | guilib/GUISpinControl.cpp | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/guilib/GUISpinControl.cpp b/guilib/GUISpinControl.cpp index dbf3cabb50..a16fca38c0 100644 --- a/guilib/GUISpinControl.cpp +++ b/guilib/GUISpinControl.cpp @@ -21,7 +21,6 @@ #include "GUISpinControl.h" #include "utils/CharsetConverter.h" -#include "MouseStat.h" #include "Key.h" using namespace std; @@ -865,34 +864,25 @@ bool CGUISpinControl::OnMouseOver(const CPoint &point) return CGUIControl::OnMouseOver(point); } -bool CGUISpinControl::OnMouseClick(int button, const CPoint &point) -{ // only left button handled - if (button != MOUSE_LEFT_BUTTON) return false; - if (m_imgspinUpFocus.HitTest(point)) - { - MoveUp(); - } - if (m_imgspinDownFocus.HitTest(point)) +bool CGUISpinControl::OnMouseEvent(const CPoint &point, const CMouseEvent &event) +{ + if (event.m_id == ACTION_MOUSE_LEFT_CLICK) { - MoveDown(); + if (m_imgspinUpFocus.HitTest(point)) + MoveUp(); + else if (m_imgspinDownFocus.HitTest(point)) + MoveDown(); + return true; } - return true; -} - -bool CGUISpinControl::OnMouseWheel(char wheel, const CPoint &point) -{ - for (int i = 0; i < abs(wheel); i++) + else if (event.m_id == ACTION_MOUSE_WHEEL) { - if (wheel > 0) - { + if (event.m_wheel > 0) MoveUp(); - } else - { MoveDown(); - } + return true; } - return true; + return false; } CStdString CGUISpinControl::GetDescription() const |