YSTest  PreAlpha_b380_20130211
The YSLib Test Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
YSLib::Components::InputTimer Class Reference

输入计时器。 More...

#include <ygui.h>

Collaboration diagram for YSLib::Components::InputTimer:

Public Types

enum  HeldStateType { Free = 0, Pressed = 1, Held = 2 }
 输入保持状态。 More...
 
typedef Timers::Duration Duration
 

Public Member Functions

 InputTimer (const Duration &=Timers::TimeSpan(1000U))
 
void Delay (const Duration &d)
 延迟。
 
bool Refresh (HeldStateType &, const Duration &=Timers::TimeSpan(240), const Duration &=Timers::TimeSpan(120))
 重复检测输入接触保持状态。
 
void Reset ()
 复位状态。
 

Private Attributes

Timers::Timer timer
 

Detailed Description

输入计时器。

Warning
非虚析构。
Since
build 300

实现两段延时的持续输入状态计时器。

Definition at line 46 of file ygui.h.

Member Typedef Documentation

Member Enumeration Documentation

输入保持状态。

Enumerator:
Free 
Pressed 
Held 

Definition at line 53 of file ygui.h.

Constructor & Destructor Documentation

InputTimer::InputTimer ( const Duration d = Timers::TimeSpan(1000U))

Definition at line 63 of file ygui.cpp.

Member Function Documentation

void YSLib::Components::InputTimer::Delay ( const Duration d)
inline

延迟。

Since
build 302

Definition at line 70 of file ygui.h.

bool InputTimer::Refresh ( HeldStateType s,
const Duration initial_delay = Timers::TimeSpan(240),
const Duration repeated_delay = Timers::TimeSpan(120) 
)

重复检测输入接触保持状态。

Definition at line 68 of file ygui.cpp.

References YSLib::Activate(), Free, Held, Pressed, YSLib::Timers::Timer::Refresh(), YSLib::Timers::Timer::SetInterval(), timer, and YB_UNLIKELY.

Here is the call graph for this function:

void InputTimer::Reset ( )

复位状态。

Definition at line 101 of file ygui.cpp.

References Deactivate(), YSLib::Timers::Timer::SetInterval(), and timer.

Referenced by YSLib::Components::GUIState::Reset(), and YSLib::Components::GUIState::ResetHeldState().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

Timers::Timer YSLib::Components::InputTimer::timer
private

Definition at line 61 of file ygui.h.

Referenced by Refresh(), and Reset().


The documentation for this class was generated from the following files: