aboutsummaryrefslogtreecommitdiff
path: root/guilib/GUIResizeControl.cpp
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2010-01-10 08:27:34 +0000
committerjmarshallnz <jmarshallnz@svn>2010-01-10 08:27:34 +0000
commit9d235728b674404a0d54b06b8a8febcad0bded1c (patch)
tree534d7ff1a47fe80c2c3607996d60437f1b316771 /guilib/GUIResizeControl.cpp
parent2ea674eaca7213df208715f0676c0a0e122ab287 (diff)
improved: Better exclusive control support for mouse dragging of sliders/scroll bars.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@26618 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUIResizeControl.cpp')
-rw-r--r--guilib/GUIResizeControl.cpp30
1 files changed, 17 insertions, 13 deletions
diff --git a/guilib/GUIResizeControl.cpp b/guilib/GUIResizeControl.cpp
index 9849d92ef3..11de2b70be 100644
--- a/guilib/GUIResizeControl.cpp
+++ b/guilib/GUIResizeControl.cpp
@@ -21,7 +21,6 @@
#include "GUIResizeControl.h"
#include "GUIWindowManager.h"
-#include "MouseStat.h"
#include "Key.h"
#include "utils/TimeUtils.h"
@@ -124,19 +123,24 @@ void CGUIResizeControl::OnRight()
Resize(m_fSpeed, 0);
}
-bool CGUIResizeControl::OnMouseDrag(const CPoint &offset, const CPoint &point)
+bool CGUIResizeControl::OnMouseEvent(const CPoint &point, const CMouseEvent &event)
{
- g_Mouse.SetState(MOUSE_STATE_DRAG);
- g_Mouse.SetExclusiveAccess(this, GetParentID(), point);
- Resize(offset.x, offset.y);
- return true;
-}
-
-bool CGUIResizeControl::OnMouseClick(int button, const CPoint &point)
-{
- if (button != MOUSE_LEFT_BUTTON) return false;
- g_Mouse.EndExclusiveAccess(this, GetParentID());
- return true;
+ if (event.m_id == ACTION_MOUSE_DRAG)
+ {
+ if (event.m_state == 1)
+ { // grab exclusive access
+ CGUIMessage msg(GUI_MSG_EXCLUSIVE_MOUSE, GetID(), GetParentID());
+ SendWindowMessage(msg);
+ }
+ else if (event.m_state == 3)
+ { // release exclusive access
+ CGUIMessage msg(GUI_MSG_EXCLUSIVE_MOUSE, 0, GetParentID());
+ SendWindowMessage(msg);
+ }
+ Resize(event.m_offsetX, event.m_offsetY);
+ return true;
+ }
+ return false;
}
void CGUIResizeControl::UpdateSpeed(int nDirection)