[dali-toolkit] fix set max character length when text already set
class SimpleApp : public ConnectionTracker
{
Window window;
TextField mTextField;
public:
SimpleApp(Application& application)
: mApplication(application)
{
mApplication.InitSignal().Connect(this, &SimpleApp::Create);
}
void Create(Application& application)
{
window = application.GetWindow();
window.SetBackgroundColor(Vector4(0.04f, 0.345f, 0.392f, 1.0f));
mTextField = TextField::New();
mTextField.SetBackgroundColor(Color::WHITE);
mTextField.SetProperty(TextField::Property::TEXT_COLOR, Color::BLACK);
mTextField.SetProperty(TextField::Property::TEXT, "
123456789");
mTextField.SetProperty(TextField::Property::MAX_LENGTH, 3);
mTextField.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER);
mTextField.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER);
mTextField.SetProperty(Actor::Property::SIZE, Vector2(140.f, 50.f));
mTextField.SetProperty(Actor::Property::POSITION, Vector2(0.f, 0.f));
window.Add(mTextField);
}
private:
Application& mApplication;
};
int DALI_EXPORT_API main(int argc, char** argv)
{
Application application = Application::New(&argc, &argv);
SimpleApp test(application);
application.MainLoop();
return 0;
}
Change-Id: I03ddf782eadb0d816e613aea6ef09a1133d7230e