Extend Auto 4 Lua config dialogues test case to cover most interesting cases of controls.

Updates #775 and #776 since they need those cases.

Originally committed to SVN as r2911.
This commit is contained in:
Niels Martin Hansen 2009-05-12 15:24:07 +00:00
parent 05e847b6d2
commit 28d4ed7c8a
1 changed files with 24 additions and 2 deletions

View File

@ -12,7 +12,28 @@ function test7(subtitles, selected_lines, active_line)
local a, b = aegisub.dialog.display({{class="label", label="Test..."}}, {}) local a, b = aegisub.dialog.display({{class="label", label="Test..."}}, {})
report_dialog_result(a, b) report_dialog_result(a, b)
aegisub.progress.set(50) aegisub.progress.set(50)
a, b = aegisub.dialog.display({{class="edit", name="foo", text=""}}, {"foo", "bar"}) a, b = aegisub.dialog.display(
{
{class="edit", name="foo", text="", x=0, y=0},
{class="intedit", name="e1", value=20, x=0, y=1},
{class="intedit", name="e2", value=30, min=10, max=50, x=1, y=1},
{class="floatedit", name="e3", value=19.95, x=0, y=2},
{class="floatedit", name="e4", value=123.63423, min=-4.3, max=2091, x=1, y=2},
{class="floatedit", name="e5", value=-4, step=0.21, x=2, y=2},
{class="floatedit", name="e6", value=22, min=0, max=100, step=1.4, x=3, y=2},
{class="textbox", name="e7", text="hmm wuzzis say?", x=0, y=3, width=4},
{class="dropdown", name="l1", items={"abc", "def", "ghi"}, value="def", x=0, y=4},
{class="dropdown", name="l2", items={"abc", "def", "ghi"}, value="doesnotexist", x=1, y=4},
{class="checkbox", name="b1", value=true, label='checked', x=0, y=5},
{class="checkbox", name="b2", value=false, label='cleared', x=1, y=5},
{class="color", name="c1", value="#00ff11", x=0, y=6},
{class="color", name="c2", value="&H0011ff00", x=1, y=6},
{class="coloralpha", name="c3", value="#aabbccdd", x=0, y=7},
{class="coloralpha", name="c4", value="&Hddccbbaa&", x=1, y=7},
{class="alpha", name="c5", value="#12", x=0, y=8},
{class="alpha", name="c6", value="&H12&", x=1, y=8}
},
{"foo", "bar"})
report_dialog_result(a, b) report_dialog_result(a, b)
end end
@ -26,7 +47,8 @@ function report_dialog_result(button, controls)
aegisub.debug.out("clicked '" .. button .. "'\n") aegisub.debug.out("clicked '" .. button .. "'\n")
end end
for key, val in pairs(controls) do for key, val in pairs(controls) do
aegisub.debug.out(key .. ': ' .. val .. '\n') local printable = (val == true and "true") or (val == false and "false") or tostring(val)
aegisub.debug.out("%s: %s\n", key, printable)
end end
aegisub.debug.out(" - - - - -\n") aegisub.debug.out(" - - - - -\n")
end end