各位,请教一下以下LSP中,为什么toggle的取值(get_tile "com")会是NIL。 - (Defun C:test (/ Fn Lsdcl X Dcl_Id Re Vlxpath Inpath)
- (Setq Fn (Open (Setq Lsdcl (Vl-Filename-Mktemp "Tmp" "" ".Dcl")) "W"))
- (Foreach X
- (List
- "path:dialog {label="程序 ay编制";" "spacer;"
- ":row {label="路径";" "alignment=centered;"
- ":button {label="浏览";key="vlxPath";}"
- ":edit_box {key="Pathtxt";edit_width=24;} }"" spacer_1;"
- ":row {label="加载命令";"
- ":toggle {label="第一次提示";key="com";}"
- ":toggle {label="第二次提示";key="info";} }"" spacer_1;"
- "ok_cancel_help;} ")
- (Write-Line X Fn))
- (Close Fn)
- (Setq Dcl_Id (Load_Dialog Lsdcl))
- (Vl-File-Delete Lsdcl)
- (Setq Re 11)
- (While (> Re 10)
- (If (New_Dialog "path" Dcl_Id)
- (Progn
- (Action_Tile "vlxPath" "(Done_Dialog 11)")
- (If (/= Vlxpath NIL) (Setq Inpath (Set_tile "Pathtxt" (Vl-Filename-Directory Vlxpath)) ) )
- (set_tile "com" "1") (set_tile "info" "1")
- (Action_Tile "Accept" "(Setup_Ok) (Done_Dialog 1)")
- (Action_Tile "Cancel" "(Done_Dialog 0)")
- (Action_Tile "Help" "(Help "aylisp.Chm")")
- (Setq re (Start_Dialog)) ) )
- (If (= Re 11) (Setq Vlxpath (Getfiled "选择程序文件" "12.lsp" "lsp" 0))) )
- (IF (= Re 1)(Setup_Ok) )
- (setq com (get_tile "com"))
- (Unload_Dialog Dcl_Id)
- (Princ)
- )
-
- (defun Setup_Ok()
- (progn (If (= (get_tile "com") "1") (alert "第一次提示!"))
- (If (= (get_tile "info") "1") (alert "第二次提示!")) ) )
|