明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1405|回复: 1

[求助]dcl对话框

[复制链接]
发表于 2007-2-15 19:52 | 显示全部楼层 |阅读模式

第一次已在对话框中填了多项数据,第二次使用对话框时所有的编辑栏都是空白,但第一次填的数据大部分可重复利用,为省事,用什么方法可让第一次填入的数据在第二次调用对话框时在编辑栏内全部显示并可用,只对不同的数据进行修改即可?
已编的函数如下:
(defun c:cp()
       (setvar"cmdecho" 0) 
       (setq dcl_id (load_dialog "cp"))
       (new_dialog "cp" dcl_id)
       (ACTION_TILE "accept" "(cxh) (DONE_DIALOG)")
       (START_DIALOG)
       (command "_pline" (list x1 y1) (list x2 y2) "")
)


(defun cxh()
       (setq k (get_tile "k"))
       (setq x1 (atof (get_tile "x1")))
       (setq y1 (atof (get_tile "y1")))
       (setq x2 (atof (get_tile "x2")))
       (setq y2 (atof (get_tile "y2")))
)

cp:dialog{
       :row{
           :boxed_column{
             :row{
                  :edit_box{label="位置";key="K" ; edit_width=13;
                 }}
           }}
       :row{
           :boxed_column{
            :text{
                  label="            X   Y";
                  alignment=centered;
                 }
             :row{
                  :edit_box{label="坐  标 1   ";key="x1" ; edit_width=5;
                           }
                  :edit_box{label="";key="y1" ; edit_width=4;
                           }
                 }
             :row{
                  :edit_box{label="坐  标 2   ";key="x2" ; edit_width=5;
                           }
                  :edit_box{label="";key="y2" ; edit_width=4;
                           }
                 }}
           }
                 spacer_1;
                 ok_cancel;
       }

"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2007-2-15 22:06 | 显示全部楼层

lsp

改动了一下lsp部分程序:用一个全局变量rt记录填写的值.
  1. (defun c:cp()
  2.        (setvar"cmdecho" 0)  
  3.        (setq dcl_id (load_dialog "cp"))
  4.        (new_dialog "cp" dcl_id)
  5.   (if (and rt (= (length rt) 5) (not (member nil rt)))
  6.     (progn
  7.       (set_tile "K" (nth 0 rt))
  8.       (set_tile "x1" (nth 1 rt))
  9.       (set_tile "y1" (nth 2 rt))
  10.       (set_tile "x2" (nth 3 rt))
  11.       (set_tile "y2" (nth 4 rt))
  12.     )
  13.   )
  14.        (ACTION_TILE "accept" "(setq rt (cxh)) (DONE_DIALOG)")
  15.        (START_DIALOG)
  16.        (command "_pline" (list x1 y1) (list x2 y2) "")
  17. )
  18. (defun cxh()
  19.        (setq k (get_tile "K"))
  20.        (setq x1 (atof (get_tile "x1")))
  21.        (setq y1 (atof (get_tile "y1")))
  22.        (setq x2 (atof (get_tile "x2")))
  23.        (setq y2 (atof (get_tile "y2")))
  24.   (list (get_tile "K")
  25. (get_tile "x1")
  26. (get_tile "y1")
  27. (get_tile "x2")
  28. (get_tile "y2")
  29. )
  30. )
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-5-18 06:10 , Processed in 0.204843 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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