29 #include YFM_YSLib_UI_ComboList
30 #include YFM_YSLib_UI_YStyle
31 #include YFM_YSLib_UI_YPanel
41 const SDst defMinScrollBarWidth(16);
52 if(
const auto p = dynamic_cast<Panel*>(pCon))
63 tlContent(
Rect(r.GetSize()), h)
71 if(!e.Value && GetWidth() > defMinScrollBarWidth)
73 const Size view_arena(GetWidth() - defMinScrollBarWidth,
77 if(view_arena.Height >
tlContent.GetHeight())
93 ListBox::ResizeForPreferred(
const Size& sup,
Size s)
118 if(
Contains(e) && bool(*
this /= GetList()[e.Value]))
129 FileBox::GetPath()
const
131 return IsSelected() ?
pthDirectory / (GetList()[GetSelectedIndex()])
184 if(!dynamic_cast<RoutedEventArgs*>(&e))
192 lbContent.GetView().DependencyPtr =
this,
194 if(!FetchContainerPtr(lbContent))
203 const SDst h1(max<SPos>(0, pt.
Y)), h2(max<SPos>(0, h0 - pt.
Y
208 lbContent.ResizeForPreferred(
Size(0, max(h1, h2)),
209 Size(GetWidth(), 0));
211 const SDst h(lbContent.GetHeight());
214 pt.
Y += h2 < h ? -h : GetHeight();
216 lbContent.AdjustViewLength();
218 const auto idx(lbContent.Find(Text));
221 lbContent.SetSelected(idx);
223 lbContent.ClearSelected();
225 p->Add(lbContent, 224U);
226 RequestFocus(lbContent);
232 FetchEvent<LostFocus>(*this) += detacher,
233 FetchEvent<LostFocus>(lbContent) += detacher,
235 YAssert(e.Value < lbContent.GetList().size(),
"Invalid index found.");
237 Text = lbContent.GetList()[e.Value];
243 DropDownList::~DropDownList()
249 DropDownList::DetachTopWidget()
257 const auto cs(GetCursorState());
pt pt Y const IWidget &wgt const IWidget &wgt GetSizeOf
无效化:使相对于部件的子部件的指定区域在直接和间接的窗口缓冲区中无效。
GValueEventArgs< MTextList::IndexType > IndexEventArgs
索引事件。
ListType ListItems() const
遍历目录中的项目,更新至列表。
YF_API void SetLocationOf(IWidget &, const Point &)
设置部件左上角所在位置(相对于容器的偏移坐标)。
void ListFiles(const Path &pth, vector< String > &lst)
tlContent ListType::size_type i tlContent const ListType tlContent tlContent ViewChanged tlContent Confirmed ListType::size_type i const ItemType &text ResetView
YF_API void Invalidate(IWidget &, const Rect &)
无效化:使相对于部件的指定区域在直接和间接的窗口缓冲区中无效。
_iCOM * Detach(COMPtr< _iCOM > &ptr) ynothrow
void UpdateView(TextList &tl, bool is_active)
TextList::ViewArgs ViewArgs
IO::Path pthDirectory
目录的完整路径。
bool IsInOpenInterval(_type i, _type b) ynothrow
判断 i 是否在开区间 (FetchZero<_type>(), b) 内。
YF_API void SetSizeOf(IWidget &, const Size &)
设置部件大小。
Size FixLayout(const Size &)
固定布局。
std::uint16_t SDst
屏幕坐标距离。
CompactPixmapEx & operator=(const CompactPixmapEx &buf)
VerticalScrollBar vsbVertical
控制竖直可视区域的竖直滚动条。
YSLib 标准字符串(使用 UCS-2 作为内部编码)。
#define yunseq
无序列依赖表达式组求值。
CursorState csCurrent
指针设备光标状态。
ATrack *pTrack GetTrackRef()) DefGetterMem(const ynothrow
ListBox(const Rect &={}, const shared_ptr< ListType > &={})
YF_API IWidget & FetchTopLevel(IWidget &)
取指定部件的顶层部件。
bool operator/=(const String &)
导航至子目录。
DefGetter(const ynothrow, const IO::Path &, Directory, pthDirectory) IO bool SetPath(const IO::Path &)
取目录的完整路径。
YF_API void DrawArrow(const Graphics &, const Rect &, SDst=4, Rotation=RDeg0, Color=ColorSpace::Black)
在指定图形接口上下文上描画箭头。
DropDownList(const Rect &={}, const shared_ptr< ListType > &={})
void Refresh(PaintEventArgs &&) override
分离顶层子部件。
virtual void Refresh(PaintEventArgs &&)
刷新:按指定参数绘制界面并更新状态。
TextList::ListType ListType
#define YAssert(_expr, _msg)