TextBox new properties

This commit is contained in:
MihailRis
2024-02-22 12:07:01 +03:00
parent cae0ceb8a3
commit c68e89038f
5 changed files with 55 additions and 0 deletions
+14
View File
@@ -228,6 +228,20 @@ static std::shared_ptr<UINode> readTextBox(UiXmlReader& reader, xml::xmlelement
);
textbox->setTextSupplier(supplier);
}
if (element->has("focused-color")) {
textbox->setFocusedColor(element->attr("focused-color").asColor());
}
if (element->has("error-color")) {
textbox->setErrorColor(element->attr("error-color").asColor());
}
if (element->has("validator")) {
auto validator = scripting::create_wstring_validator(
reader.getEnvironment().getId(),
element->attr("validator").getText(),
reader.getFilename()+".lua"
);
textbox->setTextValidator(validator);
}
return textbox;
}