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

Method notifyChangeScope

Tools/ImageEditor/IndexTextureController.cpp:101–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

99 }
100
101 void IndexTextureController::notifyChangeScope(std::string_view _scope)
102 {
103 if (mControl == nullptr)
104 return;
105
106 if (_scope == mScopeName)
107 {
108 if (!mActivated)
109 {
110 mControl->clearAll();
111
112 DataSelectorManager::getInstance()
113 .getEvent(mParentTypeName)
114 ->connect(this, &IndexTextureController::notifyChangeDataSelector);
115 mParentData = DataUtility::getSelectedDataByType(mParentTypeName);
116 notifyChangeDataSelector(mParentData, false);
117
118 mControl->getRoot()->setUserString("CurrentScopeController", mScopeName);
119
120 mActivated = true;
121 }
122 }
123 else
124 {
125 if (mActivated)
126 {
127 DataSelectorManager::getInstance().getEvent(mParentTypeName)->disconnect(this);
128 mParentData = nullptr;
129
130 // мы еще владельцы контрола сбрасываем его
131 std::string_view value = mControl->getRoot()->getUserString("CurrentScopeController");
132 if (value == mScopeName)
133 {
134 mControl->getRoot()->setUserString("CurrentScopeController", std::string_view{});
135 notifyChangeDataSelector(mParentData, false);
136
137 mControl->clearAll();
138 }
139
140 mActivated = false;
141 }
142 }
143 }
144
145 void IndexTextureController::updateCoords(std::string_view _value)
146 {

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