明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1442|回复: 3

帮忙看看错在哪儿?

[复制链接]
发表于 2004-12-27 00:08:00 | 显示全部楼层 |阅读模式
我想点按钮“change_type”选择完图形后,前一对话框中的image_button中的图形随着我选择的图形改变,但是现在我的程序中改变不了,请大家指教错在哪儿!谢谢!SLD.RAR中是两个幻灯片文件。
程序如下: (defun c:test (/ dcl_id)
(setq dcl_id (load_dialog "test.dcl"))
(new_dialog "piece14" dcl_id)
(show_slb "image14" "TYPE-S-1") (action_tile "change_type" "(type_14_1)")
(cond ((= types-s 1) (show_slb "image14" "TYPE-S-1"))
((= types-s 2) (show_slb "image14" "TYPE-S-2")) ) (action_tile "save" "(type_14_save)(done_dialog 1)")
(start_dialog)
);end defun ;;*************************sub_type_14_1********************************
(defun type_14_1 (/ dcl_id14_1)
(setq dcl_id14_1 (load_dialog "piece_type.dcl"))
(new_dialog "piece14_1" dcl_id14_1)
(show_slb "image1401" "TYPE-S-1")
(show_slb "image1402" "TYPE-S-2") (action_tile "image1401" "(setq types-s 1)(done_dialog 1)")
(action_tile "image1402" "(setq types-s 2)(done_dialog 1)") (start_dialog)
) 对话框文件如下: piece14 : dialog {
label = "Piece mark of skew shear plate";
: row {
: column {
: boxed_column {
label = "Type of shear plate";
: image {
key = "image14";
color = dialog_foreground;
aspect_ratio = 1.50;
height = 7;
}
: button {
label = "Change type...";
key = "change_type";
}
}
spacer_1;

spacer_1;
save_cancel; }


}
}
piece14_1 : dialog {
label = "type of shear plate";
: row {
: image_button {
key = "image1401";
color = dialog_foreground;
aspect_ratio = 1.50;
height = 8;
}
: image_button {
key = "image1402";
color = dialog_foreground;
aspect_ratio = 1.50;
height = 8;
}

}
ok_cancel;
}

本帖子中包含更多资源

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

x
发表于 2004-12-27 08:35:00 | 显示全部楼层
(cond ((= types-s 1) (show_slb "image14" "TYPE-S-1"))
((= types-s 2) (show_slb "image14" "TYPE-S-2")) ) 这段也应该在type_14_1函数里完成,因为(action_tile "change_type" "(type_14_1)")是执行type_14_1函数,执行完后继续等待动作,并不会执行其它函数。。。你的这个cond只会在对话框显示之前执行,显示之后,怎么都执行不到这个函数
发表于 2004-12-27 08:56:00 | 显示全部楼层
我不明白你的程序,我按自己的想法对程序及dcl作了修改,未做详细检查 (defun c:test (/ dcl_id)
(setq dcl1 (load_dialog "d:\\temp\\mjtd1.dcl"))
(new_dialog "piece14" dcl1)
(start_image "image14")
(slide_image 0 0 (dimx_tile "image14") (dimy_tile "image14") "d:\\temp\\TYPE-S-1")
(end_image)
(action_tile "change_type" "(progn (type_14_1)(pro1 types-s))")
(start_dialog)
)
(defun type_14_1 (/ dcl_id14_1)
(new_dialog "piece14_1" dcl1)
(start_image "image1401")
(slide_image 0 0 (dimx_tile "image1401") (dimy_tile "image1401") "d:\\temp\\TYPE-S-1")
(end_image)
(start_image "image1402")
(slide_image 0 0 (dimx_tile "image1402") (dimy_tile "image1402") "d:\\temp\\TYPE-S-2")
(end_image)
(action_tile "image1401" "(progn(setq types-s 1)(done_dialog 1))")
(action_tile "image1402" "(progn(setq types-s 2)(done_dialog 1))")
(start_dialog)
(princ)
)
(defun pro1 (int1 /)
(cond ((= int1 1)
(start_image "image14")
(fill_image 0 0 (dimx_tile "image14") (dimy_tile "image14") 0)
(slide_image 0 0 (dimx_tile "image14") (dimy_tile "image14") "d:\\temp\\TYPE-S-1")
(end_image)
)
((= int1 2)
(start_image "image14")
(fill_image 0 0 (dimx_tile "image14") (dimy_tile "image14") 0)
(slide_image 0 0 (dimx_tile "image14") (dimy_tile "image14") "d:\\temp\\TYPE-S-2")
(end_image)
)
)
) piece14 : dialog {
label = "Piece mark of skew shear plate";
: row {
: column {
: boxed_column {
label = "Type of shear plate";
: image {
key = "image14";
color = dialog_foreground;
aspect_ratio = 1.50;
height = 7;
}
: button {
label = "Change type...";
key = "change_type";
}
}
spacer_1;

spacer_1;
ok_cancel;
}
}
} piece14_1 : dialog {
label = "type of shear plate";
: row {
: image_button {
key = "image1401";
color = dialog_foreground;
aspect_ratio = 1.50;
height = 8;
}
: image_button {
key = "image1402";
color = dialog_foreground;
aspect_ratio = 1.50;
height = 8;
}
}
ok_cancel;
}
 楼主| 发表于 2004-12-27 10:17:00 | 显示全部楼层
谢谢飞哥!我明白错在了. 还有感谢sieben,我想你是看不懂show_slb "image14" "TYPE-S-1")这个 吧?嘿嘿,是我大意了,忘记了把段函数贴上来了,这个是个自定义函数,显示图象到IMAGE_BUTTON.试了你的程序,测试通过,谢谢!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-30 00:27 , Processed in 0.176395 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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