Proper way to propogate an Event

I am attempting to create a custom control consisting of a CONTAINER CONTROL in which is a TEXTAREA CONTROL

I need to create a KEYDOWN event that is exposed by the CONTAINER but contains special code inside the TextArea

So the developer sees the Container KEYDOWN and can return FALSE if they don’t want to pass the key
but otherwise it propogates down to the embedded TextArea to then return TRUE or FALSE based on the code there

Before I needed the CC, I just subclassed the TA and added an Event Definition , but now that there are more layers I’m not sure who should do what

Basically the CC should be the only point for the developer to interact with KeyDown, but the KeyDown in the TA has to do stuff unless it gets a FALSE from the CC

Hope that makes sense

ok… think I solved it

  • in the CC : add a KEYDOWN event definition
  • in the CC : set the actual keydown to RETURN keyDown(key) and nothing else
  • in the TA : add special handling code with first line being IF keydown(key)=true then return

This causes the embedded TA to reference the Keydown event in the CC, which is turn forwards to the control Instance where the developer can over-ride …