1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-16 21:59:55 +00:00
openmw/components/lua_ui/text.cpp

34 lines
704 B
C++
Raw Normal View History

2021-11-18 15:19:54 +00:00
#include "text.hpp"
namespace LuaUi
{
2021-11-19 15:21:17 +00:00
LuaText::LuaText()
: mAutoSized(true)
2022-01-28 09:31:45 +00:00
{
changeWidgetSkin("NormalText");
}
void LuaText::updateProperties()
{
setCaption(propertyValue("caption", std::string()));
mAutoSized = propertyValue("autoSize", true);
WidgetExtension::updateProperties();
}
2021-11-19 15:21:17 +00:00
2022-01-28 09:31:45 +00:00
void LuaText::setCaption(const MyGUI::UString& caption)
2021-11-18 15:19:54 +00:00
{
2022-01-28 09:31:45 +00:00
MyGUI::TextBox::setCaption(caption);
if (mAutoSized)
updateCoord();
2021-11-18 15:19:54 +00:00
}
MyGUI::IntSize LuaText::calculateSize()
{
if (mAutoSized)
return getTextSize();
else
return WidgetExtension::calculateSize();
}
}