visual lisp dcl对话框开发 --单选按钮(radio)
程序员文章站
2024-02-27 18:48:03
...
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