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

Method notifyChangeDataSelector

Tools/SkinEditor/SeparatorTextureController.cpp:41–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39 }
40
41 void SeparatorTextureController::notifyChangeDataSelector(DataPtr _data, bool _changeOnlySelection)
42 {
43 mParentData = _data;
44 if (mParentData != nullptr && mParentData->getType()->getName() != mParentTypeName)
45 mParentData = nullptr;
46
47 std::string_view texture;
48 PropertyPtr property = PropertyUtility::getPropertyByName("Skin", "Texture");
49 if (property != nullptr)
50 {
51 texture = property->getValue();
52
53 if (!property->eventChangeProperty.exist(this, &SeparatorTextureController::notifyChangeProperty))
54 property->eventChangeProperty.connect(this, &SeparatorTextureController::notifyChangeProperty);
55 }
56
57 std::string_view coord;
58 property = PropertyUtility::getPropertyByName("Skin", "Size");
59 if (property != nullptr)
60 {
61 coord = property->getValue();
62
63 if (!property->eventChangeProperty.exist(this, &SeparatorTextureController::notifyChangeProperty))
64 property->eventChangeProperty.connect(this, &SeparatorTextureController::notifyChangeProperty);
65 }
66
67 if (mParentData != nullptr)
68 {
69 for (Data::VectorData::const_iterator child = mParentData->getChilds().begin();
70 child != mParentData->getChilds().end();
71 child++)
72 {
73 if ((*child)->getType()->getName() != mThisType)
74 continue;
75
76 property = (*child)->getProperty("Offset");
77 if (!property->eventChangeProperty.exist(this, &SeparatorTextureController::notifyChangeProperty))
78 property->eventChangeProperty.connect(this, &SeparatorTextureController::notifyChangeProperty);
79
80 property = (*child)->getProperty("Visible");
81 if (!property->eventChangeProperty.exist(this, &SeparatorTextureController::notifyChangeProperty))
82 property->eventChangeProperty.connect(this, &SeparatorTextureController::notifyChangeProperty);
83 }
84 }
85
86 mControl->setTextureValue(MyGUI::UString(texture));
87 updateCoords(coord);
88 }
89
90 void SeparatorTextureController::notifyChangeProperty(PropertyPtr _sender)
91 {

Callers

nothing calls this directly

Calls 9

UStringFunction · 0.85
setTextureValueMethod · 0.80
getTypeMethod · 0.45
getValueMethod · 0.45
existMethod · 0.45
connectMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getPropertyMethod · 0.45

Tested by

no test coverage detected