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

轨道。 More...

#include <scroll.h>

Inheritance diagram for YSLib::Components::ATrack:
Collaboration diagram for YSLib::Components::ATrack:

Public Types

enum  Area { None = 0, OnThumb = 1, OnPrev = 2, OnNext = 3 }
 轨道区域。 More...
 
typedef ScrollEventArgs::ValueType ValueType
 
typedef
ystdex::subscriptive_iterator
< ATrack, IWidget
Iterator
 
- Public Types inherited from YSLib::GMRange< ScrollEventArgs::ValueType >
typedef ScrollEventArgs::ValueType ValueType
 

Public Member Functions

 ATrack (const Rect &={}, SDst=8)
 构造:使用指定边界和大小。
 
 ATrack (ATrack &&)=default
 
bool IsHorizontal () const ynothrow
 
bool IsVertical () const ynothrow
 
Iterator GetBegin ()
 
Iterator GetEnd ()
 
WidgetRange GetChildren () override
 
IWidgetoperator[] (size_t idx) ynoexcept
 
size_t GetChildrenCount () const ynothrow
 
GEvent< void(HUIEvent::EventArgsType)> & GetThumbDrag () ynothrow
 滑块拖动事件。
 
GEvent< void(HScrollEvent::EventArgsType)> & GetScroll () ynothrow
 滚动事件。
 
SDst GetMinThumbLength () const ynothrow
 
virtual Orientation GetOrientation () const =0
 取轨道方向。
 
SDst GetScrollableLength () const ynothrow
 取可滚动区域长度。
 
SDst GetThumbLength () const ynothrow
 取轨道方向上的滑块长度。
 
SDst GetThumbPosition () const ynothrow
 取滑块位置。
 
virtual SDst GetTrackLength () const ynothrow
 取轨道方向上的轨道长度。
 
ValueType GetLargeDelta () const ynothrow
 
virtual void SetThumbLength (SDst)
 设置轨道方向上的滑块长度。
 
void SetThumbPosition (SPos)
 设置滑块位置。
 
void SetMaxValue (ValueType)
 设置滚动事件关联值最大取值。
 
void SetValue (ValueType)
 设置滚动事件关联值。
 
void SetLargeDelta (ValueType)
 设置大距离滚动偏移量。
 
void LocateThumb (ValueType, ScrollCategory=ScrollCategory::ThumbPosition)
 定位滑块。
 
- Public Member Functions inherited from YSLib::Components::Control
 Control (const Rect &={})
 构造:使用指定边界,默认背景(同 Widget 默认构造)。
 
 Control (const Rect &, NoBackgroundTag)
 构造:使用指定边界,无背景。
 
 Control (const Control &)
 复制构造:除容器为空外深复制。
 
 Control (Control &&)=default
 
virtual IWidgetGetBoundControlPtr (const KeyInput &)
 取按键-指针设备输入默认事件组映射。
 
void OnTouch_Close (TouchEventArgs &&)
 处理屏幕事件:关闭显示。
 
- Public Member Functions inherited from YSLib::Components::Widget
 Widget (const Rect &={}, Color=Drawing::ColorSpace::White, Color=Drawing::ColorSpace::Black)
 
template<typename _tView , typename _tRenderer , typename _tController >
 Widget (_tView &&pView_=make_unique< View >(), _tRenderer &&pRenderer_=make_unique< Renderer >(), _tController &&pController_={})
 构造:使用视图指针、渲染器指针和控制器指针,无背景。
 
 Widget (const Widget &)
 复制构造:除容器指针为空外深复制。
 
 Widget (Widget &&)=default
 
virtual ~Widget ()
 析构:虚实现。
 
SPos GetX () const ynothrow
 
SPos GetY () const ynothrow
 
SDst GetWidth () const ynothrow
 
SDst GetHeight () const ynothrow
 
virtual RendererGetRenderer () const ynothrow
 取渲染器。
 
virtual ViewGetView () const ynothrow
 取部件视图。
 
virtual AControllerGetController () const override
 取控制器。
 
void SetX (SDst _tempArgName)
 
void SetY (SDst _tempArgName)
 
void SetWidth (SDst _tempArgName)
 
void SetHeight (SDst _tempArgName)
 
void SetRenderer (unique_ptr< Renderer > &&)
 设置渲染器为指定指针指向的对象,同时更新渲染器状态。
 
void SetView (unique_ptr< View > &&)
 设置渲染器为指定指针指向的对象,同时更新渲染器状态。
 
virtual void Refresh (PaintEventArgs &&)
 刷新:按指定参数绘制界面并更新状态。
 
- Public Member Functions inherited from YSLib::Components::IWidget
virtual ~IWidget ()
 
- Public Member Functions inherited from YSLib::GMRange< ScrollEventArgs::ValueType >
ValueType GetMaxValue () const ynothrow
 
ValueType GetValue () const ynothrow
 

Protected Member Functions

Area CheckArea (SPos) const
 检查轨道方向指定位置所在的区域。
 
- Protected Member Functions inherited from YSLib::GMRange< ScrollEventArgs::ValueType >
 GMRange (ValueType m, ValueType v)
 构造:使用指定最大取值和值。
 

Protected Attributes

Thumb tmbScroll
 滑块:轨道区域上的滚动框。
 
- Protected Attributes inherited from YSLib::GMRange< ScrollEventArgs::ValueType >
ValueType max_value
 最大取值。
 
ValueType value
 值。
 

Private Attributes

SDst min_thumb_length
 最小滑块长度。
 
ValueType large_delta
 大距离滚动偏移量:滚动事件关联的滑块位置变化绝对值。
 
GEvent< void(HUIEvent::EventArgsType)> ThumbDrag
 滑块拖动事件。
 
GEvent< void(HScrollEvent::EventArgsType)> Scroll
 滚动事件。
 

Additional Inherited Members

- Public Attributes inherited from YSLib::Components::Control
std::function< IWidget *(const
KeyInput &)> 
BoundControlPtr
 按键-指针设备输入事件组映射。
 

Detailed Description

轨道。

Since
build 167

Definition at line 122 of file scroll.h.

Member Typedef Documentation

Since
build 356

Definition at line 136 of file scroll.h.

值类型。

Definition at line 134 of file scroll.h.

Member Enumeration Documentation

轨道区域。

Enumerator:
None 
OnThumb 
OnPrev 
OnNext 

Definition at line 126 of file scroll.h.

Constructor & Destructor Documentation

YSLib::Components::ATrack::ATrack ( const Rect = {},
SDst  = 8 
)
explicit

构造:使用指定边界和大小。

Since
build 337
YSLib::Components::ATrack::ATrack ( ATrack &&  )
inlinedefault

Member Function Documentation

ATrack::Area ATrack::CheckArea ( SPos  q) const
protected

检查轨道方向指定位置所在的区域。

Definition at line 179 of file scroll.cpp.

References YSLib::SwitchInterval(), and yconstexpr.

Here is the call graph for this function:

Iterator YSLib::Components::ATrack::GetBegin ( )
inline
Since
build 356

Definition at line 167 of file scroll.h.

WidgetRange YSLib::Components::ATrack::GetChildren ( )
inlineoverridevirtual
Since
build 357

Reimplemented from YSLib::Components::Widget.

Definition at line 167 of file scroll.h.

size_t YSLib::Components::ATrack::GetChildrenCount ( ) const
inline

Definition at line 167 of file scroll.h.

Iterator YSLib::Components::ATrack::GetEnd ( )
inline

Definition at line 167 of file scroll.h.

ValueType YSLib::Components::ATrack::GetLargeDelta ( ) const
inline

Definition at line 181 of file scroll.h.

SDst YSLib::Components::ATrack::GetMinThumbLength ( ) const
inline

Definition at line 171 of file scroll.h.

virtual Orientation YSLib::Components::ATrack::GetOrientation ( ) const
pure virtual
GEvent<void( HScrollEvent ::EventArgsType)>& YSLib::Components::ATrack::GetScroll ( )
inline

滚动事件。

Definition at line 170 of file scroll.h.

SDst YSLib::Components::ATrack::GetScrollableLength ( ) const
inline

取可滚动区域长度。

Definition at line 174 of file scroll.h.

GEvent<void( HUIEvent ::EventArgsType)>& YSLib::Components::ATrack::GetThumbDrag ( )
inline

滑块拖动事件。

Definition at line 169 of file scroll.h.

SDst YSLib::Components::ATrack::GetThumbLength ( ) const
inline

取轨道方向上的滑块长度。

Definition at line 176 of file scroll.h.

SDst YSLib::Components::ATrack::GetThumbPosition ( ) const
inline

取滑块位置。

Definition at line 178 of file scroll.h.

virtual SDst YSLib::Components::ATrack::GetTrackLength ( ) const
inlinevirtual

取轨道方向上的轨道长度。

Definition at line 180 of file scroll.h.

bool YSLib::Components::ATrack::IsHorizontal ( ) const
inline

Definition at line 163 of file scroll.h.

bool YSLib::Components::ATrack::IsVertical ( ) const
inline

Definition at line 164 of file scroll.h.

void ATrack::LocateThumb ( ValueType  val,
ScrollCategory  t = ScrollCategory::ThumbPosition 
)

定位滑块。

Note
指定滚动事件关联值设置滑块位置并触发对应事件。
当滚动类别为 ScrollCategory::ThumbPosition 值参数为设置指定值; 当滚动类别为 ScrollCategory::SmallDecrementScrollCategory::SmallIncrement 时参数为值变化的绝对值; 其它情况无效。

Definition at line 195 of file scroll.cpp.

IWidget& YSLib::Components::ATrack::operator[] ( size_t  idx)
inline

Definition at line 167 of file scroll.h.

void ATrack::SetLargeDelta ( ValueType  val)

设置大距离滚动偏移量。

Note
同步按滑块长度和最大取值的比例设置滑块位置。

Definition at line 172 of file scroll.cpp.

void ATrack::SetMaxValue ( ValueType  m)

设置滚动事件关联值最大取值。

Note
当指定值非正值时无效。
约束 large_delta 不大于指定值。

Definition at line 156 of file scroll.cpp.

void ATrack::SetThumbLength ( SDst  l)
virtual

设置轨道方向上的滑块长度。

Definition at line 126 of file scroll.cpp.

References YSLib::Drawing::Size::GetRef(), YSLib::Components::GetSizeOf(), YSLib::Components::Invalidate(), YSLib::RestrictInInterval(), and SetSizeOf().

Here is the call graph for this function:

void ATrack::SetThumbPosition ( SPos  pos)

设置滑块位置。

Definition at line 141 of file scroll.cpp.

References YSLib::Components::GetLocationOf(), YSLib::Drawing::GBinaryGroup< _type >::GetRef(), YSLib::Components::Invalidate(), YSLib::RestrictInClosedInterval(), and SetLocationOf().

Here is the call graph for this function:

void ATrack::SetValue ( ValueType  val)

设置滚动事件关联值。

Note
同步按滑块长度和最大取值的比例设置滑块位置。

Definition at line 166 of file scroll.cpp.

Member Data Documentation

ValueType YSLib::Components::ATrack::large_delta
private

大距离滚动偏移量:滚动事件关联的滑块位置变化绝对值。

Definition at line 149 of file scroll.h.

SDst YSLib::Components::ATrack::min_thumb_length
private

最小滑块长度。

Definition at line 146 of file scroll.h.

GEvent<void( HScrollEvent ::EventArgsType)> YSLib::Components::ATrack::Scroll
private

滚动事件。

Definition at line 152 of file scroll.h.

GEvent<void( HUIEvent ::EventArgsType)> YSLib::Components::ATrack::ThumbDrag
private

滑块拖动事件。

Definition at line 151 of file scroll.h.

Thumb YSLib::Components::ATrack::tmbScroll
protected

滑块:轨道区域上的滚动框。

Since
build 374

Definition at line 143 of file scroll.h.


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