天气与日历 切换到窄版

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

visual lisp dcl对话框开发 --滑动条(slider)

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

    [LV.6]常住居民II

    488

    主题

    207

    回帖

    3366

    积分

    管理员

    积分
    3366
    发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
    演示dcl滑动条用法
    slider.lsp:
    [code]
    ;功能:演示 1、 slider
    ;所需文件包括: slider.lsp slider.dcl
    ;
    ;加载步骤:
    ;1、加载lsp
    ;2、命令行输入 test
    (defun c:test( / continue curBtn dlgId )   
        (setq dlgId (load_dialog "slider.dcl"))        
            (if (not (new_dialog "a" dlgId))
                (exit)
            )
                    (set_tile "myedit" "30")       
                    (set_tile "myslider" "30")

                    (action_tile "myslider"                                ;用户滑动slider时触发
                    "(slider_action $value $reason)")                ;调用slider_action

                    (action_tile "myedit"                                         ;用户修改编辑框文字时触发
                    "(ebox_action $value $reason)")                ;调用ebox_action

                    (defun slider_action (val why)                       
                            (if (or (= why 2) (= why 1))               
                                    (set_tile "myedit" val)
                            )
                    )                       

                    (defun ebox_action (val why)                       
                            (if (or (= why 2) (= why 1))       
                                    (set_tile "myslider" val)
                            )
                    )
            (start_dialog)
            
            (cond ((= curBtn "btn1") (f1))
                ((= curBtn "cancel") (setq continue nil))
               
            )

        (unload_dialog dlgId)
           
    )
    [/code]


    slider.dcl:
    [code]a:dialog{
            label="slider";               
           
            : edit_box {                                //*define edit box
             key = "myedit" ;                                //*give it a name
             label = "滑动条的值" ;        //*give it a label
             edit_width = 6 ;                        //*6 characters only
            }
            : slider {                                //*defin slider
            key = "myslider" ;                        //*give it a name
            max_value = 100;                        //*upper value
            min_value = 0;                                //*lower value
            value = "50";                                //*initial value
            }
            :row{               
                    :button{
                            key="okBtn";
                            label="确定";
                           
                    }
                    :cancel_button{
                            label="关闭";
                    }
            }                       
           
    }
    [/code]

     

     

     

     

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

    本版积分规则

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

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

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

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