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

图形用户界面公共状态。 More...

#include <ygui.h>

Inheritance diagram for YSLib::Components::GUIState:
Collaboration diagram for YSLib::Components::GUIState:

Public Member Functions

 GUIState () ynothrow
 
bool IsControlEntered () const ynothrow
 
Components::IWidgetGetKeyDownPtr () const ynothrow
 
Components::IWidgetGetTouchDownPtr () const ynothrow
 
void Reset ()
 复位图形用户界面状态。
 
void ResetHeldState (InputTimer::HeldStateType &)
 复位接触保持状态。
 
bool ResponseKeyBase (Components::KeyEventArgs &, Components::VisualEvent)
 响应标准按键状态。
 
bool ResponseTouchBase (Components::TouchEventArgs &, Components::VisualEvent)
 响应标准按键状态。
 
bool ResponseKey (Components::KeyEventArgs &, Components::VisualEvent)
 响应标准按键状态。
 
bool ResponseTouch (Components::TouchEventArgs &, Components::VisualEvent)
 响应屏幕接触状态。
 

Public Attributes

InputTimer::HeldStateType KeyHeldState
 输入接触状态。
 
InputTimer::HeldStateType TouchHeldState
 
Drawing::Vec DraggingOffset
 拖放偏移量。
 
InputTimer HeldTimer
 输入接触保持计时器。
 
Drawing::Point ControlLocation
 
Drawing::Point LastControlLocation
 最近两次的指针设备操作时的控件全局位置(屏幕坐标)。
 
Components::Styles::Palette Colors
 调色板。
 

Private Member Functions

void TryEntering (Components::TouchEventArgs &&)
 
void TryLeaving (Components::TouchEventArgs &&)
 
- Private Member Functions inherited from ystdex::noncopyable
 noncopyable (const noncopyable &)=delete
 禁止复制构造。
 
noncopyableoperator= (const noncopyable &)=delete
 禁止赋值复制。
 
 noncopyable ()=default
 protected 构造:默认实现。
 
 ~noncopyable ()=default
 protected 析构:默认实现。
 
- Private Member Functions inherited from ystdex::nonmovable
 nonmovable (const nonmovable &)=delete
 禁止复制构造。
 
nonmovableoperator= (const nonmovable &)=delete
 禁止赋值复制。
 
 nonmovable ()=default
 protected 构造:默认实现。
 
 ~nonmovable ()=default
 protected 析构:默认实现。
 

Private Attributes

Components::IWidgetp_KeyDown
 
Components::IWidgetp_TouchDown
 
bool control_entered
 记录指针是否在控件内部。
 

Detailed Description

图形用户界面公共状态。

Warning
非虚析构。
Since
build 287

Definition at line 103 of file ygui.h.

Constructor & Destructor Documentation

GUIState::GUIState ( )

Definition at line 119 of file ygui.cpp.

Member Function Documentation

Components::IWidget* YSLib::Components::GUIState::GetKeyDownPtr ( ) const
inline

Definition at line 132 of file ygui.h.

Components::IWidget* YSLib::Components::GUIState::GetTouchDownPtr ( ) const
inline

Definition at line 134 of file ygui.h.

bool YSLib::Components::GUIState::IsControlEntered ( ) const
inline

Definition at line 130 of file ygui.h.

void GUIState::Reset ( )

复位图形用户界面状态。

Note
需要在没有销毁时自动释放焦点的相关控件对象被销毁后立即调用, 以避免处理无效指针。

Definition at line 128 of file ygui.cpp.

References ControlLocation, DraggingOffset, YSLib::Components::InputTimer::Free, HeldTimer, YSLib::Drawing::GBinaryGroup< SPos >::Invalid, KeyHeldState, LastControlLocation, p_KeyDown, p_TouchDown, YSLib::Components::InputTimer::Reset(), TouchHeldState, and yunseq.

Referenced by ShlDS::ShlDS().

Here is the call graph for this function:

Here is the caller graph for this function:

void GUIState::ResetHeldState ( InputTimer::HeldStateType s)

复位接触保持状态。

Definition at line 139 of file ygui.cpp.

References YSLib::Components::InputTimer::Free, HeldTimer, and YSLib::Components::InputTimer::Reset().

Referenced by ResponseKeyBase(), and ResponseTouchBase().

Here is the call graph for this function:

Here is the caller graph for this function:

bool GUIState::ResponseKeyBase ( Components::KeyEventArgs e,
Components::VisualEvent  op 
)

响应标准按键状态。

Note
无视事件路由,直接响应。

Definition at line 166 of file ygui.cpp.

References YSLib::Components::UIEventArgs::GetSender(), YSLib::Components::KeyDown, YSLib::Components::KeyHeld, KeyHeldState, YSLib::Components::KeyUp, p_KeyDown, ResetHeldState(), and YAssert.

Referenced by ResponseKey().

Here is the call graph for this function:

Here is the caller graph for this function:

bool GUIState::ResponseTouchBase ( Components::TouchEventArgs e,
Components::VisualEvent  op 
)

响应标准按键状态。

Note
无视事件路由,直接响应。

Definition at line 200 of file ygui.cpp.

References DraggingOffset, YSLib::Components::UIEventArgs::GetSender(), YSLib::Drawing::GBinaryGroup< SPos >::Invalid, YSLib::Components::LocateForWidget(), p_TouchDown, ResetHeldState(), YSLib::Components::UIEventArgs::SetSender(), YSLib::Components::TouchDown, YSLib::Components::TouchHeld, TouchHeldState, YSLib::Components::TouchUp, TryEntering(), TryLeaving(), and YAssert.

Referenced by ResponseTouch().

Here is the call graph for this function:

Here is the caller graph for this function:

void GUIState::TryEntering ( Components::TouchEventArgs &&  e)
private

Definition at line 146 of file ygui.cpp.

References control_entered.

Referenced by ResponseTouchBase().

Here is the caller graph for this function:

void GUIState::TryLeaving ( Components::TouchEventArgs &&  e)
private

Definition at line 156 of file ygui.cpp.

References control_entered.

Referenced by ResponseTouchBase().

Here is the caller graph for this function:

Member Data Documentation

Components::Styles::Palette YSLib::Components::GUIState::Colors

调色板。

Definition at line 119 of file ygui.h.

bool YSLib::Components::GUIState::control_entered
private

记录指针是否在控件内部。

Definition at line 125 of file ygui.h.

Referenced by TryEntering(), and TryLeaving().

Drawing::Point YSLib::Components::GUIState::ControlLocation

Definition at line 117 of file ygui.h.

Referenced by Reset(), and ResponseTouch().

Drawing::Vec YSLib::Components::GUIState::DraggingOffset

拖放偏移量。

Definition at line 111 of file ygui.h.

Referenced by Reset(), and ResponseTouchBase().

InputTimer YSLib::Components::GUIState::HeldTimer

输入接触保持计时器。

Since
build 300

Definition at line 116 of file ygui.h.

Referenced by Reset(), and ResetHeldState().

InputTimer::HeldStateType YSLib::Components::GUIState::KeyHeldState

输入接触状态。

Since
build 300

Definition at line 110 of file ygui.h.

Referenced by Reset(), and ResponseKeyBase().

Drawing::Point YSLib::Components::GUIState::LastControlLocation

最近两次的指针设备操作时的控件全局位置(屏幕坐标)。

Definition at line 117 of file ygui.h.

Referenced by Reset().

Components::IWidget* YSLib::Components::GUIState::p_KeyDown
private

Definition at line 123 of file ygui.h.

Referenced by Reset(), and ResponseKeyBase().

Components::IWidget* YSLib::Components::GUIState::p_TouchDown
private

Definition at line 124 of file ygui.h.

Referenced by Reset(), and ResponseTouchBase().

InputTimer::HeldStateType YSLib::Components::GUIState::TouchHeldState

Definition at line 110 of file ygui.h.

Referenced by Reset(), and ResponseTouchBase().


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