7 #ifndef __MYGUI_ITEM_BOX_H__
8 #define __MYGUI_ITEM_BOX_H__
43 size_t getItemCount() const;
46 void insertItemAt(
size_t _index,
Any _data =
Any::Null);
49 void addItem(
Any _data =
Any::Null);
52 void removeItemAt(
size_t _index);
55 void removeAllItems();
58 void redrawItemAt(
size_t _index);
61 void redrawAllItems();
68 size_t getIndexSelected() const;
71 void setIndexSelected(
size_t _index);
74 void clearIndexSelected();
81 void setItemDataAt(
size_t _index,
Any _data);
84 void clearItemDataAt(
size_t _index);
87 template <typename ValueType>
88 ValueType* getItemDataAt(
size_t _index,
bool _throw = true)
91 return mItemsInfo[_index].data.castType<ValueType>(_throw);
96 void setVerticalAlignment(
bool _value);
98 bool getVerticalAlignment()
const;
101 size_t getIndexByWidget(
Widget* _widget);
111 Widget* getWidgetByIndex(
size_t _index);
117 virtual void setPosition(
const IntPoint& _value);
119 virtual void setSize(
const IntSize& _value);
121 virtual void setCoord(
const IntCoord& _value);
124 void setPosition(
int _left,
int _top);
126 void setSize(
int _width,
int _height);
128 void setCoord(
int _left,
int _top,
int _width,
int _height);
131 void setViewOffset(
const IntPoint& _value);
190 virtual void _resetContainer(
bool _update);
193 virtual void initialiseOverride();
194 virtual void shutdownOverride();
204 virtual void onMouseButtonPressed(
int _left,
int _top,
MouseButton _id);
205 virtual void onMouseButtonReleased(
int _left,
int _top,
MouseButton _id);
206 virtual void onKeyButtonPressed(
KeyCode _key,
Char _char);
207 virtual void onKeyButtonReleased(
KeyCode _key);
208 virtual void onMouseDrag(
int _left,
int _top,
MouseButton _id);
210 virtual void onMouseWheel(
int _rel);
211 virtual void onKeyLostFocus(
Widget* _new);
212 virtual void onKeySetFocus(
Widget* _old);
216 void notifyScrollChangePosition(
ScrollBar* _sender,
size_t _index);
217 void notifyMouseWheel(
Widget* _sender,
int _rel);
218 void notifyRootMouseChangeFocus(
Widget* _sender,
bool _focus);
219 void notifyMouseButtonDoubleClick(
Widget* _sender);
220 virtual size_t _getItemIndex(
Widget* _item);
222 void notifyMouseButtonPressed(
Widget* _sender,
int _left,
int _top,
MouseButton _id);
223 void notifyMouseButtonReleased(
Widget* _sender,
int _left,
int _top,
MouseButton _id);
226 virtual void removeDropItems();
227 virtual void updateDropItems();
228 virtual void updateDropItemsState(
const DDWidgetState& _state);
231 void updateMetrics();
234 void _updateAllVisible(
bool _redraw);
236 void updateFromResize();
240 Widget* getItemWidget(
size_t _index);
242 void _setContainerItemInfo(
size_t _index,
bool _set,
bool _accept);
245 void resetCurrentActiveItem();
247 void findCurrentActiveItem();
250 virtual size_t _getContainerIndex(
const IntPoint& _point);
252 virtual void setPropertyOverride(
const std::string& _key,
const std::string& _value);
255 size_t calcIndexByWidget(
Widget* _widget);
257 void requestItemSize();
259 virtual IntSize getContentSize();
260 virtual IntPoint getContentPosition();
261 virtual void eraseContent();
262 virtual size_t getHScrollPage();
263 virtual size_t getVScrollPage();
264 virtual Align getContentAlign();
265 virtual void setContentPosition(
const IntPoint& _point);
267 IntRect _getClientAbsoluteRect();
268 Widget* _getClientWidget();
283 int mCountItemInLine;
288 int mFirstVisibleIndex;
291 int mFirstOffsetIndex;
313 std::string mDragLayer;
318 #endif // __MYGUI_ITEM_BOX_H__