mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.3 KiB
C++
44 lines
1.3 KiB
C++
#include "textedit.hpp"
|
|
|
|
#include "alignment.hpp"
|
|
|
|
namespace LuaUi
|
|
{
|
|
void LuaTextEdit::initialize()
|
|
{
|
|
changeWidgetSkin("LuaTextEdit");
|
|
|
|
eventEditTextChange += MyGUI::newDelegate(this, &LuaTextEdit::textChange);
|
|
|
|
WidgetExtension::initialize();
|
|
}
|
|
|
|
void LuaTextEdit::deinitialize()
|
|
{
|
|
eventEditTextChange -= MyGUI::newDelegate(this, &LuaTextEdit::textChange);
|
|
WidgetExtension::deinitialize();
|
|
}
|
|
|
|
void LuaTextEdit::updateProperties()
|
|
{
|
|
setCaption(propertyValue("text", std::string()));
|
|
setFontHeight(propertyValue("textSize", 10));
|
|
setTextColour(propertyValue("textColor", MyGUI::Colour(0, 0, 0, 1)));
|
|
setEditMultiLine(propertyValue("multiline", false));
|
|
setEditWordWrap(propertyValue("wordWrap", false));
|
|
|
|
Alignment horizontal(propertyValue("textAlignH", Alignment::Start));
|
|
Alignment vertical(propertyValue("textAlignV", Alignment::Start));
|
|
setTextAlign(alignmentToMyGui(horizontal, vertical));
|
|
|
|
setEditStatic(propertyValue("readOnly", false));
|
|
|
|
WidgetExtension::updateProperties();
|
|
}
|
|
|
|
void LuaTextEdit::textChange(MyGUI::EditBox*)
|
|
{
|
|
triggerEvent("textChanged", sol::make_object(lua(), getCaption().asUTF8()));
|
|
}
|
|
}
|