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

Method notifyChangeScope

Tools/ImageEditor/FrameTextureController.cpp:115–160  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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