天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 69|回复: 0

visual lisp/autolisp dcl对话框开发 --对话框嵌套(子对话框

[复制链接]
  • TA的每日心情
    开心
    2024-8-31 15:58
  • 签到天数: 89 天

    [LV.6]常住居民II

    488

    主题

    207

    回帖

    3366

    积分

    管理员

    积分
    3366
    发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
    nest_dialog.lsp:
    [code]  
    ;功能:演示 1、 对话框嵌套。
    ;所需文件包括: nest_dialog.lsp nest_dialog.dcl
    ;
    ;加载步骤:
    ;1、加载lsp
    ;2、命令行输入 test

    (defun c:test ()
      (setq dcl_id (load_dialog "nest_dialog.dcl"))
      ;加载 DCL 文件

      (if (not (new_dialog "main_dialog" dcl_id))
      ;新建 对话框
        (exit)
        ;新建失败则退出
      )

      (action_tile
        "cancel"
        "(done_dialog)
         (setq result nil)"
      )
      ;关闭按钮被点击

      (action_tile
        "accept"
        "(done_dialog)
         (setq result T)"
      )
      ;

      (action_tile    "nest"    "(nest1)"  )
      ;点击“子对话框”按钮后调用nest1函数

      (start_dialog)
      ;弹出对话框

      (unload_dialog dcl_id)
      ;卸载对话框

      (princ)

    );defun

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (defun nest1 ()
      (setq dcl_id1 (load_dialog "nest_dialog.dcl"))

      (if (not (new_dialog "child_dialog1" dcl_id1 "" '(700 250))); (700 250)是对话框位置

        (exit)

      )

      (action_tile
        "cancel"
        "(done_dialog)
         (setq result1 nil)"
      )

      (action_tile
        "accept"
        "(done_dialog)
         (setq result1 T)"
      )

      (action_tile
        "nest"
        "(nest2)"
      )

      (start_dialog)
      (unload_dialog dcl_id1)

      (princ)

    );defun


    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    (defun nest2 ()

      (setq dcl_id2 (load_dialog "nest_dialog.dcl"))

      (if (not (new_dialog "child_dialog2" dcl_id2))

        (exit)
      )

      (action_tile
        "cancel"
        "(done_dialog)
         (setq result2 nil)"
      )
      (action_tile
        "accept"
        "(done_dialog)
         (setq result2 T)"
      )

      (start_dialog)

      (unload_dialog dcl_id2)

    );defun

    [/code]


    nest_dialog.dcl:
    [code]main_dialog:dialog{
            label="main dialog by 鸟哥";
            :row{               
                    :button{
                            key="accept";
                            label="确定";
                           
                    }
                    :button{
                            key="nest";
                            label="子对话框1";
                    }
                    :cancel_button{
                            label="关闭";
                    }
            }       
    }

    child_dialog1:dialog{
            label="child_dialog1 by 鸟哥";                       
           
           
            :row{               
                    :button{
                            key="accept";
                            label="确定";
                           
                    }
                    :button{
                            key="nest";
                            label="子对话框2";
                    }
                    :cancel_button{
                            label="关闭";
                    }
            }       
    }

    child_dialog2:dialog{
            label="child_dialog2  by 鸟哥";
           
            :row{               
                    :button{
                            key="accept";
                            label="确定";
                           
                    }
                   
                    :cancel_button{
                            label="关闭";
                    }
            }       
    }
    [/code]

     

     

     

     

    visual lisp/autolisp dcl对话框开发 --对话框嵌套(子对话框
    中国膜结构网打造全中国最好的膜结构综合平台 ,统一协调膜结构设计,膜结构施工,膜材采购,膜材定制,膜结构预算全方位服务。 中国空间膜结构协会合作单位。
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|手机版|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池| |网站地图

    GMT+8, 2024-9-8 10:42 , Processed in 0.084504 second(s), 26 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

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