| 322 | } |
| 323 | |
| 324 | void ItemBox::insertItemAt(size_t _index, Any _data, bool update) |
| 325 | { |
| 326 | MYGUI_ASSERT_RANGE_INSERT(_index, mItemsInfo.size(), "ItemBox::insertItemAt"); |
| 327 | if (_index == ITEM_NONE) |
| 328 | _index = mItemsInfo.size(); |
| 329 | |
| 330 | _resetContainer(false); |
| 331 | resetCurrentActiveItem(); |
| 332 | |
| 333 | mItemsInfo.insert(mItemsInfo.begin() + _index, ItemDataInfo(_data)); |
| 334 | |
| 335 | // расчитываем новый индекс выделения |
| 336 | if (mIndexSelect != ITEM_NONE) |
| 337 | { |
| 338 | if (mIndexSelect >= _index) |
| 339 | { |
| 340 | mIndexSelect++; |
| 341 | } |
| 342 | } |
| 343 | |
| 344 | if (update) |
| 345 | { |
| 346 | updateScrollSize(); |
| 347 | updateScrollPosition(); |
| 348 | |
| 349 | findCurrentActiveItem(); |
| 350 | |
| 351 | _updateAllVisible(true); |
| 352 | } |
| 353 | } |
| 354 | |
| 355 | void ItemBox::removeItemAt(size_t _index, bool update) |
| 356 | { |
no test coverage detected