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

Method onChangeData

Tools/EditorFramework/DataSelectorManager.cpp:75–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

73 }
74
75 void DataSelectorManager::onChangeData(DataPtr _parent, DataTypePtr _type, bool _changeOnlySelection)
76 {
77 EventType* event = getEvent(_type->getName());
78 if (event != nullptr)
79 {
80 event->operator()(_parent, _changeOnlySelection);
81 }
82
83 DataPtr childSelected = nullptr;
84 if (_parent != nullptr)
85 childSelected = _parent->getChildSelected();
86
87 const DataType::VectorString& childs = _type->getChilds();
88 for (const auto& childName : childs)
89 {
90 DataTypePtr childType = DataTypeManager::getInstance().getType(childName);
91 if (childType != nullptr)
92 {
93 DataPtr child = childSelected;
94 if (child != nullptr && child->getType() != childType)
95 child = nullptr;
96
97 if (child != nullptr)
98 {
99 DataPtr subChildSelected = child->getChildSelected();
100 if (subChildSelected == nullptr)
101 {
102 if (!child->getChilds().empty())
103 {
104 DataPtr childData = child->getChildByIndex(0);
105 child->setChildSelected(childData);
106 }
107 }
108 }
109
110 onChangeData(child, childType, false);
111 }
112 }
113 }
114
115}

Callers

nothing calls this directly

Calls 6

getChildSelectedMethod · 0.80
getChildByIndexMethod · 0.80
setChildSelectedMethod · 0.80
operator()Method · 0.45
getTypeMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected