明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2148|回复: 6

怎樣實現image_button可以象button一樣只按一次就可以執行一個動作?而不需要雙擊圖

[复制链接]
发表于 2004-11-1 14:00:00 | 显示全部楼层 |阅读模式
怎樣實現image_button可以象button一樣只按一次就可以執行一個動作?而不需要雙擊圖標.[br]怎样实现image_button可以象button一样只按一次就可以执行一个动作?而不需要双击图标.
发表于 2004-11-1 14:30:00 | 显示全部楼层
Same as the button


(action_tile "[I]image_button key here[/I]" "([I]your function name here[/I])")
发表于 2004-11-1 16:48:00 | 显示全部楼层
DCL: :image_button{
key="XXX";
width=55;
height=15;
color=-2;
} LSP: (action_tile "XXX" "(YOURFUN)")
 楼主| 发表于 2004-11-1 18:37:00 | 显示全部楼层
非常的感谢楼上二位兄台的指点迷津!问题解决!
 楼主| 发表于 2004-11-1 19:16:00 | 显示全部楼层
对话框关闭不了,动作无法执行 (defun c:col_lty (/ os dcl_id key_list sld_list com_list dd com num)
(setvar "cmdecho" 0)
(command "undo" "be")
(setq os (getvar "osmode"))
(setq dcl_id (load_dialog "col_lty.dcl"))
(if (< dcl_id 0)
(exit)
)
(if (not (new_dialog "col_lty" dcl_id))
(exit)
)
(setq key_list (list "a1" "a2" "a3" "b1" "b2" "b3" "c1" "c2" "c3"))
(setq sld_list (list "A1.sld" "A2.sld" "A3.sld"
"B1.sld" "B2.sld" "B3.sld"
"C1.sld" "C2.sld" "C3.sld"
)
) ;幻灯片列表
(col_lty_initdata)
(action_tile "a1" "(coma1)")
(action_tile "a2" "(coma2)")
(action_tile "a3" "(coma3)")
(action_tile "b1" "(comb1)")
(action_tile "b2" "(comb2)")
(action_tile "b3" "(comb3)")
(action_tile "c1" "(comc1)")
(action_tile "c2" "(comc2)")
(action_tile "c3" "(comc3)")
(action_tile "cancel" "(done_dialog 0)")
(setq dd (start_dialog))
(unload_dialog dcl_id)
(setvar "osmode" os)
(command "undo" "e")
(princ)
)
发表于 2004-11-1 19:56:00 | 显示全部楼层
又没对话框,程序又不完整别人怎么给你测试啊
 楼主| 发表于 2004-11-1 20:27:00 | 显示全部楼层
(defun c:col_lty (/ os dcl_id sld_list dd)
(setvar "cmdecho" 0)
(command "undo" "be")
(setq os (getvar "osmode"))
(setq dcl_id (load_dialog "col_lty.dcl"))
(if (< dcl_id 0)
(exit)
)
(if (not (new_dialog "col_lty" dcl_id))
(exit)
)
(setq sld_list (list "A1.sld" "A2.sld" "A3.sld"
"B1.sld" "B2.sld" "B3.sld"
"C1.sld" "C2.sld" "C3.sld"
)
) ;幻灯片列表
(col_lty_initdata)
(action_tile "a1" "(done_dialog 1)")
(action_tile "a2" "(done_dialog 2)")
(action_tile "a3" "(done_dialog 3)")
(action_tile "b1" "(done_dialog 4)")
(action_tile "b2" "(done_dialog 5)")
(action_tile "b3" "(done_dialog 6)")
(action_tile "c1" "(done_dialog 7)")
(action_tile "c2" "(done_dialog 8)")
(action_tile "c3" "(done_dialog 9)")
(action_tile "cancel" "(done_dialog 0)")
(setq dd (start_dialog))
(unload_dialog dcl_id)
(if (= dd 1)
(coma1)
)
(if (= dd 2)
(coma2)
)
(if (= dd 3)
(coma3)
)
(if (= dd 4)
(comb1)
)
(if (= dd 5)
(comb2)
)
(if (= dd 6)
(comb3)
)
(if (= dd 7)
(comc1)
)
(if (= dd 8)
(comc2)
)
(if (= dd 9)
(comc3)
)
(setvar "osmode" os)
(command "undo" "e")
(princ)
)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-9-30 08:39 , Processed in 0.271863 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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