MCPcopy Create free account
hub / github.com/MyGUI/mygui / insertItemAt

Method insertItemAt

MyGUIEngine/src/MyGUI_ItemBox.cpp:324–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Calls 4

ItemDataInfoClass · 0.85
sizeMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected