明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1046|回复: 1

[源码] 不知道怎么回事,无法回复,发个帖试试

[复制链接]
发表于 2014-6-8 19:19 | 显示全部楼层 |阅读模式
  1. (defun CreateDclNeedStrings (DlgName  KeyName  AssoLst        StIndex
  2.                              TileWid  /               RetuLst        SpTile0
  3.                              l              m               n        r0
  4.                              SomItem  r1
  5.                             )
  6.   (setq        RetuLst        (list
  7.                   (strcat DlgName ":dialog{label = \"秋寒工具\";")
  8.                   "//---------------------------------------------------------------------------------//"
  9.                   (strcat
  10.                     "my_image_button:button{fixed_width = true;fixed_height = true;width = "
  11.                     (itoa TileWid)
  12.                     ";}"
  13.                   )
  14.                 )
  15.         SpTile0        (strcat ":spacer{width = " (itoa TileWid) ";}")
  16.         SpTile1        (strcat ":spacer{width = " (itoa (* TileWid 5)) ";}")
  17.         l        StIndex
  18.         m        0
  19.         n        0
  20.   )
  21.   (repeat (length AssoLst)
  22.     (if        (= (setq r0 (rem m 3)) 0)
  23.       (setq RetuLst (cons ":row{" RetuLst))
  24.     )
  25.     (setq SomItem (nth m AssoLst))
  26.     (setq RetuLst (cons        (strcat        ":boxed_column{label = "
  27.                                 (vl-prin1-to-string (car SomItem))
  28.                                 ";"
  29.                         )
  30.                         RetuLst
  31.                   )
  32.     )
  33.     (repeat (cdr SomItem)
  34.       (if (= (setq r1 (rem n 4)) 0)
  35.         (setq RetuLst (cons ":row{" RetuLst))
  36.       )
  37.       (setq RetuLst (cons
  38.                       (strcat ":my_image_button{key = "
  39.                               (vl-prin1-to-string (strcat KeyName (itoa l)))
  40.                               ";"
  41.                       )
  42.                       RetuLst
  43.                     )
  44.             RetuLst (cons
  45.                       (strcat "label = "
  46.                               (vl-prin1-to-string (strcat KeyName (itoa l)))
  47.                               ";}"
  48.                       )
  49.                       RetuLst
  50.                     )
  51.       )
  52.       (if (= r1 3)
  53.         (setq RetuLst (cons "}" RetuLst))
  54.       )
  55.       (setq n (1+ n)
  56.             l (1+ l)
  57.       )
  58.     )
  59.     (cond ((= r1 1)
  60.            (setq RetuLst (cons SpTile0 (cons SpTile0 RetuLst)))
  61.           )
  62.           ((= r1 2) (setq RetuLst (cons SpTile0 RetuLst)))
  63.           (t nil)
  64.     )
  65.     (if        (/= r1 3)
  66.       (setq RetuLst (cons "}" RetuLst))
  67.     )
  68.     ;;对应:boxed_column{...}
  69.     (setq RetuLst (cons "}" RetuLst))
  70.     (if        (= r0 2)
  71.       (setq RetuLst (cons "}" RetuLst))
  72.     )
  73.     (setq m (1+ m)
  74.           n 0
  75.     )
  76.   )
  77.   (cond        ((= r0 1) (setq RetuLst (cons SpTile1 RetuLst)))
  78.         ((= r0 0)
  79.          (setq RetuLst (cons SpTile1 (cons SpTile1 RetuLst)))
  80.         )
  81.         (t nil)
  82.   )
  83.   (if (/= r0 2)
  84.     (setq RetuLst (cons "}" RetuLst))
  85.   )
  86.   ;;图像按钮方框组定义结束
  87.   ;;添加ok_cancel预定义方框组
  88.   (setq RetuLst (cons "ok_cancel;" RetuLst))
  89.   ;;对应:dialog{...}
  90.   (setq RetuLst (cons "}" RetuLst))
  91.   (cons        "//-----制作:秋  寒-----//"
  92.         (mapcar        (function (lambda (x) (strcat "\n" x)))
  93.                 (reverse RetuLst)
  94.         )
  95.   )
  96. )
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2014-6-8 20:56 | 显示全部楼层
可以回复啊。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-20 05:19 , Processed in 0.199320 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表