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

文本列表模块。 更多...

#include <label.h>

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

Public 类型

typedef String ItemType
 项目类型:字符串。
 
typedef vector< ItemTypeListType
 列表类型。
 
typedef ListType::size_type IndexType
 索引类型。
 

Public 成员函数

const ListTypeGetList () const ynothrow
 取文本列表。
 
ListTypeGetListRef () ynothrow
 取文本列表引用。
 
ItemTypeGetItemPtr (const IndexType &)
 取指定项目索引的项目指针。
 
const ItemTypeGetItemPtr (const IndexType &) const
 取指定项目索引的项目 const 指针。
 
SDst GetItemHeight () const ynothrow
 取项目行高。
 
SDst GetMaxTextWidth () const
 取文本列表中的最大文本宽度。
 
void SetList (const shared_ptr< ListType > &h)
 设置文本列表。
 
IndexType Find (const ItemType &) const
 查找项。
 
void RefreshTextState ()
 刷新文本状态。
 

Protected 成员函数

 MTextList (const shared_ptr< ListType > &={}, const Drawing::Font &={})
 构造:使用文本列表句柄和字体指针。
 
 MTextList (MTextList &&)=default
 
- Protected 成员函数 继承自 YSLib::UI::MLabel
 MLabel (const Drawing::Font &={}, TextAlignment=TextAlignment::Left)
 构造:使用指定字体。
 
 MLabel (MLabel &&)=default
 
void DrawText (const Size &, Color, const PaintContext &)
 绘制文本。
 

Protected 属性

shared_ptr< ListTypehList
 文本列表句柄。
 
Drawing::TextState tsList
 列表文本状态。
 

额外继承的成员函数

- Public 属性 继承自 YSLib::UI::MLabel
Drawing::Font Font
 字体。
 
Drawing::Padding Margin
 文本和容器的间距。
 
TextAlignment HorizontalAlignment
 文本水平和竖直对齐属性。
 
TextAlignment VerticalAlignment
 
bool AutoWrapLine
 启用自动换行。
 
String Text
 标签文本。
 

详细描述

文本列表模块。

警告
非虚析构。

在文件 label.h132 行定义.

成员类型定义说明

typedef ListType::size_type YSLib::UI::MTextList::IndexType

索引类型。

在文件 label.h137 行定义.

项目类型:字符串。

在文件 label.h135 行定义.

列表类型。

在文件 label.h136 行定义.

构造及析构函数说明

YSLib::UI::MTextList::MTextList ( const shared_ptr< ListType > &  = {},
const Drawing::Font = {} 
)
explicitprotected

构造:使用文本列表句柄和字体指针。

注解
当文本列表指针为空时新建。
自从
build 337
YSLib::UI::MTextList::MTextList ( MTextList &&  )
inlineprotecteddefault

成员函数说明

MTextList::IndexType MTextList::Find ( const ItemType text) const

查找项。

返回
若找到则返回对应索引,否则返回 IndexType(-1)
自从
build 316

在文件 label.cpp136 行定义.

参考 GetList().

函数调用图:

SDst YSLib::UI::MTextList::GetItemHeight ( ) const
inline

取项目行高。

自从
build 301

在文件 label.h188 行定义.

ItemType* YSLib::UI::MTextList::GetItemPtr ( const IndexType )

取指定项目索引的项目指针。

自从
build 392
const ItemType* YSLib::UI::MTextList::GetItemPtr ( const IndexType ) const

取指定项目索引的项目 const 指针。

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

取文本列表。

自从
build 392

在文件 label.h165 行定义.

参考自 Find() , 以及 GetMaxTextWidth().

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

ListType& YSLib::UI::MTextList::GetListRef ( )
inline

取文本列表引用。

自从
build 392

在文件 label.h170 行定义.

SDst MTextList::GetMaxTextWidth ( ) const

取文本列表中的最大文本宽度。

自从
build 282

在文件 label.cpp130 行定义.

参考 YSLib::Drawing::FetchMaxTextWidth() , 以及 GetList().

函数调用图:

void MTextList::RefreshTextState ( )
void YSLib::UI::MTextList::SetList ( const shared_ptr< ListType > &  h)
inline

设置文本列表。

注解
若参数为空则忽略。
自从
build 292

在文件 label.h203 行定义.

参考 h , 以及 YB_LIKELY.

类成员变量说明

shared_ptr<ListType> YSLib::UI::MTextList::hList
mutableprotected

文本列表句柄。

在文件 label.h140 行定义.

Drawing::TextState YSLib::UI::MTextList::tsList
protected

列表文本状态。

自从
build 346

在文件 label.h145 行定义.

参考自 RefreshTextState().


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