7 #ifndef MYGUI_LIST_BOX_H_ 8 #define MYGUI_LIST_BOX_H_ 44 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();
91 void setItemDataAt(
size_t _index,
Any _data);
95 void clearItemDataAt(
size_t _index);
98 template <
typename ValueType>
102 return mItemsInfo[_index].second.castType<ValueType>(_throw);
110 void setItemNameAt(
size_t _index,
const UString& _name);
113 const UString& getItemNameAt(
size_t _index);
123 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);
163 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();
185 void setActivateOnClick(
bool activateOnClick);
192 Widget* getWidgetByIndex(
size_t _index);
246 void _setItemFocus(
size_t _position,
bool _focus);
247 void _sendEventChangeScroll(
size_t _position);
250 virtual size_t _getItemCount();
252 virtual void _removeItemAt(
size_t _index);
253 virtual void _setItemNameAt(
size_t _index,
const UString& _name);
254 virtual const UString& _getItemNameAt(
size_t _index);
256 virtual void _resetContainer(
bool _update);
260 virtual void initialiseOverride();
261 virtual void shutdownOverride();
263 void onMouseWheel(
int _rel);
265 void onKeyButtonReleased(
KeyCode _key);
267 void notifyScrollChangePosition(
ScrollBar* _sender,
size_t _rel);
269 void notifyMouseClick(
Widget* _sender);
270 void notifyMouseDoubleClick(
Widget* _sender);
271 void notifyMouseWheel(
Widget* _sender,
int _rel);
272 void notifyMouseSetFocus(
Widget* _sender,
Widget* _old);
273 void notifyMouseLostFocus(
Widget* _sender,
Widget* _new);
276 void notifyMouseButtonReleased(
Widget* _sender,
int _left,
int _top,
MouseButton _id);
279 void updateLine(
bool _reset =
false);
281 void _activateItem(
Widget* _sender);
283 void _setScrollView(
size_t _position);
286 void _redrawItemRange(
size_t _start = 0);
289 void _redrawItem(
size_t _index);
292 void _selectIndex(
size_t _index,
bool _select);
295 virtual size_t _getItemIndex(
Widget* _item);
297 virtual void setPropertyOverride(
const std::string& _key,
const std::string& _value);
300 void _checkMapping(
const std::string& _owner);
302 Widget* _getClientWidget();
304 size_t getIndexByWidget(
Widget* _widget);
307 std::string mSkinLine;
311 typedef std::vector<Button*> VectorButton;
312 VectorButton mWidgetLines;
314 bool mActivateOnClick;
320 size_t mLastRedrawLine;
325 typedef std::pair<UString, Any> PairItem;
326 typedef std::vector<PairItem> VectorItemInfo;
327 VectorItemInfo mItemsInfo;
330 bool mNeedVisibleScroll;
339 #endif // MYGUI_LIST_BOX_H_
delegates::CMultiDelegate2< ListBox *, size_t > EventHandle_ListPtrSizeT
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListMouseItemFocus
ListBox properties. ListBox_skin_childs Skin childs. ListBox widget description should be here...
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListChangePosition
#define MYGUI_RTTI_DERIVED(DerivedType)
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListMouseItemActivate
EventHandle_ListBoxPtrCIBNotifyCellDataRef eventNotifyItem
#define MYGUI_ASSERT_RANGE(index, size, owner)
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListSelectAccept
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
EventPair< EventHandle_WidgetSizeT, EventHandle_ListPtrSizeT > eventListChangeScroll
ValueType * getItemDataAt(size_t _index, bool _throw=true)
Get item data from specified position.
delegates::CMultiDelegate2< ListBox *, const IBNotifyItemData & > EventHandle_ListBoxPtrCIBNotifyCellDataRef