diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-03-25 02:02:06 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-03-25 02:02:06 +0000 |
commit | 44a3d70de84e60ed25c6c15258d01324cfe3377d (patch) | |
tree | 886ea6798d7009593f531208d746098488923a51 /guilib/GUIControlGroup.cpp | |
parent | 002fb7812778df0dc924f5159236a19a052661cf (diff) |
changed: Make On/SendMouseEvent() return an enum rather than true/false.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28796 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUIControlGroup.cpp')
-rw-r--r-- | guilib/GUIControlGroup.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/guilib/GUIControlGroup.cpp b/guilib/GUIControlGroup.cpp index 9399c6d85a..4066b1b4cb 100644 --- a/guilib/GUIControlGroup.cpp +++ b/guilib/GUIControlGroup.cpp @@ -357,7 +357,7 @@ bool CGUIControlGroup::HasAnimation(ANIMATION_TYPE animType) return false; } -bool CGUIControlGroup::SendMouseEvent(const CPoint &point, const CMouseEvent &event) +EVENT_RESULT CGUIControlGroup::SendMouseEvent(const CPoint &point, const CMouseEvent &event) { // transform our position into child coordinates CPoint childPoint(point); @@ -370,17 +370,19 @@ bool CGUIControlGroup::SendMouseEvent(const CPoint &point, const CMouseEvent &ev for (rControls i = m_children.rbegin(); i != m_children.rend(); ++i) { CGUIControl *child = *i; - if (child->SendMouseEvent(childPoint - pos, event)) + EVENT_RESULT ret = child->SendMouseEvent(childPoint - pos, event); + if (ret) { // we've handled the action, and/or have focused an item - return true; + return ret; } } // none of our children want the event, but we may want it. - if (HitTest(childPoint) && OnMouseEvent(childPoint, event)) - return true; + EVENT_RESULT ret; + if (HitTest(childPoint) && (ret = OnMouseEvent(childPoint, event))) + return ret; } m_focusedControl = 0; - return false; + return EVENT_RESULT_UNHANDLED; } void CGUIControlGroup::UnfocusFromPoint(const CPoint &point) |