YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
YSLib::UI::ListBox类 参考

带滚动条的文本列表框。 更多...

#include <ComboList.h>

类 YSLib::UI::ListBox 继承关系图:
YSLib::UI::ListBox 的协作图:

Public 类型

typedef TextList::ListType ListType
 
typedef TextList::ViewArgs ViewArgs
 
typedef TextList::HViewEvent HViewEvent
 
typedef TextList::IndexType IndexType
 
typedef TextList::ItemType ItemType
 
typedef
ystdex::subscriptive_iterator
< ListBox, IWidget
Iterator
 
- Public 类型 继承自 YSLib::UI::ScrollableContainer
typedef
ystdex::subscriptive_iterator
< ScrollableContainer, IWidget
Iterator
 

Public 成员函数

 ListBox (const Rect &={}, const shared_ptr< ListType > &={})
 
 ListBox (ListBox &&)=default
 
Iterator GetBegin ()
 
Iterator GetEnd ()
 
WidgetRange GetChildren () override
 
IWidgetoperator[] (size_t idx) ynoexcept
 
size_t GetChildrenCount () const ynothrow
 
bool IsSelected () const ynothrow
 
bool Contains (ListType::size_type i)
 
ListType::size_type GetHeadIndex () const ynothrow
 
ListType::size_type GetSelectedIndex () const ynothrow
 
const ListTypeGetList () const ynothrow
 
ListTypeGetListRef () ynothrow
 
GEvent< void(HViewEvent::EventArgsType)> & GetViewChanged () ynothrow
 视图变更事件。
 
GEvent< void(HIndexEvent::EventArgsType)> & GetSelected () ynothrow
 项目选择状态变更事件。
 
GEvent< void(HIndexEvent::EventArgsType)> & GetConfirmed () ynothrow
 项目选中确定事件。
 
void SetList (const shared_ptr< ListType > &_tempArgName)
 设置文本列表。
 
void SetSelected (ListType::size_type i)
 设置选中项。
 
void AdjustViewForContent ()
 按内容大小依次调整列表视图中选中和首个项目的索引。
 
void AdjustViewLength ()
 调整视图长度。
 
void ClearSelected ()
 清除选中项。
 
IndexType Find (const ItemType &text)
 查找项。
 
void ResetView ()
 
void ResizeForPreferred (const Size &sup, Size s={})
 按指定大小上限和内容调整大小。
 
void UpdateView ()
 
- Public 成员函数 继承自 YSLib::UI::ScrollableContainer
 ScrollableContainer (const Rect &={})
 
 ScrollableContainer (ScrollableContainer &&)=default
 
Iterator GetBegin ()
 
Iterator GetEnd ()
 
WidgetRange GetChildren () override
 
IWidgetoperator[] (size_t idx) ynoexcept
 
size_t GetChildrenCount () const ynothrow
 
- Public 成员函数 继承自 YSLib::UI::Control
 Control (const Rect &={})
 构造:使用指定边界,默认背景(同 Widget 默认构造)。
 
 Control (const Rect &, NoBackgroundTag)
 构造:使用指定边界,无背景。
 
 Control (const Control &)
 复制构造:除容器为空外深复制。
 
 Control (Control &&)=default
 
virtual IWidgetGetBoundControlPtr (const KeyInput &)
 取按键-指针设备输入默认事件组映射。
 
void OnTouch_Close (TouchEventArgs &&)
 处理屏幕事件:关闭显示。
 
- Public 成员函数 继承自 YSLib::UI::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 成员函数 继承自 YSLib::UI::IWidget
virtual ~IWidget ()
 

Protected 属性

TextList tlContent
 
- Protected 属性 继承自 YSLib::UI::ScrollableContainer
HorizontalScrollBar hsbHorizontal
 控制水平可视区域的水平滚动条。
 
VerticalScrollBar vsbVertical
 控制竖直可视区域的竖直滚动条。
 

额外继承的成员函数

- Public 属性 继承自 YSLib::UI::Control
std::function< IWidget *(const
KeyInput &)> 
BoundControlPtr
 按键-指针设备输入事件组映射。
 
- Protected 成员函数 继承自 YSLib::UI::ScrollableContainer
Size FixLayout (const Size &)
 固定布局。
 

详细描述

带滚动条的文本列表框。

自从
build 205
待办事项:
实现 Resize 事件调整内容布局。

在文件 ComboList.h45 行定义.

成员类型定义说明

自从
build 316

在文件 ComboList.h52 行定义.

自从
build 316

在文件 ComboList.h54 行定义.

自从
build 356

在文件 ComboList.h56 行定义.

构造及析构函数说明

YSLib::UI::ListBox::ListBox ( const Rect = {},
const shared_ptr< ListType > &  = {} 
)
explicit
自从
build 337
YSLib::UI::ListBox::ListBox ( ListBox &&  )
inlinedefault

成员函数说明

void YSLib::UI::ListBox::AdjustViewForContent ( )
inline

按内容大小依次调整列表视图中选中和首个项目的索引。

警告
若视图大小变化后不调用此方法调整视图,可能导致选择项越界而行为未定义。
参见
TextList::AdjustViewLength
自从
build 392

在文件 ComboList.h111 行定义.

void YSLib::UI::ListBox::AdjustViewLength ( )
inline

调整视图长度。

参见
TextList::AdjustViewLength
自从
build 285

在文件 ComboList.h119 行定义.

void YSLib::UI::ListBox::ClearSelected ( )
inline

清除选中项。

参见
TextList::ClearSelected
自从
build 285

在文件 ComboList.h127 行定义.

bool YSLib::UI::ListBox::Contains ( ListType::size_type  i)
inline

在文件 ComboList.h75 行定义.

IndexType YSLib::UI::ListBox::Find ( const ItemType text)
inline

查找项。

参见
TextList::Find
自从
build 316

在文件 ComboList.h135 行定义.

Iterator YSLib::UI::ListBox::GetBegin ( )
inline
自从
build 357

在文件 ComboList.h72 行定义.

WidgetRange YSLib::UI::ListBox::GetChildren ( )
inlineoverridevirtual
自从
build 357

重载 YSLib::UI::Widget .

在文件 ComboList.h72 行定义.

size_t YSLib::UI::ListBox::GetChildrenCount ( ) const
inline

在文件 ComboList.h72 行定义.

GEvent<void( HIndexEvent ::EventArgsType)>& YSLib::UI::ListBox::GetConfirmed ( )
inline

项目选中确定事件。

在文件 ComboList.h89 行定义.

Iterator YSLib::UI::ListBox::GetEnd ( )
inline

在文件 ComboList.h72 行定义.

ListType::size_type YSLib::UI::ListBox::GetHeadIndex ( ) const
inline

在文件 ComboList.h78 行定义.

const ListType& YSLib::UI::ListBox::GetList ( ) const
inline
自从
build 392

在文件 ComboList.h82 行定义.

参考自 YSLib::UI::FileBox::GetPath().

这是这个函数的调用关系图:

ListType& YSLib::UI::ListBox::GetListRef ( )
inline
自从
build 392

在文件 ComboList.h84 行定义.

GEvent<void( HIndexEvent ::EventArgsType)>& YSLib::UI::ListBox::GetSelected ( )
inline

项目选择状态变更事件。

在文件 ComboList.h87 行定义.

ListType::size_type YSLib::UI::ListBox::GetSelectedIndex ( ) const
inline

在文件 ComboList.h80 行定义.

参考自 YSLib::UI::FileBox::GetPath().

这是这个函数的调用关系图:

GEvent<void( HViewEvent ::EventArgsType)>& YSLib::UI::ListBox::GetViewChanged ( )
inline

视图变更事件。

在文件 ComboList.h85 行定义.

bool YSLib::UI::ListBox::IsSelected ( ) const
inline

在文件 ComboList.h74 行定义.

参考自 YSLib::UI::FileBox::GetPath().

这是这个函数的调用关系图:

IWidget& YSLib::UI::ListBox::operator[] ( size_t  idx)
inline

在文件 ComboList.h72 行定义.

void YSLib::UI::ListBox::ResetView ( )
inline

在文件 ComboList.h138 行定义.

void ListBox::ResizeForPreferred ( const Size sup,
Size  s = {} 
)

按指定大小上限和内容调整大小。

参数
sup指定调整的大小的上限,当为 Size() 时忽略大小限制。
s指定大小,分量为 0 时对应分量大小由内容确定(其中宽度含边距)。
自从
build 337

在文件 ComboList.cpp90 行定义.

参考 YSL_BEGIN::defMinScrollBarWidth(),YSLib::Drawing::GetHorizontalOf(),YSLib::Drawing::Size::Height,SetSizeOf(),UpdateView(),YSLib::Drawing::Size::Width , 以及 yunseq().

函数调用图:

void YSLib::UI::ListBox::SetList ( const shared_ptr< ListType > &  _tempArgName)
inline

设置文本列表。

自从
build 292

在文件 ComboList.h96 行定义.

void YSLib::UI::ListBox::SetSelected ( ListType::size_type  i)
inline

设置选中项。

参见
TextList::SetSelected
自从
build 285。

在文件 ComboList.h102 行定义.

void YSLib::UI::ListBox::UpdateView ( )
inline

在文件 ComboList.h150 行定义.

参考自 YSLib::UI::FileBox::SetPath().

这是这个函数的调用关系图:

类成员变量说明

TextList YSLib::UI::ListBox::tlContent
protected

在文件 ComboList.h63 行定义.


该类的文档由以下文件生成: