fixed event processing bug in tabmdi

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43157 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Benjamin Williams 2006-11-07 12:52:02 +00:00
parent 8896cb72d2
commit 7e1f1a1328
2 changed files with 13 additions and 12 deletions

View File

@ -81,8 +81,9 @@ public:
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;

View File

@ -173,14 +173,12 @@ void wxAuiMDIParentFrame::SetChildMenuBar(wxAuiMDIChildFrame* pChild)
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() &&
@ -196,14 +194,15 @@ bool wxAuiMDIParentFrame::ProcessEvent(wxEvent& event)
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;
}
@ -255,6 +254,7 @@ void wxAuiMDIParentFrame::ActivatePrevious()
void wxAuiMDIParentFrame::Init()
{
m_pLastEvt = NULL;
m_pClientWindow = NULL;
m_pActiveChild = NULL;
#if wxUSE_MENUS