YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
ComboList.h
浏览该文件的文档.
1 /*
2  Copyright by FrankHB 2011 - 2013.
3 
4  This file is part of the YSLib project, and may only be used,
5  modified, and distributed under the terms of the YSLib project
6  license, LICENSE.TXT. By continuing to use, modify, or distribute
7  this file you indicate that you have read the license and
8  understand and accept it fully.
9 */
10 
28 #ifndef YSL_INC_UI_ComboList_h_
29 #define YSL_INC_UI_ComboList_h_ 1
30 
31 #include "textlist.h"
32 #include "scroll.h"
33 #include "../Core/yfilesys.h"
34 //#include "ystyle.h"
35 
37 
39 
40 
46 {
47 public:
57 
58 protected:
59  /*
60  \brief 文本列表。
61  \since build 391
62  */
64 
65 public:
67  explicit
68  ListBox(const Rect& = {}, const shared_ptr<ListType>& = {});
69  inline DefDeMoveCtor(ListBox)
70 
71 
72  DefWidgetMemberIterationBase(ScrollableContainer, tlContent)
73 
74  DefPredMem(const ynothrow, Selected, tlContent)
75  PDefH(bool, Contains, ListType::size_type i)
76  ImplBodyMem(tlContent, Contains, i)
77 
78  DefGetterMem(const ynothrow, ListType::size_type, HeadIndex, tlContent)
79  DefGetterMem(const ynothrow, ListType::size_type, SelectedIndex,
80  tlContent)
82  DefGetterMem(const ynothrow, const ListType&, List, tlContent)
84  DefGetterMem(ynothrow, ListType&, ListRef, tlContent)
85  DefEventGetterMem(ynothrow, HViewEvent, ViewChanged, tlContent) \
87  DefEventGetterMem(ynothrow, HIndexEvent, Selected, tlContent) \
89  DefEventGetterMem(ynothrow, HIndexEvent, Confirmed, tlContent) \
91 
96  DefSetterMem(const shared_ptr<ListType>&, List, tlContent)
102  PDefH(void, SetSelected, ListType::size_type i)
103  ImplBodyMem(tlContent, SetSelected, i)
104 
111  PDefH(void, AdjustViewForContent, )
112  ImplBodyMem(tlContent, AdjustViewForContent, )
113 
119  PDefH(void, AdjustViewLength, )
120  ImplBodyMem(tlContent, AdjustViewLength, )
121 
127  PDefH(void, ClearSelected, )
128  ImplBodyMem(tlContent, ClearSelected, )
129 
135  PDefH(IndexType, Find, const ItemType& text)
136  ImplBodyMem(tlContent, Find, text)
137 
138  PDefH(void, ResetView, )
139  ImplBodyMem(tlContent, ResetView, )
140 
147  void
148  ResizeForPreferred(const Size& sup, Size s = {});
149 
150  PDefH(void, UpdateView, )
151  ImplExpr(UI::UpdateView(tlContent))
152 };
153 
154 
159 class YF_API FileBox : public IO::FileList, public ListBox
160 {
161 public:
163  explicit
164  FileBox(const Rect& = {});
165  inline DefDeMoveCtor(FileBox)
166 
167 
170  IO::Path
171  GetPath() const;
172 
178  bool
179  SetPath(const IO::Path&);
180 };
181 
182 
188 class YF_API DropDownList : public Button
189 {
190 public:
206 
207 protected:
210 
211 public:
213  explicit
214  DropDownList(const Rect& = {}, const shared_ptr<ListType>& = {});
215  inline DefDeMoveCtor(DropDownList)
220  ~DropDownList() override;
221 
224 
225 
226  DefGetterMem(const ynothrow, const ListType&, List, lbContent)
228  DefGetterMem(ynothrow, ListType&, ListRef, lbContent)
233  DefEventGetterMem(ynothrow, HViewEvent, ViewChanged, lbContent)
238  DefEventGetterMem(ynothrow, HIndexEvent, Selected, lbContent)
243  DefEventGetterMem(ynothrow, HIndexEvent, Confirmed, lbContent)
244 
249  DefSetterMem(const shared_ptr<ListType>&, List, lbContent)
250 
257  PDefH(void, AdjustViewForContent, )
258  ImplBodyMem(lbContent, AdjustViewForContent, )
259 
260 private:
265  void
266  DetachTopWidget();
267 
268 public:
273  void
274  Refresh(PaintEventArgs&&) override;
275 };
276 
278 
279 YSL_END
280 
281 #endif
282