[求助]如何在DCL的edit_box组件得到焦点时触发某个子过程?
各位大侠:<br/> 如题,如何在DCL的edit_box组件得到焦点时触发某个子过程?书上说(action_tile)回复变量$reason的值为1时,表示用户选取该组件,但当按TAB键在各个edit_box组件中移动光标时,要本就无法触发(action_tile),必须要在edit_box组件上按回车键才能触发(action_tile).我的程序里有三个edit_box组件,另外还有一个image组件,我想光标在三个edit_box组件中来回移动(注意,不改变edit_box里的值,只是移动焦点)时更换image组件的幻灯图片,请熟悉DCL的高手给讲一讲,好吗?先谢谢了! 给你顶上去,我也很想知道 (action_tile "rb1" "(sub_rb1)")(action_tile "rb2" "(sub_rb2)")
(action_tile "kd" "(sub_rb1)")
(action_tile "kpy" "(sub_rb2)")
(action_tile "kr" "(sub_rb2)") 我的DCL驱动如下
(defun C:tt()
(defun dcl_qj ()
(setq dcl_id (load_dialog "tao.dcl"))
(new_dialog "qj" dcl_id)
(sub_rb1)
(show_list "popd" popd_list)
(show_list "poppy" poppy_list)
(show_list "popr" popr_list)
(set_tile "kd" (rtos (* 2 r) 2 2))
(action_tile "rb1" "(sub_rb1)")
(action_tile "rb2" "(sub_rb2)")
(action_tile "kd" "(sub_rb1)")
(action_tile "kpy" "(sub_rb2)")
(action_tile "kr" "(sub_rb2)")
(action_tile "popd" "(sub_popd $value)")
(action_tile "poppy" "(sub_poppy $value)")
(action_tile "popr" "(sub_popr $value)")
(action_tile "accept" "(ok_qj)(done_dialog 1)")
(action_tile "cancel" "(done_dialog 2)")
(setq dd (start_dialog))
(cond ((= dd 1)
(cond ((= ddtype 1) (qj1))
((= ddtype 2) (qj2))
)
)
((= dd 2) (unload_dialog dcl_id))
)
(unload_dialog dcl_id)
) ;defun end
(defun sub_rb1 ()
(setq ddtype 1)
(show_sld "kqj" "tao(qj1)")
(mode_tile "kpy" 0) ;true
(mode_tile "poppy" 0)
) ;_ 结束defun
(defun sub_rb2 ()
(setq ddtype 2)
(show_sld "kqj" "tao(qj2)")
(mode_tile "kpy" 1) ;false
(mode_tile "poppy" 1) ;false
) ;_ 结束defun
(defun sub_popd (vvs)
(set_tile "kd" (nth (atoi vvs) popd_list))
) ;defun end
(defun sub_poppy (vvs)
(set_tile "kpy" (nth (atoi vvs) poppy_list))
) ;defun end
(defun sub_popr (vvs)
(set_tile "kr" (nth (atoi vvs) popr_list))
) ;defun end
(defun ok_qj ()
(setq r (* 0.5 (atof (get_tile "kd"))))
(setq py (atof (get_tile "kpy")))
(setvar "FILLETRAD" (atof (get_tile "kr")))
)
(setq popd_list '("0.3" "0.35" "0.4" "0.45" "0.5"))
(setq poppy_list '("0.01" "0.02" "0.03" "0.04" "0.05"))
(setq popr_list '("0.1" "0.15" "0.2" "0.25" "0.3" "0.35"))
(if (and (or (= (type r) (type 1)) (= (type r) (type 1.0)))
(> r 0)
)
()
(setq r 0.175)
) ;_ 结束if
(command "ucs" "w")
(setvar "OSMODE" 0)
(setvar "CMDECHO" 0)
(dcl_qj)
(command "ucs" "p")
(princ)
) 这恐怕不行吧!只有焦点离开后才能触发动作啊! 回复 vocabulary 的帖子
要实现你这个想法,你可以这样,当焦点离开上一个控件,到下一个控件,由上一个控件触发下一个控件的动作,看起来就像焦点到下一个控件就触发了动作,实际上是上一个控件触发的!
页:
[1]