按钮-文件的连接
怎么让点击按钮,从而打开某个文件 Which button? on existing toolbars? 楼主是这个意思. 请楼主使用搜索工能. 可以在这个版块找到你要找的内容. 没有找到啊。比如我想在dcl对话框中添加一个"查看文件资料"按钮,应该在lsp程序中用什么语句,才能使我连上d:/lsp/ziliao.htm文件。 本帖最后由 作者 于 2004-9-20 20:05:46 编辑
(command "browser" "d:/lsp/ziliao.htm"), 不过你要先关闭对话框 或试试(startapp "EXPLORER.EXE" "d:/lsp/ziliao.htm")James Maeding 给了我们这个程序,一般的文件都能打开,很方便(DEFUN CT-WINRUN (NAME / FILENAME)
(IF (NOT (SETQ FILENAME (FINDFILE NAME)))
(PROGN
(ALERT (STRCAT "File " NAME " cannot be found."))
(VL-EXIT-WITH-VALUE 1)
)
)
(IF (NOT (FINDFILE (STRCAT (GETENV "SYSTEMROOT") "\\EXPLORER.EXE")))
(PROGN
(ALERT (STRCAT "Explorer cannot be found so file cannot be run."))
(VL-EXIT-WITH-VALUE 1)
)
)
(vl-arx-import 'Startapp)
(STARTAPP (STRCAT (GETENV "SYSTEMROOT") "\\EXPLORER.EXE") FILENAME)
) 不行,运行时死机
;;;;;;;;;;驱动对话框---------------------------------------------------<BR>(defun rcxtxlzq(/ id nldraw)<BR> (setq olderr *error* *error* clerr)<BR> (setq id (load_dialog "nl.dcl"))<BR> (if (new_dialog "rcxtxlzq" id)<BR> (progn<BR> (start_list "nl")<BR> (add_list "NL1")<BR> (add_list "NL2")<BR> (add_list "NL3")<BR> (add_list "NL4")<BR> (add_list "NL5")<BR> (add_list "NL6")<BR> (add_list "NL7")<BR> (add_list "NL8")<BR> (add_list "NL9")<BR> (add_list "NL10")<BR> (end_list)<BR> (start_image "nlpic")<BR> (slide_image 20 0 (dimx_tile "nlpic") (dimy_tile "nlpic") "nl")<BR> (end_image)<BR> (action_tile "ziliao" "(nl_ziliao)")<BR> (action_tile "accept" "(setq nldraw 1)(getnl_dcl)(done_dialog)")<BR> (action_tile "cancel" "(done_dialog)")<BR> (start_dialog)<BR> )<BR> (princ "error,can't open the dialog")<BR> )
(defun nl_ziliao()<BR> (command "browser" "f:\\ziliao.htm")<BR>) picture (command "start" "<A href="http://bbs.mjtd.com/forum.php?mod=viewthread&tid=26444" target="_blank" >http://bbs.mjtd.com/forum.php?mod=viewthread&tid=26444</A>") (defun nl_ziliao()<BR> (command "shell" "f:\\ziliao.htm")<BR>) heart1982发表于2004-9-20 20:12:00static/image/common/back.gif不行,运行时死机
;;;;;;;;;;驱动对话框---------------------------------------------------(defun rcxtxlzq(/ id nldraw) (setq olderr *error* ...
<BR>You cannot use run (command ...) while your dialog box is still open!
Try (startapp...) or (CT-WINRUN ...)
页:
[1]
2