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,
bool update =
true);
52 void removeItemAt(
size_t _index,
bool update =
true);
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>
91 return mItemsInfo[_index].data.castType<ValueType>(_throw);
96 void setVerticalAlignment(
bool _value);
98 bool getVerticalAlignment()
const;
101 size_t getIndexByWidget(
Widget* _widget)
const;
104 Widget* getWidgetDrag()
const;
111 Widget* getWidgetByIndex(
size_t _index);
117 void setPosition(
const IntPoint& _value)
override;
119 void setSize(
const IntSize& _value)
override;
121 void setCoord(
const IntCoord& _value)
override;
128 void setVisibleVScroll(
bool _value);
130 bool isVisibleVScroll()
const;
133 void setVisibleHScroll(
bool _value);
135 bool isVisibleHScroll()
const;
138 void setViewOffset(
const IntPoint& _value);
142 IntSize getViewSize()
const override;
197 void _resetContainer(
bool _update)
override;
200 void initialiseOverride()
override;
201 void shutdownOverride()
override;
211 void onMouseButtonPressed(
int _left,
int _top,
MouseButton _id)
override;
212 void onMouseButtonReleased(
int _left,
int _top,
MouseButton _id)
override;
213 void onKeyButtonPressed(
KeyCode _key,
Char _char)
override;
214 void onKeyButtonReleased(
KeyCode _key)
override;
215 void onMouseDrag(
int _left,
int _top,
MouseButton _id)
override;
217 void onMouseWheel(
int _rel)
override;
218 void onKeyLostFocus(
Widget* _new)
override;
219 void onKeySetFocus(
Widget* _old)
override;
223 void notifyScrollChangePosition(
ScrollBar* _sender,
size_t _index);
224 void notifyMouseWheel(
Widget* _sender,
int _rel);
225 void notifyRootMouseChangeFocus(
Widget* _sender,
bool _focus);
226 void notifyMouseButtonDoubleClick(
Widget* _sender);
227 size_t _getItemIndex(
Widget* _item)
const override;
229 void notifyMouseButtonPressed(
Widget* _sender,
int _left,
int _top,
MouseButton _id);
230 void notifyMouseButtonReleased(
Widget* _sender,
int _left,
int _top,
MouseButton _id);
233 void removeDropItems()
override;
234 void updateDropItems()
override;
235 void updateDropItemsState(
const DDWidgetState& _state)
override;
238 void updateMetrics();
241 void _updateAllVisible(
bool _redraw);
243 void updateFromResize();
247 Widget* getItemWidget(
size_t _index);
249 void _setContainerItemInfo(
size_t _index,
bool _set,
bool _accept)
override;
252 void resetCurrentActiveItem();
254 void findCurrentActiveItem();
257 size_t _getContainerIndex(
const IntPoint& _point)
const override;
259 void setPropertyOverride(
const std::string& _key,
const std::string& _value)
override;
262 size_t calcIndexByWidget(
Widget* _widget)
const;
264 void requestItemSize();
266 IntSize getContentSize()
const override;
267 IntPoint getContentPosition()
const override;
268 void eraseContent()
override;
269 size_t getHScrollPage()
const override;
270 size_t getVScrollPage()
const override;
271 Align getContentAlign()
const override;
272 void setContentPosition(
const IntPoint& _point)
override;
287 int mCountItemInLine;
292 int mFirstVisibleIndex;
295 int mFirstOffsetIndex;
317 std::string mDragLayer;
#define MYGUI_ASSERT_RANGE(index, size, owner)
#define MYGUI_RTTI_DERIVED(DerivedType)
widget description should be here.
widget description should be here.
EventHandle_ItemBoxPtrWidgetPtrCIBCellDrawInfoRef requestDrawItem
std::vector< ItemDataInfo > VectorItemInfo
EventHandle_ItemBoxPtrSizeT eventMouseItemActivate
EventHandle_ItemBoxPtrWidgetPtr requestCreateWidgetItem
EventHandle_ItemBoxPtrSizeT eventSelectItemAccept
ValueType * getItemDataAt(size_t _index, bool _throw=true)
Get item data from specified position.
EventHandle_ItemBoxPtrIntCoordRefBool requestCoordItem
EventHandle_ItemBoxPtrCIBNotifyCellDataRef eventNotifyItem
EventHandle_ItemBoxPtrSizeT eventChangeItemPosition
delegates::CDelegate3< ItemBox *, IntCoord &, bool > EventHandle_ItemBoxPtrIntCoordRefBool
delegates::CMultiDelegate2< ItemBox *, size_t > EventHandle_ItemBoxPtrSizeT
delegates::CDelegate2< ItemBox *, Widget * > EventHandle_ItemBoxPtrWidgetPtr
std::vector< Widget * > VectorWidgetPtr
delegates::CDelegate3< ItemBox *, Widget *, const IBDrawItemInfo & > EventHandle_ItemBoxPtrWidgetPtrCIBCellDrawInfoRef
delegates::CMultiDelegate2< ItemBox *, const IBNotifyItemData & > EventHandle_ItemBoxPtrCIBNotifyCellDataRef