YSTest
PreAlpha_b380_20130211
The YSLib Test Project
|
文本列表模块。 More...
#include <label.h>
Public Types | |
typedef String | ItemType |
项目类型:字符串。 | |
typedef vector< ItemType > | ListType |
列表类型。 | |
typedef ListType::size_type | IndexType |
索引类型。 | |
Public Member Functions | |
ListType & | GetList () const ynothrow |
取文本列表。 | |
ItemType * | GetItemPtr (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 | |
![]() | |
MLabel (const Drawing::Font &={}, TextAlignment=TextAlignment::Left) | |
构造:使用指定字体。 | |
MLabel (MLabel &&)=default | |
void | DrawText (const Size &, Color, const PaintContext &) |
绘制文本。 | |
Protected Attributes | |
shared_ptr< ListType > | hList |
文本列表句柄。 | |
Drawing::TextState | tsList |
列表文本状态。 | |
Additional Inherited Members | |
![]() | |
Drawing::Font | Font |
字体。 | |
Drawing::Padding | Margin |
文本和容器的间距。 | |
TextAlignment | HorizontalAlignment |
文本水平和竖直对齐属性。 | |
TextAlignment | VerticalAlignment |
bool | AutoWrapLine |
启用自动换行。 | |
String | Text |
标签文本。 | |
typedef ListType::size_type YSLib::Components::MTextList::IndexType |
typedef String YSLib::Components::MTextList::ItemType |
typedef vector<ItemType> YSLib::Components::MTextList::ListType |
|
explicitprotected |
构造:使用文本列表句柄和字体指针。
|
inlineprotecteddefault |
MTextList::IndexType MTextList::Find | ( | const ItemType & | text | ) | const |
|
inline |
MTextList::ItemType * MTextList::GetItemPtr | ( | IndexType | idx | ) | const |
|
inline |
取文本列表。
Definition at line 164 of file label.h.
Referenced by Find(), GetItemPtr(), and GetMaxTextWidth().
SDst MTextList::GetMaxTextWidth | ( | ) | const |
取文本列表中的最大文本宽度。
Definition at line 123 of file label.cpp.
References YSLib::Drawing::FetchMaxTextWidth(), and GetList().
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.
|
inline |
|
mutableprotected |
|
protected |