zoukankan      html  css  js  c++  java
  • AutoLISP对话框DCL关于LIST_BOX应用示例

    AutoLISP对话框DCL关于LIST_BOX应用示例,DCL对话框代码如下。

    dia7a:dialog {
        label = "列表框示例" ;
        :list_box {
            height = 10 ;
            key = "klist" ;
            label = "词库选单" ;
            width = 30 ;
        }
        :edit_box {
            key = "wordstr" ;
            label = "词库" ;
        }
        spacer_1;
        ok_cancel;
    }

    LSP文件代码如下。

    (defun c:dia7a ()
        (setvar "cmdecho" 0)
        (setq word_list '("亚洲"
                  "中国"
                  "北京"
                  "天津"
                  "上海"
                  "广州"
                  "重庆"
                  "四川"
                  "河南"
                  "郑州"
                  "开封"
                  "武汉"
                  "河北"
                  "江西"
                  "甘肃"
                 )
        )
        (dcl_dia7a)
        (prin1)
    )
    (defun dcl_dia7a ()
        (setq dcl_id (load_dialog "dia7a"))
        (new_dialog "dia7a" dcl_id)
        (start_list "klist")
        (mapcar 'add_list word_list)
        (end_list)
        (action_tile "klist" "(sub_klist $value)")
        (action_tile "accept" "(ok_dia7a) (done_dialog 1)")
        (setq dd (start_dialog))
        (if    (= dd 1)
        (progn
            (setvar "cmdecho" 1)
            (command "text" pause 0 wordstr)
            (setvar "cmdecho" 0)
        )
        )
    )
    (defun sub_klist (vvs)
        (set_tile "wordstr" (nth (atoi vvs) word_list))
    )
    (defun ok_dia7a    ()
        (setq wordstr (get_tile "wordstr"))
    )

    代码完。

    作者:codee
    文章千古事,得失寸心知。


  • 相关阅读:
    八、运维管理链码
    六、编写第一个应用【外部nodejs调用】
    七、链码
    五、005-环境安装【docker、fabric】
    Webpack 4 SplitChunksPlugin配置方案(转)
    转:webpack代码压缩优化
    这样使用 GPU 渲染 CSS 动画(转)
    express中间件--Morgan 日志记录
    盘点 React 16.0 ~ 16.5 主要更新及其应用
    求最大容积
  • 原文地址:https://www.cnblogs.com/bimgoo/p/2503067.html
Copyright © 2011-2022 走看看