明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1727|回复: 1

需要大伙帮忙!往能及早回复,谢谢!

[复制链接]
发表于 2003-8-12 10:33:00 | 显示全部楼层 |阅读模式


为什么第一个对话框确定取消建起不了什么作用啊,急需大家帮忙!

(defun c:jk1()
(setq id_dcl (load_dialog "jk1.dcl"))
(if (not (new_dialog "jk1" id_dcl))(exit))
(setq x1 (dimx_tile "image1")
      y1 (dimy_tile "image1")
)
(start_image "image1")
(slide_image 0 0 x1 y1 "ks1")
(end_image)
(setq x2 (dimx_tile "image2")
      y2 (dimy_tile "image2")
)
(start_image "image2")
(slide_image 0 0 x2 y2 "ks2")
(end_image)
(setq x3 (dimx_tile "image3")
      y3 (dimy_tile "image3")
)
(start_image "image3")
(slide_image 0 0 x3 y3 "ks3")
(end_image)
(setq x4 (dimx_tile "image4")
      y4 (dimy_tile "image4")
)
(start_image "image4")
(slide_image 0 0 x4 y4 "ks4")
(end_image)
(setq x5 (dimx_tile "image5")
      y5 (dimy_tile "image5")
)
(start_image "image5")
(slide_image 0 0 x5 y5 "ks5")
(end_image)
(setq x6 (dimx_tile "image6")
      y6 (dimy_tile "image6")
)
(start_image "image1")
(slide_image 0 0 x6 y6 "ks6")
(end_image)
(setq x8 (dimx_tile "image8")
      y8 (dimy_tile "image8")
)
(start_image "image8")
(slide_image 0 0 x8 y8 "ks8")
(end_image)
(setq x9 (dimx_tile "image9")
      y9 (dimy_tile "image9")
)
(start_image "image9")
(slide_image 0 0 x9 y9 "ks9")
(end_image)
(action_tile "image1" "(main)" )
(start_dialog)
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
(unload_dialog id_dcl)

(setq px 200)
(setq py 200)
(setq l 25 w 17.5)
(command "line" (list (+ px l) (+ py w)) (list (- px l) (+ py w)) (list (- px l) (- py w)) (list (+ px l) (- py w)) (list (+ px l) (+ py w))"")
(command "line" (list (+ px l) (- py w)) (list (- px l) (+ py w)) "")
(command "line" (list (- px l) (- py w)) (list (+ px l) (+ py w)) "")
(command "spline" (list px (+ py 17.5)) (list (- px 24.4) (+ py 8.6)) (list (- px 25) py) (list (- px 19.6) (- py 13.7))
(list px (- py 17)) (list (+ px 18.1) (- py 9.6)) (list (+ px 24.1) py ) (list (+ px 24.2) (+ py 10.7)) (list px (+ py 17.5)) "" "" "")
(command "dimlinear" (list (- px l) (+ py w)) (list (+ px l) (+ py w)) (strcat "@" "0" "," "7"))
(command "dimlinear" (list (- px l) (+ py w)) (list (- px l) (- py w)) (strcat "@" "-7" "," "0"))
(princ)
)
(defun Radio_click(key)
  (set_tile "Scale_All" "0")
  (set_tile "Scale_Long" "0")
  (set_tile "Scale_Turn_In" "0")
  (set_tile "Scale_Turn_Out" "0")
  (mode_tile "Scale" 1)
  (mode_tile "Long" 1)
  (mode_tile "Width" 1)
  (mode_tile "Val_In" 1)
  (mode_tile "Val_Out" 1)  
  (set_tile key "1")
  (cond
    ((= key "Scale_All") (mode_tile "Scale" 0))
    ((= key "Scale_Long") (mode_tile "Long" 0) (mode_tile "Width" 0))
    ((= key "Scale_Turn_In") (mode_tile "Val_In" 0))
    ((= key "Scale_Turn_Out") (mode_tile "Val_Out" 0))
  ))


(defun main( / dcl_id m)
  (if (< (setq dcl_id (load_dialog "tmp.dcl")) 0)
    (exit)
  )
  (new_dialog "gcad" dcl_id)
(start_image "cur_color")
(setq img_width(dimx_tile "cur_color")
      img_height(dimy_tile "cur_color"))
(slide_image 0 0 img_width img_height "jkks1")
(end_image)
  (set_tile "Scale_All" "1")
  (Radio_click "Scale_All")
  (action_tile "Scale_All" "(Radio_click $key)")
  (action_tile "Scale_Long" "(Radio_click $key)")
  (action_tile "Scale_Turn_In" "(Radio_click $key)")
  (action_tile "Scale_Turn_Out" "(Radio_click $key)")
  (action_tile "accept" "(done_dialog 1)")
  (start_dialog)

  (unload_dialog dcl_id)
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)")
  (princ)
)

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2003-8-12 11:27:00 | 显示全部楼层
在我这可以取消。
程序有几个问题,
1、action_tile定义在new_dialog之后,start_dialog之后。
2、如无特殊事件,在DCL中调用的标准的OK、CANCEL控件,无须再定义其退出对话框的功能。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-26 20:43 , Processed in 0.184467 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表