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

Method notifyActionSkin

Tools/LayoutEditor/PanelMainProperties.cpp:115–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113 }
114
115 void PanelMainProperties::notifyActionSkin(std::string_view /*_type*/, std::string_view _value, bool _final)
116 {
117 if (_final)
118 {
119 WidgetContainer* widgetContainer = EditorWidgets::getInstance().find(mCurrentWidget);
120
121 widgetContainer->setSkin(_value);
122 if (isSkinExist(widgetContainer->getSkin()) || widgetContainer->getSkin().empty())
123 {
124 WidgetSelectorManager::getInstance().saveSelectedWidget();
125
126 MyGUI::xml::Document* savedDoc = EditorWidgets::getInstance().savexmlDocument();
127 EditorWidgets::getInstance().clear();
128 EditorWidgets::getInstance().loadxmlDocument(savedDoc);
129 delete savedDoc;
130
131 WidgetSelectorManager::getInstance().restoreSelectedWidget();
132 }
133 else
134 {
135 std::string mess = MyGUI::utility::toString(
136 "Skin '",
137 widgetContainer->getSkin(),
138 "' not found. This value will be saved.");
139 GroupMessage::getInstance().addMessage(mess, MyGUI::LogLevel::Error);
140 }
141
142 UndoManager::getInstance().addValue(PR_PROPERTIES);
143 }
144 }
145
146 bool PanelMainProperties::isSkinExist(std::string_view _skinName)
147 {

Callers

nothing calls this directly

Calls 12

toStringFunction · 0.85
setSkinMethod · 0.80
getSkinMethod · 0.80
saveSelectedWidgetMethod · 0.80
savexmlDocumentMethod · 0.80
loadxmlDocumentMethod · 0.80
restoreSelectedWidgetMethod · 0.80
addMessageMethod · 0.80
addValueMethod · 0.80
findMethod · 0.45
emptyMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected