YSTest: YSLib::Components::GUIState Class Reference

YSTest PreAlpha_b380_20130211 The YSLib Test Project

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
YSLib::Components::GUIState Class Reference

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

`#include <ygui.h>`

Inheritance diagram for YSLib::Components::GUIState:
[legend]
Collaboration diagram for YSLib::Components::GUIState:
[legend]

## Public Member Functions

| GUIState () ynothrow
bool | IsControlEntered () const ynothrow
Components::IWidget * | GetKeyDownPtr () const ynothrow
Components::IWidget * | GetTouchDownPtr () 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
| 禁止复制构造。
noncopyable & | operator= (const noncopyable &)=delete
| 禁止赋值复制。
| noncopyable ()=default
| `protected` 构造：默认实现。
| ~noncopyable ()=default
| `protected` 析构：默认实现。
Private Member Functions inherited from ystdex::nonmovable
| nonmovable (const nonmovable &)=delete
| 禁止复制构造。
nonmovable & | operator= (const nonmovable &)=delete
| 禁止赋值复制。
| nonmovable ()=default
| `protected` 构造：默认实现。
| ~nonmovable ()=default
| `protected` 析构：默认实现。

## Private Attributes

Components::IWidget * | p_KeyDown
Components::IWidget * | p_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::ResponseKey | ( | Components::KeyEventArgs & | e,
|  | Components::VisualEvent | op
| ) |  |

响应标准按键状态。

Returns
  已被响应（调用了非空事件处理器或参数 Handled 为 true）时为 true 。

Definition at line 244 of file ygui.cpp.

References YSLib::Components::RoutedEventArgs::Bubble, YSLib::Components::RoutedEventArgs::Direct, YSLib::Components::FetchContainerPtr(), YSLib::Components::FetchFocusingPtr(), YSLib::Components::UIEventArgs::GetSender(), YSLib::Components::RoutedEventArgs::Handled, YSLib::Components::IsEnabled(), YSLib::Components::IsVisible(), ResponseKeyBase(), YSLib::Components::UIEventArgs::SetSender(), YSLib::Components::RoutedEventArgs::Strategy, YSLib::Components::RoutedEventArgs::Tunnel, and YAssert.

Here is the call 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::ResponseTouch | ( | Components::TouchEventArgs & | e,
|  | Components::VisualEvent | op
| ) |  |

响应屏幕接触状态。

Returns
  已被响应（调用了非空事件处理器或参数 Handled 为 true）时为 true 。

Definition at line 288 of file ygui.cpp.

References YSLib::Components::RoutedEventArgs::Bubble, ControlLocation, YSLib::Components::RoutedEventArgs::Direct, YSLib::Components::FetchContainerPtr(), YSLib::Components::GetLocationOf(), YSLib::Components::UIEventArgs::GetSender(), YSLib::Components::RoutedEventArgs::Handled, YSLib::Components::IsEnabled(), YSLib::Components::IsVisible(), ResponseTouchBase(), YSLib::Components::UIEventArgs::SetSender(), YSLib::Components::RoutedEventArgs::Strategy, YSLib::Components::RoutedEventArgs::Tunnel, and YAssert.

Here is the call 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:

- ygui.h
- ygui.cpp