X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/de0d209531f148e8d4b18149d0a3ca25dbc88075..47e175a24f862aa8b7ca7dd4a2bb5957991e7f2d:/src/osx/carbon/mdi.cpp?ds=sidebyside diff --git a/src/osx/carbon/mdi.cpp b/src/osx/carbon/mdi.cpp index eb86566919..80f31dc379 100644 --- a/src/osx/carbon/mdi.cpp +++ b/src/osx/carbon/mdi.cpp @@ -88,7 +88,7 @@ void wxMDIParentFrame::Init() } bool wxMDIParentFrame::Create(wxWindow *parent, - wxWindowID id, + wxWindowID winid, const wxString& title, const wxPoint& pos, const wxSize& size, @@ -114,7 +114,7 @@ bool wxMDIParentFrame::Create(wxWindow *parent, m_windowMenu->Append(IDM_WINDOWNEXT, wxT("&Next")); } - if ( !wxFrame::Create( parent , id , title , pos , size , style , name ) ) + if ( !wxFrame::Create( parent , winid , title , pos , size , style , name ) ) return false; m_parentFrameActive = true; @@ -249,7 +249,9 @@ void wxMDIParentFrame::MacActivate(long timestamp, bool activating) else // schedule ourselves for deactivation { if (s_macDeactivateWindow) + { wxLogTrace(TRACE_MDI, wxT("window=%p SHOULD have been deactivated, oh well!"), s_macDeactivateWindow); + } wxLogTrace(TRACE_MDI, wxT("Scheduling delayed MDI Parent deactivation")); s_macDeactivateWindow = this; @@ -326,7 +328,7 @@ void wxMDIChildFrame::Init() } bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, - wxWindowID id, + wxWindowID winid, const wxString& title, const wxPoint& pos, const wxSize& size, @@ -337,10 +339,10 @@ bool wxMDIChildFrame::Create(wxMDIParentFrame *parent, SetName(name); - if ( id == wxID_ANY ) - id = (int)NewControlId(); + if ( winid == wxID_ANY ) + winid = (int)NewControlId(); - wxNonOwnedWindow::Create( parent, id, pos , size , MacRemoveBordersFromStyle(style) , name ) ; + wxNonOwnedWindow::Create( parent, winid, pos , size , MacRemoveBordersFromStyle(style) , name ) ; SetTitle( title ); @@ -358,7 +360,7 @@ void wxMDIChildFrame::MacActivate(long timestamp, bool activating) { wxLogTrace(TRACE_MDI, wxT("MDI child=%p MacActivate(0x%08lx,%s)"),this, timestamp, activating ? wxT("ACTIV") : wxT("deact")); - wxMDIParentFrame *mdiparent = wxDynamicCast(m_parent, wxMDIParentFrame); + wxMDIParentFrame *mdiparent = m_mdiParent; wxASSERT(mdiparent); if (activating) @@ -402,7 +404,9 @@ void wxMDIChildFrame::MacActivate(long timestamp, bool activating) else // schedule ourselves for deactivation { if (s_macDeactivateWindow) + { wxLogTrace(TRACE_MDI, wxT("window=%p SHOULD have been deactivated, oh well!"), s_macDeactivateWindow); + } wxLogTrace(TRACE_MDI, wxT("Scheduling delayed deactivation")); s_macDeactivateWindow = this; @@ -413,7 +417,9 @@ void wxMDIChildFrame::MacActivate(long timestamp, bool activating) // MDI operations void wxMDIChildFrame::Activate() { - Raise (); + // The base class method calls Activate() so skip it to avoid infinite + // recursion and go directly to the real Raise() implementation. + wxFrame::Raise(); } //-----------------------------------------------------------------------------