- (defun makedanxuandcl (/ lst_str str file f)
- (setq lst_str '(
- "dx:dialog {"
- " label = \"单选\" ;"
- " :column {"
- " :row {"
- " :radio_button {"
- " key = \"r1\" ;"
- " label = \"单选1\" ;"
- " }"
- " :radio_button {"
- " key = \"r2\" ;"
- " label = \"单选2\" ;"
- " }"
- " :radio_button {"
- " key = \"r3\" ;"
- " label = \"单选3\" ;"
- " }"
- " }"
- " :row {"
- " :radio_button {"
- " key = \"r4\" ;"
- " label = \"单选4\" ;"
- " }"
- " :radio_button {"
- " key = \"r5\" ;"
- " label = \"单选5\" ;"
- " }"
- " :radio_button {"
- " key = \"r6\" ;"
- " label = \"单选6\" ;"
- " }"
- " }"
- " :row {"
- " :radio_button {"
- " key = \"r7\" ;"
- " label = \"单选7\" ;"
- " }"
- " :radio_button {"
- " key = \"r8\" ;"
- " label = \"单选8\" ;"
- " }"
- " :radio_button {"
- " key = \"r9\" ;"
- " label = \"单选9\" ;"
- " }"
- " }"
- " }"
- " ok_cancel;"
- "}"
- ""
- )
- )
- (setq file (vl-filename-mktemp "DclTemp.dcl"))
- (setq f (open file "w"))
- (foreach str lst_str
- (princ "\n" f)
- (princ str f)
- )
- (close f)
- file
- )
- (defun updata(va)
- (foreach x '("r1" "r2" "r3" "r4" "r5" "r6" "r7" "r8" "r9")
- (set_tile x "0")
- )
- (set_tile (strcat "r" va) "1")
- )
- (setq danxuan_dia(makedanxuandcl))
- (setq dcl_id(load_dialog danxuan_dia))
- (new_dialog "dx" dcl_id)
- (set_tile "r1" "1")
- (action_tile "r1" "(updata \"1\")")
- (action_tile "r2" "(updata \"2\")")
- (action_tile "r3" "(updata \"3\")")
- (action_tile "r4" "(updata \"4\")")
- (action_tile "r5" "(updata \"5\")")
- (action_tile "r6" "(updata \"6\")")
- (action_tile "r7" "(updata \"7\")")
- (action_tile "r8" "(updata \"8\")")
- (action_tile "r9" "(updata \"9\")")
- (action_tile "cancel""(done_dialog 1)")
- (action_tile "accept""(done_dialog 1)")
- (setq idd(start_dialog))
- (unload_dialog dcl_id)
- (vl-file-delete danxuan_dia)
- (princ)
|