nonsmall 发表于 2010-6-14 23:54:00

[不死猫原创] 利用文字排列实现可视化DCL开发(开源)

本帖最后由 nonsmall 于 2014-9-17 14:35 编辑 <br /><br />用文字排列组合之后,经过简单的代码解析,即可实现DCL编码的可视化.
下面是完整开发思路,使用教程</p>

源码见</p>

你的代码写什么样子,DCL就是什么样子:


</p>

894560869 发表于 2019-4-12 23:20:55


高山仰止                     

未来的迷茫 发表于 2021-9-16 17:48:15

果然很大神要是能加颜色啥的就好了

趣意人生 发表于 2021-4-4 23:12:53

谢谢楼主分享,学习

asdfxx 发表于 2010-6-15 16:18:00

nonsmall 发表于 2010-6-16 10:24:00

本帖最后由 nonsmall 于 2014-9-17 14:19 编辑

测试代码和核心函数下载;nonsmall 作品 可视化DCL新思路
(defun c:tt( / dcl_id f file i stra)
    ;这里就是你要的排列样式
    (setq stra "nonsmall:dialog{label=\"可视化DCL\";" i 0)
    (setq stra (strcat stra (getdcl dcl)))
    (setq stra (strcat stra "ok_cancel;}"))   
    ;把DCL代码写出并且调用观看效果
    (setq file "d:\\test.dcl")
    (if (findfile file)
      (setq f (open "d:\\test.dcl" "w"))
      (setq f (open "d:\\test.dcl" "a"))
    )
    (write-line stra f)
    (close f)
    (setq dcl_id (load_dialog file))
    (new_dialog "nonsmall" dcl_id)
    (start_dialog)
    (unload_dialog dcl_id)
    (startapp "notepad" file)
    (princ)
)

(setq dcl '(
    ("群1-2个" "群2-3个" "群3-图")
    ("群4-其他控件")
))
(setq 群1 '(
    ("组1")
))
(setq 组1 '(
    ("单选-单选1")
    ("单选-单选2")
))
(setq 群2 '(
    ("多选-多选1")
    ("多选-多选2")
    ("多选-多选3")
))
(setq 群3 '(
    ("图像")
    ("按钮-按钮")
))
(setq 群4 '(
    ("竖滚动" "群5-嵌套")
))
(setq 群5 '(
    ("横滚动")
    ("下拉")
    ("文字-我的DCL")
))
(princ)自动生成的DCL代码如下:
nonsmall:dialog{label="可视化DCL";:row{:boxed_column{ label = "2个";:row{:column{:row{:radio_button{key = "radio3"; label = "单选1" ;}}:row{:radio_button{key = "radio4"; label = "单选2" ;}}}}}:boxed_column{ label = "3个";:row{:toggle{key = "toggle6"; label = "多选1" ;}}:row{:toggle{key = "toggle7"; label = "多选2" ;}}:row{:toggle{key = "toggle8"; label = "多选3" ;}}}:boxed_column{ label = "图";:row{:image_button{key = "list10" ;width = 18.15 ;height = 7.875 ;}}:row{:button{key = "bt11"; label = "按钮" ;}}}}:row{:boxed_column{ label = "其他控件";:row{:slider{key = "list13" ;layout = vertical ;}:boxed_column{ label = "嵌套";:row{:slider{key = "list15" ;layout = horizontal ;}}:row{:popup_list{key = "list16" ;}}:row{:text{key = "txt17"; label = "我的DCL" ;}}}}}}ok_cancel;}


nonsmall 发表于 2010-6-16 10:30:00

<p>说明:</p>
<p>本程序支持的关键词包括:</p>
<p><font color="#ff0000">按钮 输入 列表 下拉 文字 单选 多选 图像 竖滚动 横滚动 群 组</font></p>
<p>其中支持带有说明文字的:</p>
<p><font color="#ff0000">按钮-说明</font></p>
<p><font color="#ff0000">文字-说明</font></p>
<p><font color="#ff0000">单选-说明</font></p>
<p><font color="#ff0000">多选-说明</font></p>
<p><font color="#000000">群和组支持1-9个,后面也可以有说明</font></p>
<p>详见1楼的思路说明</p>

露水2 发表于 2010-6-16 10:34:00

<p>猫是花样百出啊 </p>

露水2 发表于 2010-6-16 10:36:00

nonsmall发表于2010-6-16 10:30:00static/image/common/back.gif说明:
本程序支持的关键词包括:
按钮 输入 列表 下拉 文字 单选 多选 图像 竖滚动 横滚动 群 组
其中支持带有说明文字的:
按钮-说明
文字-说明
单选-说明
多选-说明
群和组支持1-9个,后


<p></p>

黑色钢琴 发表于 2010-6-16 14:09:00

nonsmall 发表于 2010-6-17 09:50:00

本帖最后由 nonsmall 于 2014-9-17 14:30 编辑 <br /><br />黑色钢琴发表于2010-6-16 14:09:00static/image/common/back.gifDCL简单,用飞诗的制作DCL一下子就出来,没必要搞太复杂


<p>无知真可怕。</p>

hzj526 发表于 2010-6-17 19:41:00

<p>支持一下</p>

lsjj 发表于 2010-6-17 20:00:00

本帖最后由 作者 于 2010-6-17 20:50:49 编辑 <br /><br /> nonsmall发表于2010-6-17 9:50:00static/image/common/back.gifKO,liminnet,我的东西不需要你评价。
你都说过了不来明经论坛的,说话不算话。


<p>他在08年說話的語氣多謙虛啊</p>
页: [1] 2 3
查看完整版本: [不死猫原创] 利用文字排列实现可视化DCL开发(开源)