7 #ifndef __MYGUI_LIST_BOX_H__
8 #define __MYGUI_LIST_BOX_H__
45 size_t getItemCount() const;
48 void insertItemAt(
size_t _index, const
UString& _name,
Any _data =
Any::Null);
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>
99 ValueType* getItemDataAt(
size_t _index,
bool _throw = true)
102 return mItemsInfo[_index].second.castType<ValueType>(_throw);
110 void setItemNameAt(
size_t _index,
const UString& _name);
113 const UString& getItemNameAt(
size_t _index);
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 virtual void setPosition(
const IntPoint& _value);
166 virtual void setSize(
const IntSize& _value);
168 virtual void setCoord(
const IntCoord& _value);
171 void setPosition(
int _left,
int _top);
173 void setSize(
int _width,
int _height);
175 void setCoord(
int _left,
int _top,
int _width,
int _height);
180 int getOptimalHeight();
187 Widget* getWidgetByIndex(
size_t _index);
241 void _setItemFocus(
size_t _position,
bool _focus);
242 void _sendEventChangeScroll(
size_t _position);
245 virtual size_t _getItemCount();
247 virtual void _removeItemAt(
size_t _index);
248 virtual void _setItemNameAt(
size_t _index,
const UString& _name);
249 virtual const UString& _getItemNameAt(
size_t _index);
251 virtual void _resetContainer(
bool _update);
255 virtual void initialiseOverride();
256 virtual void shutdownOverride();
258 void onMouseWheel(
int _rel);
260 void onKeyButtonReleased(
KeyCode _key);
262 void notifyScrollChangePosition(
ScrollBar* _sender,
size_t _rel);
264 void notifyMouseDoubleClick(
Widget* _sender);
265 void notifyMouseWheel(
Widget* _sender,
int _rel);
266 void notifyMouseSetFocus(
Widget* _sender,
Widget* _old);
267 void notifyMouseLostFocus(
Widget* _sender,
Widget* _new);
270 void notifyMouseButtonReleased(
Widget* _sender,
int _left,
int _top,
MouseButton _id);
273 void updateLine(
bool _reset =
false);
274 void _setScrollView(
size_t _position);
277 void _redrawItemRange(
size_t _start = 0);
280 void _redrawItem(
size_t _index);
283 void _selectIndex(
size_t _index,
bool _select);
286 virtual size_t _getItemIndex(
Widget* _item);
288 virtual void setPropertyOverride(
const std::string& _key,
const std::string& _value);
291 void _checkMapping(
const std::string& _owner);
293 Widget* _getClientWidget();
295 size_t getIndexByWidget(
Widget* _widget);
298 std::string mSkinLine;
302 typedef std::vector<Button*> VectorButton;
303 VectorButton mWidgetLines;
309 size_t mLastRedrawLine;
314 typedef std::pair<UString, Any> PairItem;
315 typedef std::vector<PairItem> VectorItemInfo;
316 VectorItemInfo mItemsInfo;
319 bool mNeedVisibleScroll;
328 #endif // __MYGUI_LIST_BOX_H__