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

Method insertItem

Common/PanelView/BasePanelView.h:57–75  ·  view source on GitHub ↗

Insert an item into a list at a specified position

Source from the content-addressed store, hash-verified

55
56 //! Insert an item into a list at a specified position
57 void insertItem(size_t _index, BasePanelViewItem* _item)
58 {
59 MYGUI_ASSERT_RANGE_INSERT(_index, mItems.size(), "BasePanelView::insertItem");
60
61 if (_index == MyGUI::ITEM_NONE)
62 _index = mItems.size();
63 MYGUI_ASSERT(findItem(_item) == MyGUI::ITEM_NONE, "panel allready exist");
64
65 // создаем лейаут базовой ячейки
66 BasePanelViewCell* cell = new TypeCell(mScrollView);
67 cell->eventUpdatePanel = MyGUI::newDelegate(this, &BasePanelView::notifyUpdatePanel);
68
69 // теперь основной лейаут ячейки
70 _item->_initialise(cell);
71
72 mItems.insert(mItems.begin() + _index, _item);
73 setNeedUpdate();
74 mFirstInitialise = true;
75 }
76
77 //! Add an item to the end of a list
78 void addItem(BasePanelViewItem* _item)

Callers

nothing calls this directly

Calls 5

newDelegateFunction · 0.85
sizeMethod · 0.45
_initialiseMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected