Is adding codes to all objects' gotfocus() the only/best solution?

--
iTech Consulting Co., Ltd.
Specialized in providing ePOS solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852) 2325 3883 Fax: (852)2325 8288

Re: Last object that got focus() at the moment I clicked a button? by Olaf

Olaf
Mon Jan 08 06:36:06 CST 2007

event order regarding focus is:

control.when
control.gotfocus
...
control.valid
control.lostfocus

if ControlA has focus and user clicks on ControlB, being a button,
the event order should be (when the focus does change to B):

ControlA.Valid
ControlB.When
ControlA.LostFocus
ControlB.GotFocus
and in the case of a button ControlB.Click

So you should be able to see in the buttons When event,
what control now has the focus. In fact a reference to
that control should then still be in Form.ActiveControl.

Didn't test that though, I may be wrong, could also be, that
ControlB.When comes even before ControlA.Valid.

You could record event order with
SET COVERAGE TO Filename

Bye, Olaf.



Re: SET COVERAGE by Man-wai

Man-wai
Mon Jan 08 06:54:53 CST 2007

> You could record event order with
> SET COVERAGE TO Filename

Your coverage profiler trick is handy. But it should produce
more elaborate output. Right now, it reports the class of
the object that fired an method, not the object itself.


--
.~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org
/ v \ Simplicity is Beauty! May the Force and Farce be with you!
/( _ )\ (Ubuntu 6.10) Linux 2.6.19.1
^ ^ 20:53:01 up 27 days 3:05 0 users load average: 1.00 1.00 1.00
news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk