Angelo2449
Guest
Hello everyone,
I am trying in vain to make this simple program lisp and dcl.
I tried them all, I would like to know why it doesn't work, thank you in advance.
I am trying in vain to make this simple program lisp and dcl.
I tried them all, I would like to know why it doesn't work, thank you in advance.
Code:
; myyesno - question dialog with one question line
; arguments: 2
; title$ = dialog title
; question$ = question line
; syntax: (myyesno " my yes no" "do you like creating programs in autolisp?")
;----------------------------------------------------------------------------------------------------------
(defun c:myyesno (title$ question$ / answer$ dcl_id% return#)
(princ "\nmyyesno")(princ)
(setq dcl_id% (load_dialog "myyesno.dcl"))
(new_dialog "myyesno" dcl_id%)
(set_tile "title" title$)
(set_tile "text1" question$)
(action_tile "yes" "(done_dialog 1)")
(action_tile "no" "(done_dialog 0)")
(setq return# (start_dialog))
(unload_dialog dcl_id%)
(if (= return# 1)
(setq answer$ "yes")
(setq answer$ "no")
);if
(princ "\n")(princ answer$)(princ);optional
answer$
);defun myyesno
//---------------------------------------------------------------------------------------------------------
// myyesno
// note: the width for the text1 key was determined by the syntax example and
// will need to be changed as per your requirements. also note that the buttons
// for yes and no, the added fixed_width = true;.
//---------------------------------------------------------------------------------------------------------
myyesno : dialog {
key = "title";
label = "";//title$ from lsp file
spacer;
: text {
key = "text1";
label = "";//question$ from lsp file
width = 35.0;
alignment = centered;
}
spacer;
: row {
fixed_width = true;
alignment = centered;
: button {
key = "yes";
label = "&yes";
is_default = true;
width = 7.92;
fixed_width = true;
}
: button {
key = "no";
label = "&no";
is_cancel = true;
width = 7.92;
fixed_width = true;
}
}
}//myyesno