7#ifndef MYGUI_LIST_BOX_H_
8#define MYGUI_LIST_BOX_H_
45 size_t getItemCount()
const;
54 void removeItemAt(
size_t _index);
57 void removeAllItems();
60 void swapItemsAt(
size_t _index1,
size_t _index2);
64 size_t findItemIndexWith(
const UString& _name);
75 size_t getIndexSelected()
const;
78 void setIndexSelected(
size_t _index);
81 void clearIndexSelected();
92 void setItemDataAt(
size_t _index,
Any _data);
95 void clearItemDataAt(
size_t _index);
98 template <
typename ValueType>
102 return mItemsInfo.at(_index).second.castType<ValueType>(_throw);
110 void setItemNameAt(
size_t _index,
const UString& _name);
113 const UString& getItemNameAt(
size_t _index)
const;
124 void beginToItemAt(
size_t _index);
127 void beginToItemFirst();
130 void beginToItemLast();
133 void beginToItemSelected();
146 bool isItemVisibleAt(
size_t _index,
bool _fill =
true);
148 bool isItemSelectedVisible(
bool _fill =
true);
152 void setScrollVisible(
bool _visible);
154 void setScrollPosition(
size_t _position);
164 void setPosition(
const IntPoint& _value)
override;
166 void setSize(
const IntSize& _value)
override;
168 void setCoord(
const IntCoord& _value)
override;
176 int getOptimalHeight()
const;
181 void setActivateOnClick(
bool activateOnClick);
188 Widget* getWidgetByIndex(
size_t _index);
242 void _setItemFocus(
size_t _position,
bool _focus);
243 void _sendEventChangeScroll(
size_t _position);
246 size_t _getItemCount()
const override;
248 void _removeItemAt(
size_t _index)
override;
249 void _setItemNameAt(
size_t _index,
const UString& _name)
override;
250 const UString& _getItemNameAt(
size_t _index)
const override;
252 void _resetContainer(
bool _update)
override;
256 void initialiseOverride()
override;
257 void shutdownOverride()
override;
259 void onMouseWheel(
int _rel)
override;
260 void onKeyButtonPressed(
KeyCode _key,
Char _char)
override;
261 void onKeyButtonReleased(
KeyCode _key)
override;
263 void notifyScrollChangePosition(
ScrollBar* _sender,
size_t _rel);
265 void notifyMouseClick(
Widget* _sender);
266 void notifyMouseDoubleClick(
Widget* _sender);
267 void notifyMouseWheel(
Widget* _sender,
int _rel);
268 void notifyMouseSetFocus(
Widget* _sender,
Widget* _old);
269 void notifyMouseLostFocus(
Widget* _sender,
Widget* _new);
272 void notifyMouseButtonReleased(
Widget* _sender,
int _left,
int _top,
MouseButton _id);
275 void updateLine(
bool _reset =
false);
277 void _activateItem(
Widget* _sender);
279 void _setScrollView(
size_t _position);
282 void _redrawItemRange(
size_t _start = 0);
285 void _redrawItem(
size_t _index);
288 void _selectIndex(
size_t _index,
bool _select);
291 size_t _getItemIndex(
Widget* _item)
const override;
293 void setPropertyOverride(
const std::string& _key,
const std::string& _value)
override;
296 void _checkMapping(
const std::string& _owner);
298 size_t getIndexByWidget(
Widget* _widget)
const;
301 std::string mSkinLine;
305 typedef std::vector<Button*> VectorButton;
306 VectorButton mWidgetLines;
308 bool mActivateOnClick;
314 size_t mLastRedrawLine;
319 typedef std::pair<UString, Any> PairItem;
320 typedef std::vector<PairItem> VectorItemInfo;
321 VectorItemInfo mItemsInfo;
324 bool mNeedVisibleScroll;
#define MYGUI_ASSERT_RANGE(index, size, owner)
#define MYGUI_RTTI_DERIVED(DerivedType)
widget description should be here.
EventHandle_ListBoxPtrCIBNotifyCellDataRef eventNotifyItem
ValueType * getItemDataAt(size_t _index, bool _throw=true) const
Get item data from specified position.
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListChangePosition
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListMouseItemFocus
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListChangeScroll
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListSelectAccept
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListMouseItemActivate
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
delegates::CMultiDelegate2< ListBox *, size_t > EventHandle_ListPtrSizeT
delegates::CMultiDelegate2< ListBox *, const IBNotifyItemData & > EventHandle_ListBoxPtrCIBNotifyCellDataRef