(defun c:tt (/ show_list sub_unifont sub_bigfont ok_remstyle $VALUE BIGFONT_LST BIGNAME DCLNAME DCL_ID FILEN NEWSTR OLDSTR TEMPNAME UNIFONT_LST UNINAME) (defun show_list (key newlist) (start_list key) (mapcar 'add_list newlist) (end_list) ) (defun sub_unifont (vvs) (set_tile "bigfont" "(setq $value \"1\")") ) (defun sub_bigfont (vvs) (set_tile "bigfont" "(setq $value \"0\")") ) (defun ok_remstyle () (setq uniname (nth (atoi (get_tile "unifont")) unifont_lst)) (setq bigname (nth (atoi (get_tile "bigfont")) bigfont_lst)) (alert uniname) (alert bigname) ) (setq dclname (cond ((setq tempname (vl-filename-mktemp "ko-dcl-tmp.dcl") filen (open tempname "w")) (foreach stream '( "fontrem:dialog{\n" " label=\"文字样式替换\";\n" " :text{ label=\"发现N个文字样式缺少字体!!\"; alignment=centered; color=\"7\";}\n" " :boxed_column{\n" " label=\"请选择替换的字体\";\n" " :row{\n" " :text{ label=\"SHX字体:\";}\n" " :text{ label=\"大字体:\";}\n" " }\n" " :row{\n" " :popup_list{ key=\"unifont\";edit_width=18;}\n" " :popup_list{ key=\"bigfont\"; edit_width=18;}\n" " }\n" " :toggle{label=\"使用大字体\";key=\"ubigfont\"; value=\"1\";}\n" " }\n" " spacer_1;\n" " ok_cancel;\n" "}\n" "\n" "\n" "\n" "\n" ) (princ stream filen) ) (close filen) tempname ))) (setq unifont_lst '("a" "b" "c")) (setq bigfont_lst '("1" "2" "s5" "3" "4" "5" "6" "7" "8" "9" "10")) (setq dcl_id (load_dialog tempname)) (if (not (new_dialog "fontrem" dcl_id "")) (progn (alert "dcl对话框加载失败.")(exit))) (show_list "unifont" unifont_lst) (show_list "bigfont" bigfont_lst) (action_tile "unifont" "(sub_unifont $value)") (action_tile "bigfont" "(sub_bigfont $value)") (action_tile "accept" "(ok_remstyle) (done_dialog)") (start_dialog) (unload_dialog dcl_id) (vl-file-delete dclname) ) liminnet的程序,但还需要完善,哪位高手帮忙完善一下? |