天气与日历 切换到窄版

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

visual lisp/autolisp dcl对话框开发 --列表框(list_box)

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

    [LV.6]常住居民II

    488

    主题

    207

    回帖

    3366

    积分

    管理员

    积分
    3366
    发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
    listbox.lsp
    [code]  
    ;功能:演示 1、 list_box控件的使用。
    ;所需文件包括: listbox.lsp listbox.dcl
    ;
    ;加载步骤:
    ;1、加载lsp
    ;2、命令行输入 test
    (defun c:test( / continue curBtn dlgId list2str)
            ;(setq list2str "")
            (defun mystrcat (i)
                    (setq list2str (strcat list2str (nth  i myList2) " "))
            )
        (defun list_action ()
                    (setq list2str "")
                    (princ list2_value)
                   
                            ;(setq list2str (nth (atoi list2_value) myList2))
                            (progn
                                    (mapcar 'mystrcat (read (strcat "(" list2_value ")")))
                            )
                   
                    (setq text (strcat "方向:" (nth (atoi list1_value) myList1) "  城市:" list2str))
                    (set_tile "mytext" text);设置text控件
                   
            )
        (setq dlgId (load_dialog "listbox.dcl"))
            
            (if (not (new_dialog "a" dlgId))
                    (exit)
            )
            (setq myList1(list "正南" "正北" "正东" "正西"))

            (setq myList2(list "北京" "上海" "深圳" "广东"))
           
            (start_list "mylist1" 3)   ; The 3 means we want to delete the old contents and start
            (mapcar 'add_list myList1)
      
            (end_list)

            (start_list "mylist1" 3)
            (mapcar 'add_list myList1)
            (end_list)

            (start_list "mylist2" 3)
            (mapcar 'add_list myList2)
            (end_list)
           
            (action_tile "mylist1" "(setq list1_value $value)(list_action)")
            (action_tile "mylist2" "(setq list2_value $value)(list_action)")
           
            (start_dialog)
           
            (cond ((= curBtn "btn1") (f1))
                    ((= curBtn "cancel") (setq continue nil))
              
            )       

        (unload_dialog dlgId)
           
    )
    [/code]


    listbox.dcl
    [code]a:dialog{
            label="list_box by 鸟哥";                       

            : column {
                    : boxed_row {
                            : list_box {
                                    label ="单选列表";
                                    key = "mylist1";
                                    height = 15;
                                    width = 25;
                                    multiple_select = false;
                                    fixed_width_font = true;
                                    value = "";
                            }
                            : list_box {
                                    label ="多选列表";
                                    key = "mylist2";
                                    height = 15;
                                    width = 25;
                                    multiple_select = true;
                                    fixed_width_font = true;
                                    value = "";
                            }
                    }
            }
            :text{
                    key="mytext";
            }
            :row{               
                    :button{
                            key="okBtn";
                            label="确定";
                           
                    }
                    :cancel_button{
                            label="关闭";
                    }
            }       
    }
    [/code]

     

     

     

     

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

    本版积分规则

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

    GMT+8, 2024-9-8 11:00 , Processed in 0.066606 second(s), 27 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

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