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

Method notifyChangeScope

Tools/SkinEditor/SeparatorTextureController.cpp:126–171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

124 }
125
126 void SeparatorTextureController::notifyChangeScope(std::string_view _scope)
127 {
128 if (mControl == nullptr)
129 return;
130
131 if (_scope == mScopeName)
132 {
133 if (!mActivated)
134 {
135 mControl->eventChangeValue.connect(this, &SeparatorTextureController::notifyChangeValue);
136 mControl->clearAll();
137
138 DataSelectorManager::getInstance()
139 .getEvent(mParentTypeName)
140 ->connect(this, &SeparatorTextureController::notifyChangeDataSelector);
141 mParentData = DataUtility::getSelectedDataByType(mParentTypeName);
142 notifyChangeDataSelector(mParentData, false);
143
144 mControl->getRoot()->setUserString("CurrentScopeController", mScopeName);
145
146 mActivated = true;
147 }
148 }
149 else
150 {
151 if (mActivated)
152 {
153 mControl->eventChangeValue.disconnect(this);
154
155 DataSelectorManager::getInstance().getEvent(mParentTypeName)->disconnect(this);
156 mParentData = nullptr;
157
158 // мы еще владельцы контрола сбрасываем его
159 std::string_view value = mControl->getRoot()->getUserString("CurrentScopeController");
160 if (value == mScopeName)
161 {
162 mControl->getRoot()->setUserString("CurrentScopeController", std::string_view{});
163 notifyChangeDataSelector(mParentData, false);
164
165 mControl->clearAll();
166 }
167
168 mActivated = false;
169 }
170 }
171 }
172
173 void SeparatorTextureController::updateCoords(std::string_view _value)
174 {

Callers

nothing calls this directly

Calls 7

clearAllMethod · 0.80
setUserStringMethod · 0.80
getUserStringMethod · 0.80
connectMethod · 0.45
getEventMethod · 0.45
getRootMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected