明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2289|回复: 5

【对话框】 如何在二级对话框返回到一级对话框?(已解决)

[复制链接]
发表于 2012-2-24 12:07:51 | 显示全部楼层 |阅读模式
本帖最后由 qcw911 于 2012-2-24 14:02 编辑
  1. (defun c:dlg ()
  2. (setq dcl_id (load_dialog "dlg.dcl"))
  3. (setq do_what 2)
  4. (while (>= do_what 2)
  5. (if (= null (new_dialog "dlg" dcl_id))
  6. (progn
  7. (princ "\n没有对话框")
  8. (setq dialogshow nil)
  9. (exit)
  10. ) ;_ end of progn
  11. ) ;_ end of if
  12. (action_tile "button_A" "(done_dialog 1)")
  13. (action_tile "button_B" "(done_dialog 2)")
  14. (action_tile "button_C" "(done_dialog 3)")
  15. (action_tile "button_T" "(done_dialog 4)")
  16. ;;; (action_tile "accept" "(done_dialog 1)")
  17. (setq do_what (start_dialog))
  18. (cond
  19. ((= do_what 1)
  20. (next1)
  21. )
  22. ((= do_what 2)
  23. (next2)
  24. )
  25. ((= do_what 3)
  26. (next3)
  27. )
  28. ((= do_what 4)
  29. (next4)
  30. )
  31. ;;; ((= do_what 5)
  32. ;;; (next5)
  33. ;;; )
  34. ) ;_ end of cond
  35. ) ;_ end of while
  36. (unload_dialog dcl_id)
  37. ) ;_ end of defun
  38. (defun next1 ()
  39. (new_dialog "dlg_A" dcl_id)
  40. (action_tile "A_1" "(done_dialog 1)")
  41. (action_tile "return" "(done_dialog 2)(load_dialog dlg)")
  42. (setq dial (start_dialog))
  43. (if (= dial 1)
  44. ;;; (alert "调用A")
  45. (command "line" (getpoint) (getpoint) "")
  46. ) ;_ end of if
  47. ;;; (unload_dialog dcl_i)
  48. ) ;_ end of defun
  49. (defun next2 ()
  50. (new_dialog "dlg_B" dcl_id)
  51. (action_tile "B_1" "(done_dialog 1)")
  52. (setq dial (start_dialog))
  53. (if (= dial 1)
  54. (alert "调用B")
  55. ) ;_ end of if
  56. ;;; (unload_dialog dcl_i)
  57. )
  58. (defun next3 ()
  59. (new_dialog "dlg_C" dcl_id)
  60. (action_tile "C_1" "(done_dialog 1)")
  61. (setq dial (start_dialog))
  62. (if (= dial 1)
  63. (alert "调用C")
  64. ) ;_ end of if
  65. ;;; (unload_dialog dcl_i)
  66. )
  67. (defun next4 ()
  68. (new_dialog "dlg_T" dcl_id)
  69. (action_tile "T_1" "(done_dialog 1)")
  70. (setq dial (start_dialog))
  71. (if (= dial 1)
  72. (alert "调用T")
  73. ) ;_ end of if
  74. ;;; (unload_dialog dcl_i)
  75. )
  1. dlg:dialog {
  2.     label = "lixil    qiuw1" ;
  3.     :row {
  4.         label = "商品样式" ;
  5.         :column {
  6.             :button {
  7.                 height = 3 ;
  8.                 key = "button_A" ;
  9.                 label = "A样式..." ;
  10.                 width = 20 ;
  11.             }
  12.             :button {
  13.                 height = 3 ;
  14.                 key = "button_B" ;
  15.                 label = "B样式..." ;
  16.                 width = 20 ;
  17.             }
  18.         }
  19.         :column {
  20.             :button {
  21.                 height = 3 ;
  22.                 key = "button_C" ;
  23.                 label = "C样式..." ;
  24.                 width = 20 ;
  25.             }
  26.             :button {
  27.                 height = 3 ;
  28.                 key = "button_T" ;
  29.                 label = "其他..." ;
  30.                 width = 20 ;
  31.             }
  32.         }
  33.     }
  34.     cancel_button;
  35. }

  36. dlg_A:dialog {
  37.     label = "A样式" ;
  38.     :row {
  39.         :column {
  40.             :text {
  41.                 label = "A-1样式" ;
  42.             }
  43.             :image_button {
  44.                 color = black ;
  45.                 height = 10 ;
  46.                 key = "A_1" ;
  47.                 width = 30 ;
  48.             }
  49.         }
  50.         :column {
  51.             :text {
  52.                 label = "A-2样式" ;
  53.             }
  54.             :image_button {
  55.                 color = black ;
  56.                 height = 10 ;
  57.                 key = "A_2" ;
  58.                 width = 30 ;
  59.             }
  60.         }
  61.     }
  62.     :row {
  63.         :column {
  64.             :text {
  65.                 label = "A-3样式" ;
  66.             }
  67.             :image_button {
  68.                 color = black ;
  69.                 height = 10 ;
  70.                 key = "A_3" ;
  71.                 width = 30 ;
  72.             }
  73.         }
  74.         :column {
  75.             :text {
  76.                 label = "A-4样式" ;
  77.             }
  78.             :image_button {
  79.                 color = black ;
  80.                 height = 10 ;
  81.                 key = "A_4" ;
  82.                 width = 30 ;
  83.             }
  84.         }
  85.     }
  86.     :button {
  87.              key = "return";
  88.              label = "返回";
  89.              height = 3;
  90.              }
  91.     spacer_1;
  92.     cancel_button;
  93. }

  94. dlg_B:dialog {
  95.     label = "B样式" ;
  96.     :row {
  97.         :column {
  98.             :text {
  99.                 label = "B-1样式" ;
  100.             }
  101.             :image_button {
  102.                 color = black ;
  103.                 height = 10 ;
  104.                 key = "B_1" ;
  105.                 width = 30 ;
  106.             }
  107.         }
  108.         :column {
  109.             :text {
  110.                 label = "B-2样式" ;
  111.             }
  112.             :image_button {
  113.                 color = black ;
  114.                 height = 10 ;
  115.                 key = "B_2" ;
  116.                 width = 30 ;
  117.             }
  118.         }
  119.         :column {
  120.             :text {
  121.                 label = "B-3样式" ;
  122.             }
  123.             :image_button {
  124.                 color = black ;
  125.                 height = 10 ;
  126.                 key = "B_3" ;
  127.                 width = 30 ;
  128.             }
  129.         }
  130.     }
  131.     :row {
  132.         :column {
  133.             :text {
  134.                 label = "B-4样式" ;
  135.             }
  136.             :image_button {
  137.                 color = black ;
  138.                 height = 10 ;
  139.                 key = "B_4" ;
  140.                 width = 30 ;
  141.             }
  142.         }
  143.         :column {
  144.             :text {
  145.                 label = "B-5样式" ;
  146.             }
  147.             :image_button {
  148.                 color = black ;
  149.                 height = 10 ;
  150.                 key = "B_5" ;
  151.                 width = 30 ;
  152.             }
  153.         }
  154.         :column {
  155.             :text {
  156.                 label = "B-6样式" ;
  157.             }
  158.             :image_button {
  159.                 color = black ;
  160.                 height = 10 ;
  161.                 key = "B_6" ;
  162.                 width = 30 ;
  163.             }
  164.         }
  165.     }
  166.         :button {
  167.              key = "return";
  168.              label = "返回";
  169.              height = 3;
  170.              }
  171.     spacer_1;
  172.     cancel_button;
  173. }

  174. dlg_C:dialog {
  175.     label = "C样式" ;
  176.     :row {
  177.         :column {
  178.             :text {
  179.                 label = "C-1样式" ;
  180.             }
  181.             :image_button {
  182.                 color = black ;
  183.                 height = 10 ;
  184.                 key = "C_1" ;
  185.                 width = 30 ;
  186.             }
  187.         }
  188.         :column {
  189.             :text {
  190.                 label = "C-2样式" ;
  191.             }
  192.             :image_button {
  193.                 color = black ;
  194.                 height = 10 ;
  195.                 key = "C_2" ;
  196.                 width = 30 ;
  197.             }
  198.         }
  199.     }
  200.     :row {
  201.         :column {
  202.             :text {
  203.                 label = "C-3样式" ;
  204.             }
  205.             :image_button {
  206.                 color = black ;
  207.                 height = 10 ;
  208.                 key = "C_3" ;
  209.                 width = 30 ;
  210.             }
  211.         }
  212.         :column {
  213.             :text {
  214.                 label = "C-4样式" ;
  215.             }
  216.             :image_button {
  217.                 color = black ;
  218.                 height = 10 ;
  219.                 key = "C_4" ;
  220.                 width = 30 ;
  221.             }
  222.         }
  223.     }
  224.      :button {
  225.              key = "return";
  226.              label = "返回";
  227.              height = 3;
  228.              }
  229.     spacer_1;
  230.     cancel_button;
  231. }

  232. dlg_T:dialog {
  233.     label = "T样式" ;
  234.     :row {
  235.         :column {
  236.             :text {
  237.                 label = "T-1样式" ;
  238.             }
  239.             :image_button {
  240.                 color = black ;
  241.                 height = 10 ;
  242.                 key = "T_1" ;
  243.                 width = 30 ;
  244.             }
  245.         }
  246.         :column {
  247.             :text {
  248.                 label = "T-2样式" ;
  249.             }
  250.             :image_button {
  251.                 color = black ;
  252.                 height = 10 ;
  253.                 key = "T_2" ;
  254.                 width = 30 ;
  255.             }
  256.         }
  257.         :column {
  258.             :text {
  259.                 label = "T-3样式" ;
  260.             }
  261.             :image_button {
  262.                 color = black ;
  263.                 height = 10 ;
  264.                 key = "T_3" ;
  265.                 width = 30 ;
  266.             }
  267.         }
  268.         :column {
  269.             :text {
  270.                 label = "T-4样式" ;
  271.             }
  272.             :image_button {
  273.                 color = black ;
  274.                 height = 10 ;
  275.                 key = "T_4" ;
  276.                 width = 30 ;
  277.             }
  278.         }
  279.     }
  280.     :row {
  281.         :column {
  282.             :text {
  283.                 label = "T-5样式" ;
  284.             }
  285.             :image_button {
  286.                 color = black ;
  287.                 height = 10 ;
  288.                 key = "T_5" ;
  289.                 width = 30 ;
  290.             }
  291.         }
  292.         :column {
  293.             :text {
  294.                 label = "T-6样式" ;
  295.             }
  296.             :image_button {
  297.                 color = black ;
  298.                 height = 10 ;
  299.                 key = "T_6" ;
  300.                 width = 30 ;
  301.             }
  302.         }
  303.         :column {
  304.             :text {
  305.                 label = "T-7样式" ;
  306.             }
  307.             :image_button {
  308.                 color = black ;
  309.                 height = 10 ;
  310.                 key = "T_7" ;
  311.                 width = 30 ;
  312.             }
  313.         }
  314.         :column {
  315.             :text {
  316.                 label = "T-8样式" ;
  317.             }
  318.             :image_button {
  319.                 color = black ;
  320.                 height = 10 ;
  321.                 key = "T_8" ;
  322.                 width = 30 ;
  323.             }
  324.         }
  325.     }
  326.       :button {
  327.              key = "return";
  328.              label = "返回";
  329.              height = 3;
  330.              }
  331.     spacer_1;
  332.     cancel_button;
  333. }



大家好
请大家帮帮忙
再二级对话框得界面
如何点击返回按钮
返回到一级去呢?
lisp 里面的(action_tile "return" "(done_dialog 2)(load_dialog dlg)")句话
怎么改呢?
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2012-2-24 12:53:14 | 显示全部楼层

很简单的,不需要特别的程序

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
 楼主| 发表于 2012-2-24 13:20:07 | 显示全部楼层
fawn_lgc 发表于 2012-2-24 12:53
很简单的,不需要特别的程序

如果你能帮我解决 我的问题我会很感激你的
 楼主| 发表于 2012-2-24 14:01:37 | 显示全部楼层
(action_tile "return" "(done_dialog 2)(load_dialog dlg)")→→ → →  (action_tile "return" "(done_dialog 2)(setq do_what 2)") 就ok了
发表于 2012-2-24 15:08:41 | 显示全部楼层
自己悟出来了?真是高手!!
发表于 2023-12-11 16:59:51 | 显示全部楼层
qcw911 发表于 2012-2-24 14:01
(action_tile "return" "(done_dialog 2)(load_dialog dlg)")→→ → →  (action_tile "return" "(done_d ...

我现在也有这个需求,没看懂怎么改的,怎么跳转到一级对话框的?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-27 15:25 , Processed in 0.182290 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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