Forwarding child events to a top level window

Randy Sales randy.sales at impinj.com
Thu Aug 2 21:35:35 PDT 2007


Vadim, thanks for the info.  Actually, my second question was the most
important.

void CEmVirtualViewTreeCtrl::OnVirtualRetrieve( wxCommandEvent& event )
{
    // First get a pointer the the data I need to forward with the
command
    wxTreeItemId pItem = GetSelection( );
    CEmVirtualTreeItemData* pItemData = ... some data I need to
forward...

    // Now store the address of the data in the event object
>>>    event.SetClientData( pItemData );  <<<

    // Finally, forward the event to the main window
    wxWindow * pMainWindow = wxGetApp().GetTopWindow();
    pMainWindow->GetEventHandler()->ProcessEvent( event );
 }

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

Thanks,
Randy

-----Original Message-----
From: Vadim Zeitlin [mailto:vadim at wxwidgets.org] 
Sent: Thursday, August 02, 2007 7:01 PM
To: wx-users at lists.wxwidgets.org
Subject: Re: Forwarding child events to a top level window
Importance: Low

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

RS> I need to forward an event from a child window/control to the
main/top
RS> window of my application and I've been unable to find a description
of
RS> how to do this.

 This happens by default for the command events (i.e. those deriving
from
wxCommandEvent) so you have nothing to do.

 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