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

文本列表模块。 More...

#include <label.h>

Inheritance diagram for YSLib::Components::MTextList:
Collaboration diagram for YSLib::Components::MTextList:

Public Types

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

Public Member Functions

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

Protected Member Functions

 MTextList (const shared_ptr< ListType > &={}, const Drawing::Font &={})
 构造:使用文本列表句柄和字体指针。
 
 MTextList (MTextList &&)=default
 
- Protected Member Functions inherited from YSLib::Components::MLabel
 MLabel (const Drawing::Font &={}, TextAlignment=TextAlignment::Left)
 构造:使用指定字体。
 
 MLabel (MLabel &&)=default
 
void DrawText (const Size &, Color, const PaintContext &)
 绘制文本。
 

Protected Attributes

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

Additional Inherited Members

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

Detailed Description

文本列表模块。

Warning
非虚析构。

Definition at line 132 of file label.h.

Member Typedef Documentation

typedef ListType::size_type YSLib::Components::MTextList::IndexType

索引类型。

Definition at line 137 of file label.h.

项目类型:字符串。

Definition at line 135 of file label.h.

列表类型。

Definition at line 136 of file label.h.

Constructor & Destructor Documentation

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

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

Note
当文本列表指针为空时新建。
Since
build 337
YSLib::Components::MTextList::MTextList ( MTextList &&  )
inlineprotecteddefault

Member Function Documentation

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

查找项。

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

Definition at line 129 of file label.cpp.

References GetList().

Here is the call graph for this function:

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

取项目行高。

Since
build 301

Definition at line 175 of file label.h.

MTextList::ItemType * MTextList::GetItemPtr ( IndexType  idx) const

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

Definition at line 115 of file label.cpp.

References GetList().

Here is the call graph for this function:

ListType& YSLib::Components::MTextList::GetList ( ) const
inline

取文本列表。

Definition at line 164 of file label.h.

Referenced by Find(), GetItemPtr(), and GetMaxTextWidth().

Here is the caller graph for this function:

SDst MTextList::GetMaxTextWidth ( ) const

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

Since
build 282

Definition at line 123 of file label.cpp.

References YSLib::Drawing::FetchMaxTextWidth(), and GetList().

Here is the call graph for this function:

void MTextList::RefreshTextState ( )

刷新文本状态。

Definition at line 138 of file label.cpp.

References YSLib::Drawing::PenStyle::Font, YSLib::Drawing::GetVerticalOf(), YSLib::Drawing::TextState::LineGap, YSLib::Components::MLabel::Margin, tsList, and yunseq.

Here is the call graph for this function:

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

设置文本列表。

Note
若参数为空则忽略。
Since
build 292

Definition at line 190 of file label.h.

References YB_LIKELY.

Member Data Documentation

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

文本列表句柄。

Definition at line 140 of file label.h.

Drawing::TextState YSLib::Components::MTextList::tsList
protected

列表文本状态。

Since
build 346

Definition at line 145 of file label.h.

Referenced by RefreshTextState().


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