visual lisp dcl对话框开发 --单选按钮(radio)

radio.lsp:

;by 鸟哥 qq1833183060
;功能:演示 1、 radio按钮
;所需文件包括: radio.lsp radio.dcl
;
;加载步骤:
;1、加载lsp
;2、命令行输入 test
(defun c:test( / continue curBtn dlgId )
    
    (setq dlgId (load_dialog "radio.dcl"))
        
        (if (not (new_dialog "a" dlgId))
            (exit)
        )
        
        (start_dialog)
        
        (cond ((= curBtn "btn1") (f1))
            ((= curBtn "cancel") (setq continue nil))
           
        )
 
    (unload_dialog dlgId)	
)

radio.dcl:

a:dialog{
	label="radio";		
	:boxed_column {			
       label = "Type" ;				

        : radio_button {			
     	  key = "rb1" ;				
     	  label = "单选按钮1" ;		
     	  value = "1" ;				//表示被选中
        }					

     	: radio_button {			
     	  key = "rb2" ;				
     	  label = "单选按钮1" ;		
     	}					

     	: radio_button {			
     	  key = "rb3" ;				
     	  label = "单选按钮1" ;	
     	  }	
	}
	:boxed_radio_column {			
       label = "Type" ;				

        : radio_button {			
     	  key = "rb4" ;				
     	  label = "单选按钮1&a" ;	//可以用ctrl+a 选中
     	  value = "0" ;				
        }					

     	: radio_button {			
     	  key = "rb5" ;				
     	  label = "单选按钮1" ;		
     	}					

     	: radio_button {			
     	  key = "rb6" ;			
     	  label = "单选按钮1" ;	
		  value=1;
     	  }	
	}
		
	:row{		
		:button{
			key="okBtn";
			label="确定";
			
		}
		:cancel_button{
			label="关闭";
		}
	}			
	
}

运行效果:
在这里插入图片描述
源码地址:https://github.com/1833183060/autolisp-visuallisp-demo/tree/master/dcl

发布了60 篇原创文章 · 获赞 10 · 访问量 3728

猜你喜欢

转载自blog.csdn.net/sinat_18811413/article/details/104255744