Lua: gui library supports textboxes, for numbers or strings.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2056 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2013-02-10 20:14:08 +00:00
parent ea72bfe13f
commit 495245b17d
3 changed files with 182 additions and 52 deletions

View File

@@ -12,12 +12,10 @@ local form = gui.dialog{
gui.button{ label="+",
x=6, y=38, w=14, h=14, repeatable=true, click=function()
counter.value=counter.value+1;
counter:render();
end},
gui.button{ label="-",
x=26, y=38, w=14, h=14, repeatable=true, click=function()
counter.value=counter.value-1;
counter:render();
end},
gui.button{ label="Help",
x=6, y=70, w=54, h=14, click=function()
@@ -27,6 +25,23 @@ local form = gui.dialog{
x=6, y=18, w=54, h=14, key=27, click=function()
return true; -- causes closing
end},
gui.textbox{
x=6, y=90, nbchar=8, decimal=1,
min=450, max=1450, maxchar=8, value = 1234,
change=function()
-- do nothing
end
},
gui.textbox{
x=6, y=104, nbchar=10, maxchar=20, value = "test"
},
gui.textbox{
x=6, y=118, nbchar=8, decimal=0, min=0,
maxchar=8, value = 456,
change=function()
-- do nothing
end
},
}
form:run()