Forwarding child events to a top level window

Vadim Zeitlin vadim at wxwidgets.org
Fri Aug 3 09:14:17 PDT 2007


On Fri, 3 Aug 2007 08:46:34 -0700 Randy Sales <randy.sales at impinj.com> wrote:

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

 I don't say that what you do doesn't work (it probably does) but it
doesn't seem elegant to me to generate 2 "duplicate" events like this.
Also, having a custom event class would allow you to add convenient
accessors for the extra data while with your approach you have to extract
the client data with a cast.

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

 All I can say is repeat that for me this really calls for a
control-specific event.

 Regards,
VZ

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





More information about the wx-users mailing list