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

Namespaces

namespace  EventMapping
 事件映射命名空间。
 
namespace  Styles
 

Classes

class  Thumb
 基本按钮。 More...
 
class  Button
 按钮。 More...
 
class  ListBox
 带滚动条的文本列表框。 More...
 
class  FileBox
 文件列表框。 More...
 
class  DropDownList
 下拉列表。 More...
 
class  Console
 控制台。 More...
 
class  MLabel
 标签模块。 More...
 
class  Label
 标签。 More...
 
class  MTextList
 文本列表模块。 More...
 
class  Menu
 文本菜单。 More...
 
class  MenuHost
 菜单宿主。 More...
 
class  ProgressBar
 进度条。 More...
 
struct  ScrollEventArgs
 滚动事件参数类。 More...
 
class  ATrack
 轨道。 More...
 
class  HorizontalTrack
 水平轨道。 More...
 
class  VerticalTrack
 竖直轨道。 More...
 
class  AScrollBar
 滚动条。 More...
 
class  HorizontalScrollBar
 水平滚动条。 More...
 
class  VerticalScrollBar
 竖直滚动条。 More...
 
class  ScrollableContainer
 带滚动条的容器。 More...
 
class  CheckBox
 复选框。 More...
 
class  CheckButton
 复选按钮。 More...
 
class  TextArea
 文本区域。 More...
 
class  BufferedTextArea
 缓冲文本区域。 More...
 
class  TextList
 文本列表。 More...
 
class  DialogBox
 对话框。 More...
 
class  DialogPanel
 对话面板。 More...
 
class  GSequenceViewer
 序列视图类模板。 More...
 
class  SolidBrush
 单色画刷。 More...
 
class  ImageBrush
 图像画刷。 More...
 
class  BorderStyle
 边框样式。 More...
 
class  BorderBrush
 边框画刷。 More...
 
class  Controller
 部件控制器。 More...
 
class  Control
 控件。 More...
 
class  Desktop
 桌面。 More...
 
class  InputTimer
 输入计时器。 More...
 
class  GUIState
 图形用户界面公共状态。 More...
 
class  Panel
 面板。 More...
 
class  Renderer
 部件渲染器。 More...
 
class  BufferedRenderer
 带缓冲的部件渲染器。 More...
 
class  MUIContainer
 部件容器模块。 More...
 
struct  UIEventArgs
 用户界面事件参数基类。 More...
 
struct  RoutedEventArgs
 路由事件参数基类。 More...
 
struct  InputEventArgs
 输入事件参数类。 More...
 
struct  KeyEventArgs
 按键输入事件参数类。 More...
 
struct  TouchEventArgs
 指针设备输入事件参数类。 More...
 
struct  GValueEventArgs
 简单事件参数类。 More...
 
struct  PaintEventArgs
 部件绘制参数。 More...
 
struct  EventTypeMapping
 
struct  EventTypeMapping< Move >
 
struct  EventTypeMapping< Resize >
 
struct  EventTypeMapping< KeyUp >
 
struct  EventTypeMapping< KeyDown >
 
struct  EventTypeMapping< KeyHeld >
 
struct  EventTypeMapping< KeyPress >
 
struct  EventTypeMapping< TouchUp >
 
struct  EventTypeMapping< TouchDown >
 
struct  EventTypeMapping< TouchHeld >
 
struct  EventTypeMapping< TouchMove >
 
struct  EventTypeMapping< Click >
 
struct  EventTypeMapping< Paint >
 
struct  EventTypeMapping< GotFocus >
 
struct  EventTypeMapping< LostFocus >
 
struct  EventTypeMapping< Enter >
 
struct  EventTypeMapping< Leave >
 
struct  BadEvent
 错误或不存在的部件事件异常。 More...
 
class  AController
 控制器抽象类。 More...
 
class  WidgetController
 部件控制器。 More...
 
class  MOriented
 方向模块。 More...
 
class  Visual
 可视状态。 More...
 
class  View
 部件视图。 More...
 
struct  IWidget
 部件接口。 More...
 
class  Widget
 部件。 More...
 
class  Window
 窗口。 More...
 

Typedefs

typedef Window Form
 
typedef GHEvent< void(ScrollEventArgs)> HScrollEvent
 
typedef GValueEventArgs
< MTextList::IndexType
IndexEventArgs
 索引事件。
 
typedef GHEvent< void(IndexEventArgs)> HIndexEvent
 
typedef std::function< void(PaintEventArgs &&)> HBrush
 画刷回调函数。
 
typedef u8 ZOrderType
 
typedef Drawing::Point MScreenPositionEventArgs
 屏幕(指针设备)输入事件参数模块类。
 
typedef GHEvent< void(UIEventArgs &&)> HUIEvent
 
typedef GHEvent< void(InputEventArgs &&)> HInputEvent
 
typedef GHEvent< void(KeyEventArgs &&)> HKeyEvent
 
typedef GHEvent< void(TouchEventArgs &&)> HTouchEvent
 
typedef GHEvent< void(PaintEventArgs &&)> HPaintEvent
 
typedef EventMapping::MapType VisualEventMap
 
typedef
ystdex::any_input_iterator
< IWidget
WidgetIterator
 通用部件迭代器。
 
typedef pair< WidgetIterator,
WidgetIterator
WidgetRange
 两个部件迭代器组成的左闭右开区间确定的迭代器范围。
 

Enumerations

enum  TextAlignment
 
enum  ScrollCategory
 滚动类别。 More...
 
enum  VisualEvent {
  Move, Resize, KeyUp, KeyDown,
  KeyHeld, KeyPress, TouchUp, TouchDown,
  TouchHeld, TouchMove, Click, Paint,
  GotFocus, LostFocus, Enter, Leave
}
 标准控件事件空间。 More...
 

Functions

YF_API void DrawThumbBackground (PaintEventArgs &&e, Thumb &, Hue)
 绘制指定色调的基本按钮背景。
 
YF_API void DecorateAsCloseButton (Thumb &)
 装饰 Thumb 为关闭按钮。
 
const ZOrderType DefaultMenuZOrder (224)
 默认菜单 Z 顺序值。
 
YF_API void LocateMenu (Menu &, const Menu &, Menu::IndexType)
 定位菜单:以第二个参数作为参考父菜单,按指定参考偏移索引定位菜单。
 
YF_API void DrawTrackBackground (PaintEventArgs &&e, ATrack &)
 绘制指定色调的基本按钮背景。
 
YF_API void ResizeForContent (TextList &)
 根据文本内容调整文本列表大小。
 
bool IsEnabled (const IWidget &wgt)
 判断部件是否为可用的控件。
 
void SetEnabledOf (IWidget &wgt, bool b)
 设置部件可用性。
 
YF_API bool Enable (IWidget &, bool=true)
 设置部件可用性,且当可用性改变时无效化部件区域。
 
template<VisualEvent _vID>
EventMapping::MappedType NewEvent ()
 构造指针指向的 VisualEvent 指定的事件对象。
 
YF_API EventMapping::ItemTypeGetEvent (EventMapping::MapType &, const VisualEvent &, EventMapping::MappedType(&)())
 在事件映射表中取指定 id 对应的事件。
 
template<VisualEvent _vID>
GEvent< void(typename
EventTypeMapping< _vID >
::HandlerType::EventArgsType)> & 
FetchEvent (VisualEventMap &m)
 取控件事件。
 
template<VisualEvent _vID>
GEvent< void(typename
EventTypeMapping< _vID >
::HandlerType::EventArgsType)> & 
FetchEvent (AController &controller)
 取部件事件。
 
template<VisualEvent _vID>
GEvent< void(typename
EventTypeMapping< _vID >
::HandlerType::EventArgsType)> & 
FetchEvent (IWidget &wgt)
 取部件事件。
 
template<VisualEvent _vID, typename _tEventArgs >
size_t CallEvent (IWidget &wgt, _tEventArgs &&e)
 调用部件事件,并忽略 BadControl 异常。
 
template<VisualEvent _vID, class _tEventArgs >
void OnEvent_Call (_tEventArgs &&e)
 处理事件:直接转发至发送者。
 
template<class _tEventArgs >
void OnEvent_StopRouting (_tEventArgs &&e)
 
YF_API void OnKeyHeld (KeyEventArgs &&)
 处理键接触保持事件。
 
YF_API void OnTouchDown_RequestToTopFocused (TouchEventArgs &&)
 处理屏幕接触开始事件:使用一般接触策略。
 
YF_API void OnTouchHeld (TouchEventArgs &&)
 处理屏幕接触保持事件。
 
YF_API void OnTouchMove (TouchEventArgs &&)
 处理屏幕接触移动事件。
 
YF_API void OnTouchMove_Dragging (TouchEventArgs &&)
 处理屏幕接触移动事件。
 
YF_API void OnKey_Bound_TouchUpAndLeave (KeyEventArgs &&)
 处理按键事件:按键-指针设备接触结束。
 
YF_API void OnKey_Bound_EnterAndTouchDown (KeyEventArgs &&)
 处理按键事件:按键-指针设备接触开始。
 
YF_API void OnKey_Bound_Click (KeyEventArgs &&)
 处理按键事件:按键-指针设备按下。
 
YF_API bool IsFocused (const IWidget &)
 判断部件是否取得焦点。
 
YF_API bool DoRequestFocus (IWidget &, bool release_event=false)
 向部件容器请求获得焦点,并指定 GotFocus 事件发送控件。
 
YF_API bool DoReleaseFocus (IWidget &)
 释放焦点,并指定 LostFocus 事件发送控件。
 
YF_API void RequestFocusFrom (IWidget &dst, IWidget &src)
 向部件容器请求获得焦点,并指定 GotFocus 事件发送控件。
 
YF_API void ReleaseFocusFrom (IWidget &dst, IWidget &src)
 释放焦点,并指定 LostFocus 事件发送控件。
 
void RequestFocus (IWidget &wgt)
 向部件容器释放获得焦点,成功后向自身发送 GotFocus 事件。
 
void ReleaseFocus (IWidget &wgt)
 释放焦点,成功后向自身发送 LostFocus 事件。
 
YF_API void ClearFocusingOf (IWidget &)
 清除焦点指针,同时以此部件作为事件源,调用被清除焦点部件的 LostFocus 事件。
 
YF_API void RequestFocusCascade (IWidget &)
 级联请求部件及上层容器焦点。
 
YF_API void ReleaseFocusCascade (IWidget &)
 级联释放部件及上层容器焦点。
 
YF_API bool RepeatHeld (InputTimer &, InputTimer::HeldStateType &, const Timers::Duration &, const Timers::Duration &)
 向指定计时器传递参数,根据状态重复按键。
 
YF_API GUIStateFetchGUIState ()
 取默认图形用户界面公共状态。
 
bool IsFocusedByShell (const IWidget &wgt, const GUIState &st=FetchGUIState())
 
YF_API IWidgetFetchTopLevel (IWidget &)
 取指定部件的顶层部件。
 
YF_API IWidgetFetchTopLevel (IWidget &, Point &)
 取指定部件的顶层部件,当返回非第一参数时变换坐标。
 
YF_API Point LocateOffset (const IWidget *pEnd, Point, const IWidget *pWgt)
 取相对于 pWgt 指向的部件的点 pt 相对于 pEnd 指向的容器的偏移坐标。
 
Point LocateContainerOffset (const IWidget &wgt, const Point &pt)
 取相对部件 wgt 的点 pt 相对于 wgt 的容器的偏移坐标。
 
YF_API Point LocateForWidget (IWidget &a, IWidget &b)
 取指定部件 b 相对于部件 a 的偏移坐标。
 
template<class _tWidget , typename _fFetcher >
Point LocateForWidgetNode (IWidget &wgt, _fFetcher fetch_ptr)
 取指定部件相对于视图树中的直接节点指针的偏移坐标。
 
YF_API Point LocateForParentContainer (const IWidget &)
 取指定部件相对于容器的父容器的偏移坐标。
 
YF_API void MoveToLeft (IWidget &wgt)
 移动部件 wgt 至容器左端。
 
YF_API void MoveToRight (IWidget &wgt)
 移动部件 wgt 至容器右端。
 
YF_API void MoveToTop (IWidget &wgt)
 移动部件 wgt 至容器上端。
 
YF_API void MoveToBottom (IWidget &wgt)
 移动部件 wgt 至容器下端。
 
const ZOrderType DefaultZOrder (64)
 默认 Z 顺序值。
 
const ZOrderType DefaultWindowZOrder (128)
 默认窗口 Z 顺序值。
 
template<class _tContainer , class... _tWidgets>
void AddWidgets (_tContainer &con, _tWidgets &...wgts)
 向部件容器添加子部件。
 
template<class _tContainer , class... _tWidgets>
void AddWidgetsZ (_tContainer &con, ZOrderType z, _tWidgets &...wgts)
 向部件容器添加指定 Z 顺序的子部件。
 
template<class _tContainer , class... _tWidgets>
void RemoveWidgets (_tContainer &con, _tWidgets &...wgts)
 从部件容器移除子部件。
 
template<class _tEventHandler >
size_t DoEvent (AController &controller, const VisualEvent &id, typename _tEventHandler::EventArgsType &&e)
 
template<class _tEventHandler >
size_t DoEvent (AController &controller, const VisualEvent &id, typename _tEventHandler::EventArgsType &e)
 
bool IsVisible (const IWidget &wgt)
 判断部件是否可见。
 
bool YF_API Contains (const IWidget &, SPos, SPos)
 判断点是否在部件的可视区域内。
 
bool Contains (const IWidget &wgt, const Point &pt)
 判断点是否在部件的可视区域内。
 
bool YF_API ContainsVisible (const IWidget &wgt, SPos x, SPos y)
 判断点是否在可见部件的可视区域内。
 
bool ContainsVisible (const IWidget &wgt, const Point &pt)
 判断点是否在可见部件的可视区域内。
 
IWidgetFetchContainerPtr (const IWidget &wgt)
 取部件的容器指针。
 
IWidgetFetchFocusingPtr (IWidget &wgt)
 取焦点对象指针。
 
const PointGetLocationOf (const IWidget &wgt)
 取部件位置。
 
const SizeGetSizeOf (const IWidget &wgt)
 取部件大小。
 
Rect GetBoundsOf (const IWidget &wgt)
 取部件边界。
 
YF_API void SetBoundsOf (IWidget &, const Rect &)
 设置部件边界。
 
void SetContainerPtrOf (IWidget &wgt, IWidget *pCon={})
 设置部件的容器指针。
 
YF_API void SetInvalidationOf (IWidget &)
 设置部件的无效区域。
 
YF_API void SetInvalidationToParent (IWidget &)
 在容器设置部件的无效区域。
 
YF_API void SetLocationOf (IWidget &, const Point &)
 设置部件左上角所在位置(相对于容器的偏移坐标)。
 
YF_API void SetSizeOf (IWidget &, const Size &)
 
void SetVisibleOf (IWidget &wgt, bool b)
 设置部件可见性。
 
YF_API void Close (IWidget &)
 关闭部件。
 
YF_API void DrawArrow (PaintEventArgs &&, IWidget &, SDst=4, Drawing::Rotation=Drawing::RDeg0, Drawing::Color=Drawing::ColorSpace::Black)
 在指定部件中心画箭头。
 
YF_API void Hide (IWidget &)
 隐藏部件。
 
YF_API void Invalidate (IWidget &)
 无效化:使部件区域在直接和间接的窗口缓冲区中无效。
 
YF_API void Invalidate (IWidget &, const Rect &)
 无效化:使相对于部件的指定区域在直接和间接的窗口缓冲区中无效。
 
YF_API void PaintChild (IWidget &wgt, PaintEventArgs &&e)
 
YF_API Rect PaintChild (IWidget &wgt, const PaintContext &pc)
 
YF_API void RequestToTop (IWidget &)
 请求提升至容器顶端。
 
YF_API void Show (IWidget &)
 显示部件。
 
yconstexpr EventPriority BackgroundPriority (0xC0)
 用户界面绘制优先级。
 
yconstexpr EventPriority BoundaryPriority (0x60)
 
yconstexpr EventPriority ForegroundPriority (0x40)
 

Typedef Documentation

Definition at line 37 of file form.h.

typedef std::function<void(PaintEventArgs&&)> YSLib::Components::HBrush

画刷回调函数。

Since
build 293

Definition at line 68 of file ycomp.h.

Definition at line 45 of file textlist.h.

Definition at line 229 of file ywgtevt.h.

Definition at line 230 of file ywgtevt.h.

Definition at line 232 of file ywgtevt.h.

Definition at line 115 of file scroll.h.

Definition at line 231 of file ywgtevt.h.

Definition at line 228 of file ywgtevt.h.

索引事件。

Since
build 268

Definition at line 44 of file textlist.h.

屏幕(指针设备)输入事件参数模块类。

Warning
非虚析构。
Since
build 160

Definition at line 113 of file ywgtevt.h.

通用部件迭代器。

Since
build 356

Definition at line 44 of file ywidget.h.

两个部件迭代器组成的左闭右开区间确定的迭代器范围。

Since
build 357

Definition at line 49 of file ywidget.h.

Definition at line 143 of file yuicont.h.

Enumeration Type Documentation

滚动类别。

Since
build 261

Definition at line 46 of file scroll.h.

Definition at line 41 of file label.h.

标准控件事件空间。

Since
build 192
Enumerator:
Move 

移动:位置调整。

Resize 

大小调整。

KeyUp 

键接触结束。

KeyDown 

键接触开始。

KeyHeld 

键接触保持。

KeyPress 

键按下。

TouchUp 

屏幕接触结束。

TouchDown 

屏幕接触开始。

TouchHeld 

屏幕接触保持。

TouchMove 

屏幕接触移动。

Click 

屏幕点击。

Paint 

界面绘制。

GotFocus 

焦点获得。

LostFocus 

焦点失去。

Enter 

控件进入。

Leave 

控件离开。

Definition at line 249 of file ywgtevt.h.

Function Documentation

template<class _tContainer , class... _tWidgets>
void YSLib::Components::AddWidgets ( _tContainer &  con,
_tWidgets &...  wgts 
)
inline

向部件容器添加子部件。

Note
不保证顺序。
Since
build 303

Definition at line 242 of file yuicont.h.

References ystdex::unseq_apply().

Referenced by ColorBox::ColorBox(), YSLib::Components::DialogPanel::DialogPanel(), ShlTextReader::Execute(), FrmAbout::FrmAbout(), lblOperations(), main(), ShlExplorer::ShlExplorer(), and smooth_scroll_duration().

Here is the call graph for this function:

Here is the caller graph for this function:

template<class _tContainer , class... _tWidgets>
void YSLib::Components::AddWidgetsZ ( _tContainer &  con,
ZOrderType  z,
_tWidgets &...  wgts 
)
inline

向部件容器添加指定 Z 顺序的子部件。

Note
不保证顺序。
Since
build 303

Definition at line 256 of file yuicont.h.

References ystdex::unseq_apply().

Referenced by ShlExplorer::ShlExplorer().

Here is the call graph for this function:

Here is the caller graph for this function:

yconstexpr EventPriority YSLib::Components::BackgroundPriority ( 0xC0  )

用户界面绘制优先级。

Since
build 294

Referenced by YSLib::Components::DialogBox::DialogBox(), YSLib::Components::DialogPanel::DialogPanel(), and YSLib::Components::Widget::InitializeEvents().

Here is the caller graph for this function:

yconstexpr EventPriority YSLib::Components::BoundaryPriority ( 0x60  )

Referenced by ColorBox::ColorBox().

Here is the caller graph for this function:

template<VisualEvent _vID, typename _tEventArgs >
size_t YSLib::Components::CallEvent ( IWidget &  wgt,
_tEventArgs &&  e 
)
inline

调用部件事件,并忽略 BadControl 异常。

Note
需要确保 EventTypeMapping 中有对应的 EventType ,否则无法匹配此函数模板。
若控件事件不存在则忽略。

Definition at line 183 of file ycontrol.h.

References YSLib::Components::IWidget::GetController(), and yforward.

Here is the call graph for this function:

YF_API void YSLib::Components::ClearFocusingOf ( IWidget &  )

清除焦点指针,同时以此部件作为事件源,调用被清除焦点部件的 LostFocus 事件。

Note
若此部件非容器则无效。
Since
build 258
YF_API void YSLib::Components::Close ( IWidget &  )

关闭部件。

Since
build 275

隐藏部件后取消容器(若存在)焦点状态。

Referenced by YSLib::Components::DialogPanel::DialogPanel(), and YSLib::Components::Control::OnTouch_Close().

Here is the caller graph for this function:

bool YF_API YSLib::Components::Contains ( const IWidget &  ,
SPos  ,
SPos   
)

判断点是否在部件的可视区域内。

Since
build 167
bool YSLib::Components::Contains ( const IWidget &  wgt,
const Point &  pt 
)
inline

判断点是否在部件的可视区域内。

Since
build 167

Definition at line 100 of file ywidget.h.

References Contains(), YSLib::Drawing::GBinaryGroup< _type >::X, and YSLib::Drawing::GBinaryGroup< _type >::Y.

Here is the call graph for this function:

bool YF_API YSLib::Components::ContainsVisible ( const IWidget &  wgt,
SPos  x,
SPos  y 
)

判断点是否在可见部件的可视区域内。

Since
build 173
bool YSLib::Components::ContainsVisible ( const IWidget &  wgt,
const Point &  pt 
)
inline

判断点是否在可见部件的可视区域内。

Since
build 173

Definition at line 116 of file ywidget.h.

References ContainsVisible(), YSLib::Drawing::GBinaryGroup< _type >::X, and YSLib::Drawing::GBinaryGroup< _type >::Y.

Here is the call graph for this function:

YF_API void YSLib::Components::DecorateAsCloseButton ( Thumb &  )

装饰 Thumb 为关闭按钮。

Since
build 302

在指定 Thumb 上增加 Click 事件响应:关闭父容器;增加 Paint 事件响应:绘制“×”。

Referenced by YSLib::Components::DialogPanel::DialogPanel().

Here is the caller graph for this function:

const ZOrderType YSLib::Components::DefaultMenuZOrder ( 224  )

默认菜单 Z 顺序值。

const ZOrderType YSLib::Components::DefaultWindowZOrder ( 128  )

默认窗口 Z 顺序值。

Since
build 212

Referenced by ShlExplorer::ShlExplorer().

Here is the caller graph for this function:

const ZOrderType YSLib::Components::DefaultZOrder ( 64  )

默认 Z 顺序值。

Since
build 212
template<class _tEventHandler >
size_t YSLib::Components::DoEvent ( AController &  controller,
const VisualEvent &  id,
typename _tEventHandler::EventArgsType &&  e 
)

Definition at line 395 of file ywgtevt.h.

References EventT.

template<class _tEventHandler >
size_t YSLib::Components::DoEvent ( AController &  controller,
const VisualEvent &  id,
typename _tEventHandler::EventArgsType &  e 
)
inline

Definition at line 411 of file ywgtevt.h.

YF_API bool YSLib::Components::DoReleaseFocus ( IWidget &  )

释放焦点,并指定 LostFocus 事件发送控件。

Returns
是否成功。
Since
build 315
YF_API bool YSLib::Components::DoRequestFocus ( IWidget &  ,
bool  release_event = false 
)

向部件容器请求获得焦点,并指定 GotFocus 事件发送控件。

Parameters
release_event是否在需要释放已有焦点时触发事件。
Returns
是否成功。
Since
build 315
YF_API void YSLib::Components::DrawArrow ( PaintEventArgs &&  ,
IWidget &  ,
SDst  = 4,
Drawing::Rotation  = Drawing::RDeg0,
Drawing::Color  = Drawing::ColorSpace::Black 
)

在指定部件中心画箭头。

Since
build 302

Referenced by YSLib::Components::DropDownList::Refresh().

Here is the caller graph for this function:

YF_API void YSLib::Components::DrawThumbBackground ( PaintEventArgs &&  e,
Thumb &  ,
Hue   
)

绘制指定色调的基本按钮背景。

Since
build 302
YF_API void YSLib::Components::DrawTrackBackground ( PaintEventArgs &&  e,
ATrack &   
)

绘制指定色调的基本按钮背景。

Since
build 359
YF_API bool YSLib::Components::Enable ( IWidget &  ,
bool  = true 
)

设置部件可用性,且当可用性改变时无效化部件区域。

Returns
可用性是否改变。
Since
build 286
YF_API GUIState& YSLib::Components::FetchGUIState ( )

取默认图形用户界面公共状态。

Since
build 287
Bug:
线程安全性依赖于非并发地首次调用。

Definition at line 337 of file ygui.cpp.

Referenced by DecorateAsCloseButton(), InputManager::DispatchInput(), YSLib::Components::Menu::DrawItem(), DrawTrackBackground(), main(), ShlTextReader::OnKeyDown(), OnKeyHeld(), OnTouchHeld(), OnTouchMove(), OnTouchMove_Dragging(), YSL_BEGIN::RectDrawButton(), YSLib::Components::Button::Refresh(), and ShlDS::ShlDS().

Here is the caller graph for this function:

YF_API IWidget& YSLib::Components::FetchTopLevel ( IWidget &  )

取指定部件的顶层部件。

Returns
若无父部件则为参数自身,否则为视图树中的父部件指针为空指针的部件的引用。
Since
build 282
YF_API IWidget& YSLib::Components::FetchTopLevel ( IWidget &  ,
Point &   
)

取指定部件的顶层部件,当返回非第一参数时变换坐标。

Returns
若无父部件则为第一参数,否则为视图树中的父部件指针为空指针的部件的引用。
Note
原始坐标相对于指定部件,会被转换为相对于最终节点的坐标。
Since
build 282
yconstexpr EventPriority YSLib::Components::ForegroundPriority ( 0x40  )
Rect YSLib::Components::GetBoundsOf ( const IWidget &  wgt)
inline

取部件边界。

Since
build 190

Definition at line 173 of file ywidget.h.

References GetLocationOf(), and GetSizeOf().

Referenced by Contains(), SetInvalidationToParent(), YSLib::Components::Widget::SetView(), and YSLib::Components::Desktop::Validate().

Here is the call graph for this function:

Here is the caller graph for this function:

YF_API EventMapping::ItemType& YSLib::Components::GetEvent ( EventMapping::MapType &  ,
const VisualEvent &  ,
EventMapping::  MappedType&)( 
)

在事件映射表中取指定 id 对应的事件。

YF_API void YSLib::Components::Hide ( IWidget &  )

隐藏部件。

Since
build 229 依次释放部件焦点、设置部件不可见性和无效化。
YF_API void YSLib::Components::Invalidate ( IWidget &  ,
const Rect &   
)

无效化:使相对于部件的指定区域在直接和间接的窗口缓冲区中无效。

Since
build 268
bool YSLib::Components::IsEnabled ( const IWidget &  wgt)
inline

判断部件是否为可用的控件。

Definition at line 77 of file ycontrol.h.

Referenced by DecorateAsCloseButton(), DrawThumbBackground(), Enable(), YSLib::Components::Button::Refresh(), YSLib::Components::GUIState::ResponseKey(), and YSLib::Components::GUIState::ResponseTouch().

Here is the caller graph for this function:

YF_API bool YSLib::Components::IsFocused ( const IWidget &  )

判断部件是否取得焦点。

Referenced by YSLib::Components::BorderBrush::operator()().

Here is the caller graph for this function:

bool YSLib::Components::IsFocusedByShell ( const IWidget &  wgt,
const GUIState &  st = FetchGUIState() 
)
inline

Definition at line 203 of file ygui.h.

Referenced by YSLib::Components::CheckBox::PaintBox().

Here is the caller graph for this function:

bool YSLib::Components::IsVisible ( const IWidget &  wgt)
inline
Point YSLib::Components::LocateContainerOffset ( const IWidget &  wgt,
const Point &  pt 
)
inline

取相对部件 wgt 的点 pt 相对于 wgt 的容器的偏移坐标。

Since
build 167

Definition at line 67 of file yuicont.h.

References GetLocationOf().

Referenced by LocateForParentContainer().

Here is the call graph for this function:

Here is the caller graph for this function:

YF_API Point YSLib::Components::LocateForParentContainer ( const IWidget &  )

取指定部件相对于容器的父容器的偏移坐标。

Note
若无容器则返回 Point::Invalid
Since
build 167
YF_API Point YSLib::Components::LocateForWidget ( IWidget &  a,
IWidget &  b 
)

取指定部件 b 相对于部件 a 的偏移坐标。

Since
build 169

Referenced by YSLib::Components::GUIState::ResponseTouchBase().

Here is the caller graph for this function:

template<class _tWidget , typename _fFetcher >
Point YSLib::Components::LocateForWidgetNode ( IWidget &  wgt,
_fFetcher  fetch_ptr 
)

取指定部件相对于视图树中的直接节点指针的偏移坐标。

Template Parameters
_Node节点类型。
_fFetcher节点访问器类型。
Since
build 227

Definition at line 87 of file yuicont.h.

References LocateOffset(), and YB_LIKELY.

Here is the call graph for this function:

YF_API void YSLib::Components::LocateMenu ( Menu &  ,
const Menu &  ,
Menu::IndexType   
)

定位菜单:以第二个参数作为参考父菜单,按指定参考偏移索引定位菜单。

YF_API Point YSLib::Components::LocateOffset ( const IWidget *  pEnd,
Point  ,
const IWidget *  pWgt 
)

取相对于 pWgt 指向的部件的点 pt 相对于 pEnd 指向的容器的偏移坐标。

Since
build 229
YF_API void YSLib::Components::MoveToBottom ( IWidget &  wgt)

移动部件 wgt 至容器下端。

Precondition
断言: FetchContainerPtr(wgt) 。
Since
build 171

Referenced by YSLib::Components::ScrollableContainer::FixLayout().

Here is the caller graph for this function:

YF_API void YSLib::Components::MoveToLeft ( IWidget &  wgt)

移动部件 wgt 至容器左端。

Precondition
断言: FetchContainerPtr(wgt) 。
Since
build 171
YF_API void YSLib::Components::MoveToRight ( IWidget &  wgt)

移动部件 wgt 至容器右端。

Precondition
断言: FetchContainerPtr(wgt) 。
Since
build 171

Referenced by YSLib::Components::ScrollableContainer::FixLayout().

Here is the caller graph for this function:

YF_API void YSLib::Components::MoveToTop ( IWidget &  wgt)

移动部件 wgt 至容器上端。

Precondition
断言: FetchContainerPtr(wgt) 。
Since
build 171
template<VisualEvent _vID>
EventMapping::MappedType YSLib::Components::NewEvent ( )

构造指针指向的 VisualEvent 指定的事件对象。

Definition at line 116 of file ycontrol.h.

References EventT.

template<VisualEvent _vID, class _tEventArgs >
void YSLib::Components::OnEvent_Call ( _tEventArgs &&  e)
inline

处理事件:直接转发至发送者。

Template Parameters
_vID指定转发的目标事件。
_tEventArgs事件参数类型。
Warning
不应使用于自身以免无限递归。
Since
build 300

Definition at line 212 of file ycontrol.h.

template<class _tEventArgs >
void YSLib::Components::OnEvent_StopRouting ( _tEventArgs &&  e)
inline

Definition at line 223 of file ycontrol.h.

YF_API void YSLib::Components::OnKey_Bound_Click ( KeyEventArgs &&  )

处理按键事件:按键-指针设备按下。

绑定触发 Click 事件。

Note
仅对 Control 及其派生类有效。
YF_API void YSLib::Components::OnKey_Bound_EnterAndTouchDown ( KeyEventArgs &&  )

处理按键事件:按键-指针设备接触开始。

绑定触发 Enter 和 TouchDown 事件。

Note
仅对 Control 及其派生类有效。
YF_API void YSLib::Components::OnKey_Bound_TouchUpAndLeave ( KeyEventArgs &&  )

处理按键事件:按键-指针设备接触结束。

绑定触发 TouchUp 和 Leave 事件。

Note
仅对 Control 及其派生类有效。
YF_API void YSLib::Components::OnKeyHeld ( KeyEventArgs &&  )

处理键接触保持事件。

YF_API void YSLib::Components::OnTouchDown_RequestToTopFocused ( TouchEventArgs &&  )

处理屏幕接触开始事件:使用一般接触策略。

屏幕接触时依次进行以下判断: 当事件路由策略非 RoutedEventArgs::Bubble 时请求置于顶端; 当事件路由策略为 RoutedEventArgs::Direct 时清除自身包含的焦点; 当事件路由策略非 RoutedEventArgs::Tunnel 时请求置于顶端。

Since
build 275
YF_API void YSLib::Components::OnTouchHeld ( TouchEventArgs &&  )

处理屏幕接触保持事件。

实现记录坐标偏移(用于拖放)或触发 TouchMove 事件。

YF_API void YSLib::Components::OnTouchMove ( TouchEventArgs &&  )

处理屏幕接触移动事件。

Note
重复触发 TouchDown 事件。
YF_API void YSLib::Components::OnTouchMove_Dragging ( TouchEventArgs &&  )

处理屏幕接触移动事件。

Note
使用拖放。
无效化当前区域,但不无效化移动后区域;通过 Move 事件可以调用无效化。
YF_API void YSLib::Components::PaintChild ( IWidget &  wgt,
PaintEventArgs &&  e 
)
YF_API Rect YSLib::Components::PaintChild ( IWidget &  wgt,
const PaintContext &  pc 
)
YF_API void YSLib::Components::ReleaseFocusCascade ( IWidget &  )

级联释放部件及上层容器焦点。

YF_API void YSLib::Components::ReleaseFocusFrom ( IWidget &  dst,
IWidget &  src 
)

释放焦点,并指定 LostFocus 事件发送控件。

Parameters
dst事件目标。
src事件源。
Note
若成功则在 dst 上触发 src 发送的 LostFocus 事件。
template<class _tContainer , class... _tWidgets>
void YSLib::Components::RemoveWidgets ( _tContainer &  con,
_tWidgets &...  wgts 
)
inline

从部件容器移除子部件。

Note
不保证顺序。
Since
build 303

Definition at line 270 of file yuicont.h.

References ystdex::unseq_apply().

Referenced by ShlTextReader::ShlTextReader().

Here is the call graph for this function:

Here is the caller graph for this function:

YF_API bool YSLib::Components::RepeatHeld ( InputTimer &  ,
InputTimer::HeldStateType &  ,
const Timers::Duration &  ,
const Timers::Duration &   
)

向指定计时器传递参数,根据状态重复按键。

Returns
当且仅当结果为 true 时或之前状态为 HeldStateType::Free 时为 true 。
Since
build 300
YF_API void YSLib::Components::RequestFocusCascade ( IWidget &  )

级联请求部件及上层容器焦点。

YF_API void YSLib::Components::RequestFocusFrom ( IWidget &  dst,
IWidget &  src 
)

向部件容器请求获得焦点,并指定 GotFocus 事件发送控件。

Parameters
dst事件目标。
src事件源。
Note
若成功则在 dst 上触发 src 发送的 GotFocus 事件。
YF_API void YSLib::Components::RequestToTop ( IWidget &  )

请求提升至容器顶端。

Since
build 192
Todo:
完全实现提升 IWidget 至容器顶端(目前仅实现父容器为 Panel 的情形)。
YF_API void YSLib::Components::ResizeForContent ( TextList &  )

根据文本内容调整文本列表大小。

Note
调整大小后自动调整视图长度。
YF_API void YSLib::Components::SetBoundsOf ( IWidget &  ,
const Rect &   
)

设置部件边界。

Since
build 177
void YSLib::Components::SetContainerPtrOf ( IWidget &  wgt,
IWidget *  pCon = {} 
)
inline

设置部件的容器指针。

Since
build 269

Definition at line 190 of file ywidget.h.

Referenced by YSLib::Components::Panel::Add(), YSLib::Components::Window::Add(), YSLib::Components::DialogBox::DialogBox(), ContainerSetter::operator()(), YSLib::Components::Panel::operator+=(), and YSLib::Components::Panel::operator-=().

Here is the caller graph for this function:

void YSLib::Components::SetEnabledOf ( IWidget &  wgt,
bool  b 
)
inline

设置部件可用性。

Definition at line 92 of file ycontrol.h.

References YSLib::Components::IWidget::GetController(), and YSLib::Components::AController::SetEnabled().

Referenced by Enable().

Here is the call graph for this function:

Here is the caller graph for this function:

YF_API void YSLib::Components::SetInvalidationOf ( IWidget &  )

设置部件的无效区域。

Since
build 231
YF_API void YSLib::Components::SetInvalidationToParent ( IWidget &  )

在容器设置部件的无效区域。

Note
若容器不存在则忽略。
Since
build 229
YF_API void YSLib::Components::SetLocationOf ( IWidget &  ,
const Point &   
)

设置部件左上角所在位置(相对于容器的偏移坐标)。

Since
build 259
YF_API void YSLib::Components::SetSizeOf ( IWidget &  ,
const Size &   
)

Referenced by YSLib::Components::ScrollableContainer::FixLayout().

Here is the caller graph for this function:

void YSLib::Components::SetVisibleOf ( IWidget &  wgt,
bool  b 
)
inline

设置部件可见性。

Since
build 259

Definition at line 229 of file ywidget.h.

References YSLib::Components::IWidget::GetView(), and YSLib::Components::View::SetVisible().

Referenced by YSLib::Components::ScrollableContainer::FixLayout(), Hide(), DualScreenReader::SetVisible(), ShlExplorer::ShlExplorer(), ShlTextReader::ShlTextReader(), Show(), smooth_scroll_duration(), and SwitchVisible().

Here is the call graph for this function:

Here is the caller graph for this function:

YF_API void YSLib::Components::Show ( IWidget &  )

显示部件。

依次设置部件可见性、请求部件焦点和无效化。

Since
build 229