Donovan,
Would
it not be better to expose an OnClick event on your component itself instead of
exposing your internal button? You could call it OnButtonClick to
differentiate it from any other internal control event. This way, you can
perform any code you want before/after you internally call Click on your
embedded button.
IMHO,
from a developer using your component, I would think logically of your component
as a single control, not a collection of controls.
HTH,
Conor
-----Original Message-----G'Day,
From: Donovan J. Edye [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 21 November 2002 11:42 a.m.
To: Multiple recipients of list delphi
Subject: [DUG]: [Q] Event Hooking.....
I was just curious about some approaches to achieve responding to the event of an embedded component in my component. Clear as mud? An example:
Lets say I have a component MyComponent that has a published property MyButton : TButton. Now I want to take some action when the user clicks the button assigned to MyButton. However any code that they have assigned to the click event for the button must also be fired.
So basically I want to transparently hook the OnClick event. The only way I can think of doing this is by responding to the apropriate CN_*, CM_* message. Is there another way to do this? If not what messages should I be looking at responding to?-- Donovan
----------------------------------------------------------------------
Donovan J. Edye [www.edye.wattle.id.au]
Namadgi Systems [www.namsys.com.au]
Voice: +61 2 6285-3460
Fax: +61 2 6285-3459
TVisualBasic = Class(None);
Heard just before the 'Big Bang': "...Uh Oh...."
----------------------------------------------------------------------
GXExplorer [http://www.gxexplorer.org] Freeware Windows Explorer
replacement. Also includes freeware delphi windows explorer components.
----------------------------------------------------------------------