15 IntCoord TextBox::getTextRegion()
const
17 return (
nullptr == getSubWidgetText()) ?
IntCoord() : getSubWidgetText()->getCoord();
20 IntSize TextBox::getTextSize()
const
22 return (
nullptr == getSubWidgetText()) ?
IntSize() : getSubWidgetText()->getTextSize();
25 void TextBox::setTextAlign(Align _value)
27 if (getSubWidgetText() !=
nullptr)
28 getSubWidgetText()->setTextAlign(_value);
31 Align TextBox::getTextAlign()
const
33 if (getSubWidgetText() !=
nullptr)
34 return getSubWidgetText()->getTextAlign();
35 return Align::Default;
38 void TextBox::setTextColour(
const Colour& _value)
40 if (
nullptr != getSubWidgetText())
41 getSubWidgetText()->setTextColour(_value);
44 const Colour& TextBox::getTextColour()
const
46 return (
nullptr == getSubWidgetText()) ? Colour::Zero : getSubWidgetText()->getTextColour();
49 void TextBox::setFontName(std::string_view _value)
51 if (
nullptr != getSubWidgetText())
52 getSubWidgetText()->setFontName(_value);
55 std::string_view TextBox::getFontName()
const
57 if (
nullptr == getSubWidgetText())
59 return getSubWidgetText()->getFontName();
62 void TextBox::setFontHeight(
int _height)
64 if (
nullptr != getSubWidgetText())
65 getSubWidgetText()->setFontHeight(_height);
68 int TextBox::getFontHeight()
const
70 return (
nullptr == getSubWidgetText()) ? 0 : getSubWidgetText()->getFontHeight();
73 void TextBox::setCaption(
const UString& _caption)
75 if (
nullptr != getSubWidgetText())
76 getSubWidgetText()->setCaption(_caption);
79 const UString& TextBox::getCaption()
const
81 if (
nullptr == getSubWidgetText())
82 return Constants::getEmptyUString();
83 return getSubWidgetText()->getCaption();
86 void TextBox::setCaptionWithReplacing(std::string_view _value)
89 size_t pos = _value.find(
"\\n");
90 if (pos == std::string::npos)
92 setCaption(LanguageManager::getInstance().replaceTags(UString(_value)));
96 std::string value(_value);
97 while (pos != std::string::npos)
101 pos = value.find(
"\\n");
103 setCaption(LanguageManager::getInstance().replaceTags(value));
107 void TextBox::setTextShadowColour(
const Colour& _value)
109 if (
nullptr != getSubWidgetText())
110 getSubWidgetText()->setShadowColour(_value);
113 const Colour& TextBox::getTextShadowColour()
const
115 return (
nullptr == getSubWidgetText()) ? Colour::Black : getSubWidgetText()->getShadowColour();
118 void TextBox::setTextShadow(
bool _value)
120 if (
nullptr != getSubWidgetText())
121 getSubWidgetText()->setShadow(_value);
124 bool TextBox::getTextShadow()
const
126 return (
nullptr == getSubWidgetText()) ? false : getSubWidgetText()->getShadow();
129 void TextBox::setPropertyOverride(std::string_view _key, std::string_view _value)
132 if (_key ==
"TextColour")
136 else if (_key ==
"TextAlign")
140 else if (_key ==
"FontName")
144 else if (_key ==
"FontHeight")
148 else if (_key ==
"Caption")
149 setCaptionWithReplacing(_value);
152 else if (_key ==
"TextShadowColour")
156 else if (_key ==
"TextShadow")
161 Base::setPropertyOverride(_key, _value);
165 eventChangeProperty(
this, _key, _value);
T parseValue(std::string_view value)
types::TCoord< int > IntCoord
types::TSize< int > IntSize