Forwarding child events to a top level window

Randy Sales randy.sales at impinj.com
Fri Aug 3 08:46:34 PDT 2007


I agree with your concern about modifying existing event data, hence my
question.  I suppose I could define a custom event and forward that
instead, or maybe clone the original event, but the event as provided
has a NULL data object and seemed liked a reasonable vehicle for the
control-specific information.

Regarding what I'm really trying to accomplish with this approach, I
need to catch the original event in the control first because the
control has information needed by the top level app.  The control must
forward the information onto the top level app, where it will use the
information in concert with information from other controls.  So the app
is acting as a control-spanning entity and must be the final recipient
of the event, but only after the event has been populated with
control-specific information.

- Randy

-----Original Message-----
From: Vadim Zeitlin [mailto:vadim at wxwidgets.org] 
Sent: Friday, August 03, 2007 4:25 AM
To: wx-users at lists.wxwidgets.org
Subject: Re[2]: Forwarding child events to a top level window
Importance: Low

On Thu, 2 Aug 2007 21:35:35 -0700 Randy Sales <randy.sales at impinj.com>
wrote:

RS> Vadim, thanks for the info.  Actually, my second question was the
most
RS> important.
RS> ...
RS> 2) Are there any issues with attaching a data object to the event
before
RS> passing it on, as I have done in this example?  I could find no
RS> documentation or mail stating what's valid.  Is there a good source
of
RS> info for this type of question?

 It's not a good idea to modify an existing event object like this: it
might already contain its own client data (associated with the control
which generated the event). If you replace it with your own, the
original
data is lost. Also, as I said, you shouldn't be having this forwarding
function anyhow as this is done automatically, so why bother?

 I don't know what exactly are you doing but it looks like you want to
catch the original command event in your control class and from there
generate another, custom, event containing your extra data.

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
For additional commands, e-mail: wx-users-help at lists.wxwidgets.org





More information about the wx-users mailing list