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

Method setCaptionWithReplacing

MyGUIEngine/src/MyGUI_TextBox.cpp:86–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84 }
85
86 void TextBox::setCaptionWithReplacing(std::string_view _value)
87 {
88 // replace "\\n" with char '\n'
89 size_t pos = _value.find("\\n");
90 if (pos == std::string::npos)
91 {
92 setCaption(LanguageManager::getInstance().replaceTags(UString(_value)));
93 }
94 else
95 {
96 std::string value(_value);
97 while (pos != std::string::npos)
98 {
99 value[pos++] = '\n';
100 value.erase(pos, 1);
101 pos = value.find("\\n");
102 }
103 setCaption(LanguageManager::getInstance().replaceTags(value));
104 }
105 }
106
107 void TextBox::setTextShadowColour(const Colour& _value)
108 {

Calls 5

setCaptionFunction · 0.85
UStringFunction · 0.85
replaceTagsMethod · 0.80
findMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected