; Learning about the callback function for (action_tile) :
(defun C:test
( / ReportActionCallback
*error* dcl des dch dcf
)
(defun ReportActionCallback
( _key _label _value _data _reason _x _y
) '("k" "l" "v" "d" "r" "X" "Y")
); list
); mapcar
); defun ReportActionCallback
); defun *error*
(
'("CallbackTest : dialog"
"{ label = \"Callback test\";"
" : column"
" { children_alignment = centered;"
" : edit_box { label = \"Input1\"; key = \"eb1\"; width = 16; mnemonic = \"1\"; }"
" : edit_box { label = \"Input2\"; key = \"eb2\"; width = 16; mnemonic = \"2\"; }"
" : edit_box { label = \"Input3\"; key = \"eb3\"; width = 16; mnemonic = \"3\"; }"
" : button { label = \"Button1\"; key = \"b1\"; width = 16; mnemonic = \"a\"; }"
" : button { label = \"Button2\"; key = \"b2\"; width = 16; mnemonic = \"s\"; }"
" : button { label = \"Button3\"; key = \"b3\"; width = 16; mnemonic = \"d\"; }"
" : slider { key = \"sld\"; value = \"15\"; min_value = 0; max_value = 40; big_increment = 5; small_increment = 5; width = 16; }"
" : popup_list { label = \"\"; key = \"PL\"; width = 16; }"
" : list_box { label = \"Items\"; key = \"LB\"; width = 16; multiple_select = true; allow_accept = false; }"
" : radio_column"
" { label = \"Radio buttons\";"
" : radio_button { label = \"B1\"; key = \"rb1\"; width = 16; }"
" : radio_button { label = \"B2\"; key = \"rb2\"; width = 16; }"
" : radio_button { label = \"B3\"; key = \"rb3\"; width = 16; }"
" }"
" : toggle { label = \"On/Off\"; key = \"tg1\"; width = 16; }"
" : toggle { label = \"Switch\"; key = \"tg2\"; width = 16; }"
" }"
" spacer; ok_cancel; "
" : text { label = \"\"; key = \"k\"; } "
" : text { label = \"\"; key = \"l\"; } "
" : text { label = \"\"; key = \"v\"; } "
" : text { label = \"\"; key = \"d\"; } "
" : text { label = \"\"; key = \"r\"; } "
" : text { label = \"\"; key = \"X\"; } "
" : text { label = \"\"; key = \"Y\"; } "
"}"
); list
); mapcar
); and
); not
(princ "\nUnable to write or load the DCL file.") )
(
'("eb1" "eb2" "eb3" "b1" "b2" "b3" "sld" "PL" "LB" "rb1" "rb2" "rb3" "tg1" "tg2")
); mapcar
; ( (= "" (get_tile "eb1")) (set_tile "error" "Please fill input 1.") (mode_tile "eb1" 2) )
; ( (= "" (get_tile "eb2")) (set_tile "error" "Please fill input 2.") (mode_tile "eb2" 2) )
; ( (= "" (get_tile "eb3")) (set_tile "error" "Please fill input 3.") (mode_tile "eb3" 2) )
); cond
); vl-prin1-to-string
); action_tile
); progn
(princ "\nUser cancelled the dialog.") )
); cond
); defun