Browse files

change CGUIControl::GetNextAction to more general CGUIControl::GetNav…

…igationAction
  • Loading branch information...
1 parent fbe0667 commit a5c77d902c5a834a54aa9506f268a47ced361dc2 @pieh committed Oct 31, 2011
Showing with 17 additions and 9 deletions.
  1. +12 −7 xbmc/guilib/GUIControl.cpp
  2. +1 −1 xbmc/guilib/GUIControl.h
  3. +4 −1 xbmc/guilib/GUIWindow.cpp
View
19 xbmc/guilib/GUIControl.cpp
@@ -890,22 +890,27 @@ bool CGUIControl::IsAnimating(ANIMATION_TYPE animType)
return false;
}
-int CGUIControl::GetNextControl(int direction) const
+bool CGUIControl::GetNavigationAction(int direction, CGUIAction& action) const
{
switch (direction)
{
case ACTION_MOVE_UP:
- return m_actionUp.GetNavigation();
+ action = m_actionUp;
+ return true;
case ACTION_MOVE_DOWN:
- return m_actionDown.GetNavigation();
+ action = m_actionDown;
+ return true;
case ACTION_MOVE_LEFT:
- return m_actionLeft.GetNavigation();
+ action = m_actionLeft;
+ return true;
case ACTION_MOVE_RIGHT:
- return m_actionRight.GetNavigation();
+ action = m_actionRight;
+ return true;
case ACTION_NAV_BACK:
- return m_actionBack.GetNavigation();
+ action = m_actionBack;
+ return true;
default:
- return -1;
+ return false;
}
}
View
2 xbmc/guilib/GUIControl.h
@@ -199,7 +199,7 @@ class CGUIControl
int GetControlIdLeft() const { return m_actionLeft.GetNavigation(); };
int GetControlIdRight() const { return m_actionRight.GetNavigation(); };
int GetControlIdBack() const { return m_actionBack.GetNavigation(); };
- virtual int GetNextControl(int direction) const;
+ bool GetNavigationAction(int direction, CGUIAction& action) const;
virtual void SetFocus(bool focus);
virtual void SetWidth(float width);
virtual void SetHeight(float height);
View
5 xbmc/guilib/GUIWindow.cpp
@@ -833,7 +833,10 @@ bool CGUIWindow::OnMove(int fromControl, int moveAction)
while (control)
{ // grab the next control direction
moveHistory.push_back(nextControl);
- nextControl = control->GetNextControl(moveAction);
+ CGUIAction action;
+ if (!control->GetNavigationAction(moveAction, action))
+ return false;
+ nextControl = action.GetNavigation();
// check our history - if the nextControl is in it, we can't focus it
for (unsigned int i = 0; i < moveHistory.size(); i++)
{

0 comments on commit a5c77d9

Please sign in to comment.