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

Method tryToApplyProperty

Tools/LayoutEditor/EditorWidgets.cpp:579–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

577 }
578
579 bool EditorWidgets::tryToApplyProperty(
580 MyGUI::Widget* _widget,
581 std::string_view _key,
582 std::string_view _value,
583 bool _testMode)
584 {
585 WidgetContainer* container = EditorWidgets::getInstance().find(_widget);
586 if (container->existUserData("LE_TargetWidgetType"))
587 return true;
588
589 try
590 {
591 if (_key == "Image_Texture")
592 {
593 std::string value{_value};
594 if (!MyGUI::DataManager::getInstance().isDataExist(value))
595 {
596 GroupMessage::getInstance().addMessage(
597 "No such " + std::string{_key} + ": '" + value + "'. This value will be saved.",
598 MyGUI::LogLevel::Warning);
599 return true;
600 }
601 }
602
603 if (_testMode ||
604 std::find(mIgnoreParameters.begin(), mIgnoreParameters.end(), _key) == mIgnoreParameters.end())
605 {
606 _widget->setProperty(_key, _value);
607 }
608 }
609 catch (...)
610 {
611 GroupMessage::getInstance().addMessage(
612 "Can't apply '" + std::string{_key} + "'property.",
613 MyGUI::LogLevel::Error);
614 return false;
615 }
616 return true;
617 }
618
619 void EditorWidgets::serialiseWidget(WidgetContainer* _container, MyGUI::xml::ElementPtr _node, bool _compatibility)
620 {

Callers 1

notifyActionMethod · 0.80

Calls 7

existUserDataMethod · 0.80
addMessageMethod · 0.80
findMethod · 0.45
isDataExistMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
setPropertyMethod · 0.45

Tested by

no test coverage detected