simplify OnActivate menubar install code

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38438 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Surovell
2006-03-29 20:52:36 +00:00
parent 3c24dad6f7
commit 617bfeecfe

View File

@@ -24,7 +24,7 @@
#include "wx/mac/uma.h"
extern wxWindowList wxModelessWindows;
extern wxList wxPendingDelete;
//extern wxList wxPendingDelete;
BEGIN_EVENT_TABLE(wxFrame, wxFrameBase)
EVT_ACTIVATE(wxFrame::OnActivate)
@@ -204,7 +204,7 @@ void wxFrame::OnActivate(wxActivateEvent& event)
? m_winLastFocused->GetParent()
: NULL;
if ( !parent )
if (parent == NULL)
parent = this;
wxSetFocusToChild(parent, &m_winLastFocused);
@@ -213,11 +213,15 @@ void wxFrame::OnActivate(wxActivateEvent& event)
{
m_frameMenuBar->MacInstallMenuBar();
}
else if (wxTheApp->GetTopWindow() && wxTheApp->GetTopWindow()->IsKindOf(CLASSINFO(wxFrame)))
else
{
// Trying toplevel frame membar
if (((wxFrame*)wxTheApp->GetTopWindow())->GetMenuBar())
((wxFrame*)wxTheApp->GetTopWindow())->GetMenuBar()->MacInstallMenuBar();
wxFrame *tlf = wxDynamicCast( wxTheApp->GetTopWindow(), wxFrame );
if (tlf != NULL)
{
// Trying top-level frame membar
if (tlf->GetMenuBar())
tlf->GetMenuBar()->MacInstallMenuBar();
}
}
}
}