TA的每日心情![](source/plugin/dsu_paulsign/img/emot/kx.gif) | 开心 2024-8-31 15:58 |
---|
签到天数: 89 天 [LV.6]常住居民II
管理员
- 积分
- 3366
|
[img]http://www.cqmjg.com/uploads/TY/TY33.jpg[/img]
alignment.lsp
[code]
;功能:演示 1、alignment属性
;所需文件包括:alignment.lsp alignment.dcl
;
;加载步骤:
;1、加载lsp
;2、命令行输入 test
(defun c:test( / continue curBtn dlgId )
(setq dlgId (load_dialog "alignment.dcl"))
;(while continue
(if (not (new_dialog "a" dlgId "" (cond (position) ((list -1 -1)))))
(exit)
)
(start_dialog)
;(setq axisRotateList_value )
(cond ((= curBtn "btn1") (f1))
((= curBtn "cancel") (setq continue nil))
((= curBtn "okBtn") (drawRec (mapcar 'atof (list width height x y))))
(t )
)
(setq curBtn nil)
;)
(unload_dialog dlgId)
)
(defun drawRec (args / w h x y)
(setq w (car args) h (cadr args) x (nth 2 args) y (nth 3 args))
(command "rectangle" (list x y) (list (+ x w) (+ y h)))
)
[/code]
alignment.dcl
[code]a:dialog{
label="alignment演示";
:column{
:button{
key="";
width=8;
fixed_width=true;
label="位置";
alignment=right; //默认是左对齐的,这里让按钮右对齐
}
:button{
key="x";
edit_width="12";
fixed_width=true;
label="按钮";
}
:button{
key="y";
edit_width="12";
fixed_width=true;
label="按钮2";
}
}
:row{
:button{
key="okBtn";
label="确定";
}
:cancel_button{
label="关闭";
}
}
}
[/code] |
|