Insert an item into a list at a specified position
| 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) |
nothing calls this directly
no test coverage detected