diff options
Diffstat (limited to 'guilib/GUISelectButtonControl.cpp')
-rw-r--r-- | guilib/GUISelectButtonControl.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/guilib/GUISelectButtonControl.cpp b/guilib/GUISelectButtonControl.cpp index a51d30e6d9..0535ea52be 100644 --- a/guilib/GUISelectButtonControl.cpp +++ b/guilib/GUISelectButtonControl.cpp @@ -22,6 +22,7 @@ #include "GUISelectButtonControl.h" #include "GUIWindowManager.h" #include "utils/CharsetConverter.h" +#include "utils/TimeUtils.h" #include "MouseStat.h" #include "Key.h" @@ -52,7 +53,7 @@ CGUISelectButtonControl::CGUISelectButtonControl(int parentID, int controlID, m_bRightSelected = false; m_bMovedLeft = false; m_bMovedRight = false; - m_dwTicks = 0; + m_ticks = 0; ControlType = GUICONTROL_SELECTBUTTON; } @@ -127,8 +128,8 @@ void CGUISelectButtonControl::Render() // Select current item, if user doesn't // move left or right for 1.5 sec. - DWORD dwTicksSpan = timeGetTime() - m_dwTicks; - if (dwTicksSpan > 1500) + unsigned int ticksSpan = CTimeUtils::GetFrameTime() - m_ticks; + if (ticksSpan > 1500) { // User hasn't moved disable selection mode... m_bShowSelect = false; @@ -198,7 +199,7 @@ bool CGUISelectButtonControl::OnAction(const CAction &action) // Start timer, if user doesn't select an item // or moves left/right. The control will // automatically select the current item. - m_dwTicks = timeGetTime(); + m_ticks = CTimeUtils::GetFrameTime(); return true; } else @@ -289,7 +290,7 @@ void CGUISelectButtonControl::OnLeft() // Reset timer for automatically selecting // the current item. - m_dwTicks = timeGetTime(); + m_ticks = CTimeUtils::GetFrameTime(); // Switch to previous item if (m_vecItems.size() > 0) @@ -315,7 +316,7 @@ void CGUISelectButtonControl::OnRight() // Reset timer for automatically selecting // the current item. - m_dwTicks = timeGetTime(); + m_ticks = CTimeUtils::GetFrameTime(); // Switch to next item if (m_vecItems.size() > 0) @@ -345,7 +346,7 @@ bool CGUISelectButtonControl::OnMouseOver(const CPoint &point) m_bRightSelected = true; } // reset ticks - m_dwTicks = timeGetTime(); + m_ticks = CTimeUtils::GetFrameTime(); return ret; } |