28 #ifndef YSL_INC_UI_yuicont_h_
29 #define YSL_INC_UI_yuicont_h_ 1
32 #include YFM_YSLib_UI_YWidget
88 template<
class _tW
idget,
typename _fFetcher>
92 if(
YB_LIKELY(dynamic_cast<_tWidget*>(&wgt)))
95 _tWidget*
const pNode(fetch_ptr(wgt));
202 operator+=(IWidget&);
211 operator-=(IWidget&);
219 PDefHOp(IWidget&, [],
size_t idx)
ynothrowv
221 YAssert(idx < GetCount(), "Index is out of range."), *vWidgets[idx])
222 PDefHOp(IWidget&, [],
size_t idx) const
ynothrowv
224 YAssert(idx < GetCount(), "Index is out of range."), *vWidgets[idx])
246 Find(IWidget&) const;
260 PDefH(IWidget&, at,
size_t idx)
ythrow(std::out_of_range)
262 PDefH(IWidget&, at,
size_t idx) const
ythrow(std::out_of_range)
283 using WidgetMap = multimap<ZOrderType, ItemType>; \
310 PDefHOp(
void, +=, IWidget&
wgt)
320 operator-=(IWidget&);
333 DefGetter(const ynothrow,
size_t, Count, mWidgets.size())
350 PaintVisibleChildren(PaintEventArgs&);
359 QueryZ(IWidget&) const;
375 template<class _tCon>
386 template<
class _tCon>
398 template<
class _tCon,
class... _tWidgets>
402 unseq_apply(std::bind(
static_cast<void(_tCon::*)(IWidget&)
>(
403 &_tCon::operator+=), std::ref(con), std::placeholders::_1),
404 std::forward<IWidget&>(wgts)...);
412 template<
class _tCon,
class... _tWidgets>
417 >(&_tCon::Add), std::ref(con), std::placeholders::_1, z),
418 std::forward<IWidget&>(wgts)...);
426 template<
class _tCon,
class... _tWidgets>
430 unseq_apply(std::bind(
static_cast<bool(_tCon::*)(IWidget&)
>(
431 &_tCon::operator-=), std::ref(con), std::placeholders::_1),
432 std::forward<IWidget&>(wgts)...);
Point LocateContainerOffset(const IWidget &wgt, const Point &pt)
取相对部件 wgt 的点 pt 相对于 wgt 的容器的偏移坐标。
pt pt Y const IWidget &wgt GetLocationOf
YF_API Point LocateOffset(const IWidget *, Point, const IWidget *)
取相对于第三参数指向的部件的点相对于第一参数指向的容器的偏移坐标。
#define ynothrowv
YSLib 无异常抛出保证验证:有条件地使用无异常抛出规范。
void AddWidgetsZ(_tCon &con, ZOrderType z, _tWidgets &...wgts)
向部件容器添加指定 Z 顺序的子部件。
static const GBinaryGroup Invalid
无效(不在屏幕坐标系中)对象。
void unseq_apply(_fCallable &&f, _tParams &&...args)
无序调用。
ystdex::any_input_iterator< IWidget > WidgetIterator
通用部件迭代器。
#define DefGetter(_q, _t, _n,...)
void RemoveWidgets(_tCon &con, _tWidgets &...wgts)
从部件容器移除子部件。
void AddWidgets(_tCon &con, _tWidgets &...wgts)
向部件容器添加子部件。
YF_API void MoveToBottom(IWidget &wgt)
移动部件 wgt 至容器下端。
YF_API bool RemoveFrom(IWidget &, IWidget &)
从容器中移除部件。
YF_API void MoveToRight(IWidget &wgt)
移动部件 wgt 至容器右端。
IWidget * ItemType
部件组项目类型。
PDefH(void, Activate, Console &console, Drawing::Color fc=Drawing::ColorSpace::White) ImplExpr(Activate(console
激活:使用指定屏幕、有效性、前景色和默认背景色。
GBinaryGroup< SPos > Point
屏幕二维点(直角坐标表示)。
YF_API void MoveToTop(IWidget &wgt)
移动部件 wgt 至容器上端。
IWidget * ItemType
部件组项目类型。
#define ynothrow
YSLib 无异常抛出保证:若支持 noexcept 关键字, 指定特定的 noexcept 异常规范。
YF_API IWidget & FetchTopLevel(IWidget &)
取指定部件的顶层部件。
#define ythrow(...)
YSLib 动态异常规范:根据是否使用异常规范宏指定或忽略动态异常规范。
#define YAssertNonnull(_expr)
YF_API Point LocateForParentContainer(const IWidget &)
取指定部件相对于容器的父容器的偏移坐标。
YF_API Point LocateForWidget(const IWidget &, const IWidget &)
取第二参数指定的部件相对于第一参数指定的部件的偏移坐标。
const ZOrderType DefaultZOrder(64)
默认 Z 顺序值。
Selected const shared_ptr< ListType > const pair< Color, Color > viewer Contains
WidgetMap::value_type PairType
const IWidget &wgt ImplRet(wgt.GetView().IsVisible()) bool YF_API Contains(const IWidget &
判断点是否在部件的可视区域内。
void AddWidget(_tCon &con, IWidget &wgt)
向部件添加单一子部件。
Selected const shared_ptr< ListType > const pair< Color, Color > & DefDeMoveCtor(TextList) DefPredMem(const ynothrow
vector< ItemType > WidgetVector
部件组类型。
Point LocateForWidgetNode(IWidget &wgt, _fFetcher fetch_ptr)
取指定部件相对于视图树中的直接节点指针的偏移坐标。
multimap< ZOrderType, ItemType > WidgetMap
部件映射表类型:映射 Z 顺序至部件。
const ZOrderType DefaultWindowZOrder(128)
默认窗口 Z 顺序值。
YF_API void MoveToLeft(IWidget &wgt)
移动部件 wgt 至容器左端。
#define YAssert(_expr, _msg)