明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: Jack_PC

[基础] 对话框问题

  [复制链接]
 楼主| 发表于 2011-7-19 19:46:06 | 显示全部楼层
非常感谢你的热心,但是我测试还是没有通过...
发表于 2011-7-20 03:10:49 | 显示全部楼层
试试这个,可以将编辑框里的内容添加到列表框中,如列表框中已经有了,则不添加。

  1. (setq ttt "8")
  2. (setq sss "0")
  3. (setq key t)
  4. (defun t_01 ()
  5.   (setq key nil)
  6.   (setq t_1 (get_tile "t_01"))
  7.   (if (= (setq id (member t_1 s_dia_lis)) nil)
  8.     (progn      
  9.       (setq s_dia_lis (cons t_1 s_dia_lis))
  10.       (start_list "s_01" 1)
  11.       (mapcar 'add_list s_dia_lis)
  12.       (end_list)
  13.       (set_tile "s_01" "0")
  14.     )
  15.     (progn
  16.       (setq id (- (length s_dia_lis)(length id)))
  17.     (set_tile "s_01" (rtos id)))
  18.   )
  19.   (setq s_1 t_1
  20.         s_a (rtos id)
  21.         )
  22. )
  23. (defun s_01 ()
  24.   (setq s_a (get_tile "s_01"))
  25.   (setq s_1 (nth (atoi s_a) s_dia_lis))
  26.   (set_tile "t_01" s_1)
  27.   (setq t_1 s_1)
  28. )
  29. (defun c:test (/ )
  30.   (if (null t_1)
  31.     (setq t_1 ttt)(setq ttt t_1)
  32.   )
  33.   (if (null s_1)
  34.     (setq s_1 sss)(setq sss s_1)
  35.   )
  36.   (if key
  37.     (setq s_dia_lis (list "2" "4" "5" "6" "8" "10"))
  38.   )
  39.   (setvar "cmdecho" 0)
  40.   (setq dcl_id (load_dialog "test"))
  41.   (new_dialog "test" dcl_id)  
  42.   (set_tile "t_01" t_1)  
  43.   (set_tile "s_01" s_a)
  44.   (start_list "s_01")
  45.   (mapcar 'add_list s_dia_lis)
  46.   (end_list)
  47.   (action_tile "s_01" "(s_01)")
  48.   (action_tile "t_01" "(t_01)")  
  49.   (action_tile "cancel" "(done_dialog 0)")
  50.   (setq what (start_dialog))
  51.   (cond        ((= 1 what) (t01))
  52.         ((= 2 what) (t02))
  53.   )
  54.   (setvar "cmdecho" 1)
  55.   (princ)
  56. )
 楼主| 发表于 2011-7-20 18:54:54 | 显示全部楼层
zhynt 发表于 2011-7-20 03:10
试试这个,可以将编辑框里的内容添加到列表框中,如列表框中已经有了,则不添加。

目前我感到还是比较复杂,还没有完全看明白
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-10 02:16 , Processed in 0.144787 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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