-- test code for Lua<->DFUI binding.
-- $Id: test.lua,v 1.5 2004/08/04 17:29:03 cpressey Exp $

print("DFUIConnection=", DFUIConnection)
c = DFUIConnection.new("tcp", "9999")
print("c=", c)
r = c:start()
print("c:start()=", r)
r = c:present({
	id = "test",
	name = "Test Form",
	short_desc = "This is a test form.  Enter your birthdate in the fields provided below.",
	actions = {
		{ id = "ok", name = "OK", short_desc = "Accept and Close" },
		{ id = "cancel", name = "Cancel", short_desc = "Decline and Revert" }
	},
	fields = {
		{ id = "year", name = "Year", short_desc = "Enter your year of birth" },
		{ id = "month", name = "Month", short_desc = "Enter your month of birth" },
		{ id = "day", name = "Day", short_desc = "Enter your day of birth" }
	},
	datasets = {
		{ year = "1967", month = "04", day = "23" }
	}
})
print("c:present()=", r)
print("r.form_id=", r.form_id)
print("r.action_id=", r.action_id)
print("r.datasets=", r.datasets)
for i = 1, table.getn(r.datasets) do
	print("", i)
	for k,v in r.datasets[i] do
		print("", "", k, v)
	end
end
r = c:stop()
print("c:stop()=", r)
