明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2541|回复: 5

[原创]拟制作一个图块管理程序,刚刚开始弄,源码如下

[复制链接]
发表于 2008-7-24 15:41:00 | 显示全部楼层 |阅读模式
本帖最后由 作者 于 2008-7-24 15:44:04 编辑

有个问题是每次单击image_button整个控件框会以反色显示,非常晃眼,有没有办法解决?

(defun c:dxs()
   (setq dcl_id (load_dialog "dxs.dcl"))
   (if (not (new_dialog "dxs1" dcl_id)) (exit))
   (setq imx (- (dimx_tile "im01") 2)
         imy (- (dimy_tile "im01") 2))
   (setq liim '()) (tc_im1) (setq hxim3 0)
 (action_tile "im11" "(tc_im1)") ;;填充image控件
 (action_tile "im12" "(qc_cls)") ;;清除image控件
 (action_tile "im13" "(setq hxim3 (1+ hxim3))")
 (setq aa "ddddd")
 (action_tile "im01" "(dj_im4)")
 (start_dialog)(unload_dialog dcl_id)
)


;;清除
(defun qc_cls()
   (start_image "im01")
   (fill_image 1 1 imx imy 0)
   (end_image)
   (setq liim '())
)

;;填充
(defun tc_im1( / a b x y)
   (start_image "im01")
   (setq a 5 b 5 x 0 y 0)(if (= s Nil)(setq s 1))
   (repeat b (setq x 0)
     (repeat a
     (if (> s 256)(setq s 0))
     (fill_image (* x (/ imx a)) (* y (/ imy b))
                 (* (setq x (1+ x)) (/ imx a)) (* (+ y 1) (/ imy b)) (setq s (+ s 3)))
     )  (setq y (1+ y)))
   (end_image)
)

(defun dj_im4( / a b x y n)
 (if (= (- (/ hxim3 2.0) (fix (/ hxim3 2.0))) 0) (progn
 (setq mx $x my $y)
 (setq a 5 b 5 x 0 y 0)
 (while (> mx (* x (/ imx a))) (setq x (1+ x)))
 (while (> my (* y (/ imx b))) (setq y (1+ y)))
 (setq x (- x 1) y (- y 1))
  (start_image "im01")
     (vector_image (* x (/ imx a)) (* y (/ imy b)) (* x (/ imx a)) (* (+ y 1) (/ imy b)) 2)
     (vector_image (* x (/ imx a)) (* y (/ imy b))  (* (+ x 1) (/ imx a)) (* y (/ imy b)) 2)
     (vector_image (* x (/ imx a)) (* (+ y 1) (/ imy b)) (* (+ x 1) (/ imx a)) (* (+ y 1) (/ imy b)) 2)
     (vector_image (* (+ x 1) (/ imx a)) (* y (/ imy b)) (* (+ x 1) (/ imx a)) (* (+ y 1) (/ imy b)) 2)  
   (end_image))(progn
(setq liim (cons (list $x $y) liim) n 0)
(repeat (- (length liim) 1)
(start_image "im01")
(vector_image (car (nth n liim))(cadr (nth n liim))
              (car (nth (+ 1 n) liim))(cadr (nth (+ 1 n) liim)) 1)
       (setq n (1+ n))(end_image)
)))
)

;;对话框代码如下:命名为dxs.dcl,放到支持路径下

dxs1:dialog{label="示例图像框";
:row{:image_button{key="im01";width=80;height=40;}
:column{spacer_0;
   :button{label="复位(&T)";key="im11";fixed_width=true;}
   :button{label="清除(&C)";key="im12";fixed_width=true;}
   :button{label="画线(&H)";key="im13";fixed_width=true;}  spacer_0;
}} :row{spacer_0;
:button{label="确定(&Q)"; key="im99";is_default=true;fixed_width=true;}}}

"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2008-7-27 13:52:00 | 显示全部楼层
你这好象是画线程序.
发表于 2008-7-28 08:38:00 | 显示全部楼层

看了一下代码,楼主做的好简结了:)

发表于 2009-12-2 15:38:00 | 显示全部楼层
发表于 2009-12-2 22:25:00 | 显示全部楼层
与图块管理程序没有什么关系啊
发表于 2009-12-3 07:26:00 | 显示全部楼层
这是忽悠谁呢
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-10-1 19:36 , Processed in 0.179162 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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