Доблен эксперементальный новый модуль - виджет TextInput.

This commit is contained in:
Alexander Zhirov 2026-01-11 22:51:25 +03:00
parent 2a8362d098
commit 79032d696e
Signed by: alexander
GPG key ID: C8D8BE544A27C511
7 changed files with 280 additions and 11 deletions

View file

@ -22,7 +22,12 @@ final class Simple : ScreenBase
override void build(ScreenContext context, Window window, WidgetContainer ui)
{
auto okBtn = new Button(3, 2, "OK", () => ScreenAction.push(new Simple()));
auto textIntput = new TextInput(5, 2, 10, "Hello");
// auto okBtn = new Button(3, 2, "OK", () => ScreenAction.push(new Simple()));
auto okBtn = new Button(3, 2, "OK", () {
textIntput.close();
return ScreenAction.quit(ScreenResult.none());
});
auto cancelBtn = new Button(3, 9, "Cancel", () => ScreenAction.pop(ScreenResult.none()));
auto disableOk = new Checkbox(4, 2,"Disable OK", false, (checked) {
@ -32,6 +37,7 @@ final class Simple : ScreenBase
_ui.add(okBtn);
_ui.add(cancelBtn);
_ui.add(disableOk);
_ui.add(textIntput);
}
override ScreenAction handleGlobal(ScreenContext context, KeyEvent event)