You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
677 B

#include "uilineedit.h"
#include <graphics/font.h>
#include <otml/otmlnode.h>
UILineEdit::UILineEdit() : UIWidget(UITypeLabel)
{
}
UILineEditPtr UILineEdit::create()
{
UILineEditPtr lineEdit(new UILineEdit);
lineEdit->setStyle("LineEdit");
return lineEdit;
}
void UILineEdit::loadStyleFromOTML(const OTMLNodePtr& styleNode)
{
UIWidget::loadStyleFromOTML(styleNode);
m_textArea.setFont(getFont());
m_textArea.setColor(getColor());
setText(styleNode->readAt("text", getText()));
}
void UILineEdit::render()
{
UIWidget::render();
m_textArea.draw();
}
void UILineEdit::onGeometryUpdate()
{
m_textArea.setScreenCoords(getGeometry());
}