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
    文章千古事,得失寸心知。


  • 相关阅读:
    guzzle下载图片(laravel+vue)
    leetcode——131.分割回文串
    leetcode——139.单词拆分
    leetcode——115.不同的子序列
    leetcode——72.编辑距离
    leetcode——87.扰乱字符串
    leetcode——123. 买卖股票的最佳时机 III
    leetcode——132. 分割回文串 II
    leetcode——124. 二叉树中的最大路径和
    leetcode——51.N皇后
  • 原文地址:https://www.cnblogs.com/bimgoo/p/2503067.html
Copyright © 2011-2022 走看看