[关闭]
@chendbdb 2017-03-03T21:57:08.000000Z 字数 915 阅读 2398

XXTouch中控UI制作

XXTouch中控


UI生成

此操作在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类型
  1. [
  2. {
  3. "type":"Label",
  4. "caption":"普通展示文字"
  5. },
  6. {
  7. "type":"Edit",
  8. "caption":"输入框",
  9. "text":"123"
  10. },
  11. {
  12. "type":"ComboBox",
  13. "caption":"下拉框",
  14. "item":["1","2","3","4","5","6","7"],
  15. "select":1
  16. },
  17. {
  18. "type":"RadioGroup",
  19. "caption":"单选框",
  20. "item":["111","222","333","444","555","666"],
  21. "select":1
  22. },
  23. {
  24. "caption":"多选框",
  25. "type":"CheckBoxGroup",
  26. "item":["aaa","bbb","ccc","ddd","eee","fff",],
  27. "select":[1]
  28. }
  29. ]

以上UI配置获取

  1. local args = proc_take("CC_args")
  2. local d = dialog()
  3. d:title('中控提交数据')
  4. for n, e in pairs(json.decode(args)) do
  5. if type(e) == "string" or type(e) == "number" then
  6. d:add_input(n,e)
  7. elseif type(e) == "table" then
  8. d:add_checkbox(n,e,e)
  9. else
  10. d:add_input(n,tostring(e))
  11. end
  12. end
  13. d:show()
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注