我在玩DCL,用Afralisp和Jeff Sanders。
是否可以取消取消按钮,只使用右上角的“X”按钮??
这是我目前为止的Lisp程序:
- (defun c:test (/ dcl_id z)
- (setq dcl_id (load_dialog "ModZ.dcl"))
- (if (not (new_dialog "ModZ" dcl_id))
- (exit)
- )
- (set_tile "Z" "0.00")
- (action_tile "But1" "(doButton 1)")
- (action_tile "But2" "(doButton 2)")
- (action_tile "But3" "(doButton 3)")
- (action_tile "Cancel" "(done_dialog)")
- (start_dialog)
- (unload_dialog dcl_id)
- (princ)
- );defun
- (defun doButton(a)
- (cond
- ((= a 1)(alert "Button 1 was pressed!"))
- ((= a 2)(alert "Button 2 was pressed!"))
- ((= a 3)(alert "Button 3 was pressed!"))
- )
- )
我的DCL:
- ModZ : dialog {
- label = "Modify Z";
- : edit_box
- {
- label = "Elevation :";
- key = "Z";
- alignment = centered;
- edit_limit = 20;
- edit_width = 20;
- //allow_accept = true
- }
- : row {
- : spacer { height = 1; }
- }
- :row {
-
- : button {
- label = "Single";
- key = "But1";
- alignment = centered;
- width = 12;
- }
- : button {
- label = "Fence";
- key = "But2";
- alignment = centered;
- width = 12;
- }
- : button {
- label = "All";
- key = "But3";
- alignment = centered;
- width = 12;
- }
-
- : button {
- label = "Cancel";
- key = "Cancele";
- alignment = centered;
- width = 12;
- is_cancel = true;
- }
- }
- }
|