[DUG] Component that knows when a click occurs elsewhere (second
try)
Paul Lyons
p.lyons at paradise.net.nz
Thu Nov 24 23:25:17 NZDT 2005
Hi
I submitted this a couple of days ago, but the formatting seemed to
confuse things somewhat, so I'm resubmitting without any formatting. If
you've read it already, I apologise. I don't want to waste people's time!
I'm writing a subclass of tComponent, tWCL, that calls
reactionMethod when the user clicks one something else - on another
component, but also on the form..
When I originally wrote tWCL, I gave it an onExit handler. When the
user clicked on some other component, the tWCL object's onExit handler
was called automatically, and this called reactionMethod. I also
added the handler form.onClick, which explicitly set the tWCL
object's enabled property to FALSE when the user clicked on the form,
thereby also invoking the object's onExit handler, which in turn
called reactionMethod, as required
Now, however, I want to turn tWCL into a component, and I don't
want the user to have to write a form.onClick handler. How can I
get my component to detect that the user has clicked on the form, so
that it can call reactionMethod?
Thanks
Paul
More information about the Delphi
mailing list