m_isBeingDeleted = TRUE;
MSWDetachWindowMenu();
+
+ // VS: make sure there's no wxFrame with last focus set to us:
+ for (wxWindow *win = GetParent(); win; win = win->GetParent())
+ {
+ wxFrame *frame = wxDynamicCast(win, wxFrame);
+ if ( frame )
+ {
+ if ( frame->GetLastFocus() == this )
+ frame->SetLastFocus((wxWindow*)NULL);
+ break;
+ }
+ }
if ( m_parent )
m_parent->RemoveChild(this);
wxPoint pt(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
wxContextMenuEvent evtCtx(wxEVT_CONTEXT_MENU, GetId(), pt);
- GetEventHandler()->ProcessEvent(evtCtx);
-
- // set processed to true even if the event is not handled
- // because if we don't windows will propogate the
- // WM_CONTEXTMENU up the parent window chain, which we have
- // already done ourselves.
- processed = true;
+ processed = GetEventHandler()->ProcessEvent(evtCtx);
}
break;
#endif // __WIN32__