| 617 | } |
| 618 | |
| 619 | void EditorWidgets::serialiseWidget(WidgetContainer* _container, MyGUI::xml::ElementPtr _node, bool _compatibility) |
| 620 | { |
| 621 | MyGUI::xml::ElementPtr node = _node->createChild("Widget"); |
| 622 | |
| 623 | node->addAttribute("type", _container->getType()); |
| 624 | node->addAttribute("skin", _container->getSkin()); |
| 625 | |
| 626 | if (!_container->getRelativeMode()) |
| 627 | node->addAttribute("position", _container->position()); |
| 628 | else |
| 629 | node->addAttribute("position_real", _container->position(false)); |
| 630 | |
| 631 | if (!_container->getAlign().empty()) |
| 632 | node->addAttribute("align", _container->getAlign()); |
| 633 | |
| 634 | if (!_container->getStyle().empty()) |
| 635 | node->addAttribute("style", _container->getStyle()); |
| 636 | |
| 637 | if (!_container->getLayerName().empty()) |
| 638 | node->addAttribute("layer", _container->getLayerName()); |
| 639 | |
| 640 | if (!_container->getName().empty()) |
| 641 | node->addAttribute("name", _container->getName()); |
| 642 | |
| 643 | WidgetContainer::PropertyEnumerator propertyItem = _container->getPropertyEnumerator(); |
| 644 | while (propertyItem.next()) |
| 645 | { |
| 646 | BackwardCompatibilityManager::getInstance() |
| 647 | .serialiseProperty(node, _container->getType(), propertyItem.current(), _compatibility); |
| 648 | } |
| 649 | |
| 650 | WidgetContainer::UserDataEnumerator userData = _container->getUserDataEnumerator(); |
| 651 | while (userData.next()) |
| 652 | { |
| 653 | MyGUI::xml::ElementPtr nodeProp = node->createChild("UserString"); |
| 654 | nodeProp->addAttribute("key", userData.current().first); |
| 655 | nodeProp->addAttribute("value", userData.current().second); |
| 656 | } |
| 657 | |
| 658 | for (auto& iter : _container->mController) |
| 659 | { |
| 660 | MyGUI::xml::ElementPtr nodeController = node->createChild("Controller"); |
| 661 | nodeController->addAttribute("type", iter->mType); |
| 662 | for (auto& iterProp : iter->mProperty) |
| 663 | { |
| 664 | MyGUI::xml::ElementPtr nodeProp = nodeController->createChild("Property"); |
| 665 | nodeProp->addAttribute("key", iterProp.first); |
| 666 | nodeProp->addAttribute("value", iterProp.second); |
| 667 | } |
| 668 | } |
| 669 | |
| 670 | for (auto& childContainer : _container->childContainers) |
| 671 | { |
| 672 | serialiseWidget(childContainer, node, _compatibility); |
| 673 | } |
| 674 | } |
| 675 | |
| 676 | void EditorWidgets::loadIgnoreParameters( |
nothing calls this directly
no test coverage detected