virtual void ActivatePrevious();
protected:
- wxAuiMDIClientWindow *m_pClientWindow;
- wxAuiMDIChildFrame *m_pActiveChild;
+ wxAuiMDIClientWindow* m_pClientWindow;
+ wxAuiMDIChildFrame* m_pActiveChild;
+ wxEvent* m_pLastEvt;
#if wxUSE_MENUS
wxMenu *m_pWindowMenu;
bool wxAuiMDIParentFrame::ProcessEvent(wxEvent& event)
{
- // Stops the same event being processed repeatedly
- static wxEventType inEvent = wxEVT_NULL;
- if (inEvent == event.GetEventType())
+ // stops the same event being processed repeatedly
+ if (m_pLastEvt == &event)
return false;
-
- inEvent = event.GetEventType();
-
- // Let the active child (if any) process the event first.
+ m_pLastEvt = &event;
+
+ // let the active child (if any) process the event first.
bool res = false;
if (m_pActiveChild &&
event.IsCommandEvent() &&
res = m_pActiveChild->GetEventHandler()->ProcessEvent(event);
}
- // If the event was not handled this frame will handle it!
if (!res)
{
- //res = GetEventHandler()->ProcessEvent(event);
+ // if the event was not handled this frame will handle it,
+ // which is why we need the protection code at the beginning
+ // of this method
res = wxEvtHandler::ProcessEvent(event);
}
- inEvent = wxEVT_NULL;
+ m_pLastEvt = NULL;
return res;
}
void wxAuiMDIParentFrame::Init()
{
+ m_pLastEvt = NULL;
m_pClientWindow = NULL;
m_pActiveChild = NULL;
#if wxUSE_MENUS