28 #ifndef YSL_INC_UI_textlist_h_
29 #define YSL_INC_UI_textlist_h_ 1
32 #include YFM_YSLib_UI_YControl
33 #include YFM_YSLib_UI_YGUI
34 #include YFM_YSLib_UI_Label
35 #include YFM_YSLib_UI_Viewer
74 using MTextList::
Font;
75 using MTextList::Margin;
76 using MTextList::HorizontalAlignment;
77 using MTextList::VerticalAlignment;
78 using MTextList::Text;
80 using MHilightText::HilightBackColor;
82 using MHilightText::HilightTextColor;
117 TextList(const
Rect& = {},
const shared_ptr<ListType>& = {},
126 DefGetterMem(const ynothrow, ListType::size_type, HeadIndex, viewer)
127 using MTextList::GetItemHeight;
128 using MTextList::GetItemPtr;
129 using MTextList::GetList;
131 using MTextList::GetListRef;
132 using MTextList::GetMaxTextWidth;
133 DefGetterMem(const ynothrow, ListType::size_type, SelectedIndex, viewer)
139 GetFullViewHeight() const;
153 SetList(const shared_ptr<ListType>&);
232 using MTextList::Find;
243 ListType::size_type diff = 1);
268 ListType::size_type);
293 using MTextList::RefreshTextState;
void InvalidateSelected(ListType::difference_type offset, ListType::size_type diff=1)
无效化偏移量对应的列表项区域。
#define ImplBodyMem(_m, _n,...)
SDst GetViewPosition() const
取视图顶端竖直位置。
typename ListType::size_type IndexType
索引类型。
void Refresh(PaintEventArgs &&) override
刷新:按指定参数绘制界面并更新状态。
YF_API GUIState & FetchGUIState()
取默认图形用户界面公共状态。
SDst AdjustOffset(bool)
调整列表视图底项目的竖直偏移量为零。
DeclEvent(HViewEvent, ViewChanged) DeclEvent(HIndexEvent
视图变更事件。
void UpdateView(TextList &tl, bool is_active)
void InvalidateSelected2(ListType::difference_type, ListType::difference_type)
无效化偏移量对应的列表项区域。
void SelectLast()
选择最后一个项目。
std::uint16_t SDst
屏幕坐标距离。
virtual bool CheckConfirmed(ListType::size_type) const
检查列表中的指定项是否有效。
PDefH(void, Activate, Console &console, Drawing::Color fc=Drawing::ColorSpace::White) ImplExpr(Activate(console
激活:使用指定屏幕、有效性、前景色和默认背景色。
virtual void DrawItemBackground(const PaintContext &, const Rect &r)
描画列表项背景。
bool CyclicTraverse
循环选择遍历。
void SetSelected(ListType::size_type)
按指定项目索引设置选中项目。
void SetList(const shared_ptr< ListType > &)
设置文本列表。
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
void SelectFirst()
选择第一个项目。
DeclDelegate(HScrollEvent, ScrollEventArgs) class YF_API ATrack
轨道。
vector< ItemType > ListType
列表类型。
void LocateViewPosition(SDst)
定位视图顶端至指定竖直位置。
Styles::Palette Colors
调色板。
virtual void DrawItem(const Graphics &, const Rect &mask, const Rect &, ListType::size_type)
绘制列表项。
void AdjustViewForContent()
按内容大小依次调整视图中选中和首个项目的索引,然后按需调整竖直偏移量。
SDst top_offset
列表视图首项目超出上边界的竖直偏移量。
Selected const shared_ptr< ListType > const pair< Color, Color > viewer Contains
DefGetterMem(const ynothrow, ListType::size_type, SelectedIndex, viewer) SDst GetFullViewHeight() const
取完整视图高。
Selected const shared_ptr< ListType > const pair< Color, Color > & DefDeMoveCtor(TextList) DefPredMem(const ynothrow
ListType::size_type CheckPoint(SPos, SPos)
检查点(相对于所在缓冲区的控件坐标)是否在选择范围内,
void InvokeConfirmed(ListType::size_type)
检查和调用确认事件处理器。
void AdjustViewLength()
调整视图长度。
void CallSelected()
调用选中事件处理器。
#define DefPredMem(_q, _n, _m)
void ResizeForContent(TextList &tl)
virtual void DrawItems(const PaintContext &)
绘制列表。
Selected const shared_ptr< ListType > const pair< Color, Color > Selected