@chendbdb
2017-03-03T21:57:08.000000Z
字数 915
阅读 2774
XXTouch中控
此操作在PC端中控操作实现
生成UI是以 JSON 的 JArray 格式
在菜单中 其他-->UI生成
生成脚本选择脚本会储存在脚本同目录下 脚本名.json 文件
| 类型 | 简介 | 存在的值 | 注意内容都必须填写 |
|---|---|---|---|
| Label | 标题 | caption | 内容默认是居中 |
| Edit | 输入框 | caption,text | 无 |
| ComboBox | 标题 | caption,item,select | select属于integer类型 |
| RadioGroup | 单选框 | caption,item,select | select属于integer类型 |
| CheckBoxGroup | 多选框 | caption,item,select | select属于array类型 |
[{"type":"Label","caption":"普通展示文字"},{"type":"Edit","caption":"输入框","text":"123"},{"type":"ComboBox","caption":"下拉框","item":["1","2","3","4","5","6","7"],"select":1},{"type":"RadioGroup","caption":"单选框","item":["111","222","333","444","555","666"],"select":1},{"caption":"多选框","type":"CheckBoxGroup","item":["aaa","bbb","ccc","ddd","eee","fff",],"select":[1]}]
local args = proc_take("CC_args")local d = dialog()d:title('中控提交数据')for n, e in pairs(json.decode(args)) doif type(e) == "string" or type(e) == "number" thend:add_input(n,e)elseif type(e) == "table" thend:add_checkbox(n,e,e)elsed:add_input(n,tostring(e))endendd:show()