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

Method notifyChangeScope

Tools/SkinEditor/StateTextureController.cpp:125–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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