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

Method insertChild

Tools/EditorFramework/Data.cpp:69–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

67 }
68
69 void Data::insertChild(size_t _index, DataPtr _child)
70 {
71 MYGUI_ASSERT(_child != nullptr, "Child is nullptr");
72 MYGUI_ASSERT(_child->getParent() == nullptr, "Child already attached");
73 MYGUI_ASSERT(_child->getType() != nullptr, "Type not found");
74 MYGUI_ASSERT(getType() != nullptr, "Type not found");
75 MYGUI_ASSERT(getType()->isChild(_child->getType()->getName()), "Type is not child");
76
77 MYGUI_ASSERT_RANGE_INSERT(_index, mChilds.size(), "Data::insertChild");
78
79 if (_index == MyGUI::ITEM_NONE)
80 _index = mChilds.size();
81
82 mChilds.insert(mChilds.begin() + _index, _child);
83 _child->mParent = mWeakThis.lock();
84 }
85
86 void Data::addChild(DataPtr _child)
87 {

Callers 3

doActionMethod · 0.80
undoActionMethod · 0.80
undoActionMethod · 0.80

Calls 7

isChildMethod · 0.80
getParentMethod · 0.45
getTypeMethod · 0.45
sizeMethod · 0.45
insertMethod · 0.45
beginMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected