mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-16 18:29:55 +00:00
33 lines
704 B
C++
33 lines
704 B
C++
|
|
#include "text.hpp"
|
|
|
|
namespace LuaUi
|
|
{
|
|
LuaText::LuaText()
|
|
: mAutoSized(true)
|
|
{
|
|
changeWidgetSkin("NormalText");
|
|
}
|
|
|
|
void LuaText::updateProperties()
|
|
{
|
|
setCaption(propertyValue("caption", std::string()));
|
|
mAutoSized = propertyValue("autoSize", true);
|
|
WidgetExtension::updateProperties();
|
|
}
|
|
|
|
void LuaText::setCaption(const MyGUI::UString& caption)
|
|
{
|
|
MyGUI::TextBox::setCaption(caption);
|
|
if (mAutoSized)
|
|
updateCoord();
|
|
}
|
|
|
|
MyGUI::IntSize LuaText::calculateSize()
|
|
{
|
|
if (mAutoSized)
|
|
return getTextSize();
|
|
else
|
|
return WidgetExtension::calculateSize();
|
|
}
|
|
}
|