wxPoint pt(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, GetId(), pt);
- evtCtx.SetEventObject(this);
- processed = GetEventHandler()->ProcessEvent(evtCtx);
+
+ // we could have got an event from our child, reflect it back
+ // to it if this is the case
+ wxWindow *win = NULL;
+ if ( wParam != m_hWnd )
+ {
+ win = FindItemByHWND((WXHWND)wParam);
+ }
+
+ if ( !win )
+ win = this;
+
+ evtCtx.SetEventObject(win);
+ processed = win->GetEventHandler()->ProcessEvent(evtCtx);
}
break;
#endif