明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2338|回复: 4

帮我阿,关于对话框的嵌套

[复制链接]
发表于 2003-11-28 01:58:00 | 显示全部楼层 |阅读模式
本帖最后由 作者 于 2003-11-28 2:27:41 编辑

小弟今日按照资料书的介绍学作对话框,程序思路是当两个对话框嵌套时,打开主对话框,然后按按钮进入子对话框,按下子对话框中ok按钮后,将这两个对话框隐藏,从屏幕上取的一个点后,返回主对话框,(子对话框不需要了)小弟试了很久就是不行,哪位老大贴一个出来给小弟作学习的例子吗?不胜感激!!

就像出图打印(plot)时的的对话框差不多的样子,先出现打的对化框然后出现小的对话框,再在屏幕上选择要打印的。就是这个思路,不知道我说明白了没有.
发表于 2003-11-28 08:28:00 | 显示全部楼层
程序文件

  1. (defun adv(dcl_id / a)
  2.   (if (not (new_dialog "test2" dcl_id)) (exit))
  3.   (action_tile "getp" "(done_dialog 2)")
  4.   (setq a (start_dialog))
  5.   a
  6. )

  7. (defun l_dlg( / dcl_id what_next pt)
  8.   (if (< (setq dcl_id (load_dialog "test")) 0) (exit))
  9.   (setq what_next 2)
  10.   (while (>= what_next 2)
  11.     (if (not (new_dialog "test1" dcl_id)) (exit))
  12.     (if pt (set_tile "txt" (strcat "坐标为:" (rtos (car pt) 2 3) "," (rtos (cadr pt) 2 3))))
  13.     (action_tile "adv" "(if (= (adv dcl_id) 2) (done_dialog 4))")
  14.     (setq what_next (start_dialog))
  15.     (if (= what_next 4) (setq pt (getpoint "\n选择点...")))   
  16.   )
  17.   (unload_dialog dcl_id)
  18.   (princ)
  19. )


对话框文件:

  1. test1:dialog{
  2.         :text{label = ""; key = "txt";}
  3.         :button{label="高级...";key = "adv";}
  4.         ok_cancel;
  5. }

  6. test2:dialog{
  7.         :button{label="点取坐标";key = "getp";}
  8.         ok_cancel;
  9. }
 楼主| 发表于 2003-11-29 18:05:00 | 显示全部楼层
谢谢斑竹,让我茅塞顿开阿。
发表于 2013-12-19 19:32:52 | 显示全部楼层
很好的例子,简洁,胜过一堆文字说明
发表于 2014-5-3 15:25:52 | 显示全部楼层
厉害。。。学习中
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-24 19:34 , Processed in 0.166645 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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