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

Method printWidgetDeclaration

Tools/LayoutEditor/CodeGenerator.cpp:99–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

97 }
98
99 void CodeGenerator::printWidgetDeclaration(WidgetContainer* _container, std::ofstream& _stream)
100 {
101 if (!_container->getName().empty() && _container->getName() != "_Main")
102 {
103 MyGUI::LanguageManager& lm = MyGUI::LanguageManager::getInstance();
104 lm.addUserTag("Widget_Name", _container->getName());
105 lm.addUserTag("Widget_Type", _container->getType());
106 for (auto& templateString : mTemplateStrings)
107 {
108 lm.addUserTag(templateString.first, lm.replaceTags(templateString.second));
109 }
110 std::string declaration = lm.getTag("Widget_Declaration");
111 while (declaration.find("\\n") != std::string::npos)
112 declaration.replace(declaration.find("\\n"), 2, "\n");
113 _stream << declaration;
114 }
115
116 for (const auto& childContainer : _container->childContainers)
117 {
118 printWidgetDeclaration(childContainer, _stream);
119 }
120 }
121
122 void CodeGenerator::notifyGeneratePressed(MyGUI::Widget* _sender)
123 {

Callers

nothing calls this directly

Calls 6

addUserTagMethod · 0.80
replaceTagsMethod · 0.80
getTagMethod · 0.80
emptyMethod · 0.45
getTypeMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected