22 #ifndef __MYGUI_LIST_BOX_H__
23 #define __MYGUI_LIST_BOX_H__
55 size_t getItemCount() const;
58 void insertItemAt(
size_t _index, const
UString& _name,
Any _data =
Any::Null);
64 void removeItemAt(
size_t _index);
67 void removeAllItems();
70 void swapItemsAt(
size_t _index1,
size_t _index2);
74 size_t findItemIndexWith(const
UString& _name);
85 size_t getIndexSelected() const;
88 void setIndexSelected(
size_t _index);
91 void clearIndexSelected();
102 void setItemDataAt(
size_t _index,
Any _data);
105 void clearItemDataAt(
size_t _index);
108 template <typename ValueType>
109 ValueType* getItemDataAt(
size_t _index,
bool _throw = true)
112 return mItemsInfo[_index].second.castType<ValueType>(_throw);
120 void setItemNameAt(
size_t _index,
const UString& _name);
123 const UString& getItemNameAt(
size_t _index);
134 void beginToItemAt(
size_t _index);
137 void beginToItemFirst();
140 void beginToItemLast();
143 void beginToItemSelected();
156 bool isItemVisibleAt(
size_t _index,
bool _fill =
true);
158 bool isItemSelectedVisible(
bool _fill =
true);
162 void setScrollVisible(
bool _visible);
164 void setScrollPosition(
size_t _position);
174 virtual void setPosition(
const IntPoint& _value);
176 virtual void setSize(
const IntSize& _value);
178 virtual void setCoord(
const IntCoord& _value);
181 void setPosition(
int _left,
int _top);
183 void setSize(
int _width,
int _height);
185 void setCoord(
int _left,
int _top,
int _width,
int _height);
190 int getOptimalHeight();
242 void _setItemFocus(
size_t _position,
bool _focus);
243 void _sendEventChangeScroll(
size_t _position);
246 virtual size_t _getItemCount();
248 virtual void _removeItemAt(
size_t _index);
249 virtual void _setItemNameAt(
size_t _index,
const UString& _name);
250 virtual const UString& _getItemNameAt(
size_t _index);
252 virtual void _resetContainer(
bool _update);
256 virtual void initialiseOverride();
257 virtual void shutdownOverride();
259 void onMouseWheel(
int _rel);
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 updateLine(
bool _reset =
false);
271 void _setScrollView(
size_t _position);
274 void _redrawItemRange(
size_t _start = 0);
277 void _redrawItem(
size_t _index);
280 void _selectIndex(
size_t _index,
bool _select);
283 virtual size_t _getItemIndex(
Widget* _item);
285 virtual void setPropertyOverride(
const std::string& _key,
const std::string& _value);
288 void _checkMapping(
const std::string& _owner);
290 Widget* _getClientWidget();
293 std::string mSkinLine;
297 typedef std::vector<Button*> VectorButton;
298 VectorButton mWidgetLines;
304 size_t mLastRedrawLine;
309 typedef std::pair<UString, Any> PairItem;
310 typedef std::vector<PairItem> VectorItemInfo;
311 VectorItemInfo mItemsInfo;
314 bool mNeedVisibleScroll;
323 #endif // __MYGUI_LIST_BOX_H__