找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 551|回复: 5

[求助] [求助]:图像控件的问题

[复制链接]
发表于 2004-11-24 12:55:23 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

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

×
如何用$x  $y 得到图像控件中鼠标单击点和用$reason  双击关闭。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2004-11-24 12:58:41 | 显示全部楼层
关注中,我也同样等待回复!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2004-11-24 14:08:18 | 显示全部楼层
不太懂,能不能说明白一些,小人才疏学浅
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2004-11-24 20:37:16 | 显示全部楼层
帮助文件
You can handle an image button simply as a button—that is, you can use it to trigger a single action. However, you can also use the PDB feature to define regions of the button. With regions defined, the action taken depends on the part of the image button the user selects. The mechanism for this is straightforward: an image button's action or callback returns the (X,Y) location that the user selected. The coordinates are within the range of the particular image button tile (as returned by the dimension functions). Your application must assign a meaning to select locations by implicitly defining regions of the image. The DDVPOINT dialog box makes good use of this feature. You can view this by loading and running the ddvpoint.lsp file in the AutoCAD Support directory.

In the following example, your image button has two color swatches created by fill_image. You want to select either one or the other, depending on which region the user selects. If the image button is divided horizontally (dark above and light below), your action needs to test only the one dimension:

(action_tile "image_sel" "(pick_shade $key $value $y)")
  ...
(defun pick_shade (key val y)
  (setq threshold
    (/ ( dimy_tile  key) 2))  ;Image is divided horizontally.
  (if (> y threshold)         ;Remember that the origin is at
    (setq result "Light")     ;upper left.
  (setq result "Dark") )
)


$reason

The reason code that indicates which user action triggered the action. Used with edit_box, list_box, image_button, and slider tiles.

This variable indicates why the action occurred. Its value is set for any kind of action, but you need to inspect it only when the action is associated with an edit_box, list_box, image_button, or slider tile. See Callback Reasons in the following section for details.


(action_tile "image"  "(if (= $reason 4)(done_dialog 0))") ;;;双击图像按钮关闭对话框
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2004-11-28 11:04:55 | 显示全部楼层
有谁能写一个例子看看?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 488个

财富等级: 日进斗金

发表于 2004-11-28 15:08:09 | 显示全部楼层

  1. 一旦点下去,$x $y就已经有值了.
  2. (action_tile "abc""(do_abc)")

  3. ;;;----------------------------------

  4. (defun do_abc()
  5.   (princ $x)
  6.   (princ $Y)
  7. )


  8. ;;;========================
  9. 判断左右,就这么写
  10. (defun do_abc( / x)
  11.   (setq x(dimx_tile "abc")
  12.            x(/ x 2.)
  13.   )
  14.   (if(< $x x)(princ "\n你点了左边:")
  15.      (princ "\n你点了右边:")
  16.   )
  17. )
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-27 15:39 , Processed in 0.237810 second(s), 39 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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