// Author: Stefan Csomor
// Modified by:
// Created: 1998-01-01
-// RCS-ID: $Id$
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#endif
}
#elif defined(wxOSX_USE_COCOA)
+ wxUnusedVar(inActivate);
+ wxUnusedVar(inWindowRef);
// TODO: implement me!
#endif
}
}
bool wxMDIParentFrame::Create(wxWindow *parent,
- wxWindowID id,
+ wxWindowID winid,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
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;
m_clientWindow = OnCreateClient();
+ if ( !m_clientWindow || !m_clientWindow->CreateClient(this, style) )
+ return false;
- return m_clientWindow != NULL;
+ return true;
}
wxMDIParentFrame::~wxMDIParentFrame()
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;
}
bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
- wxWindowID id,
+ wxWindowID winid,
const wxString& title,
const wxPoint& pos,
const wxSize& size,
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 );
{
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)
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;
// 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();
}
//-----------------------------------------------------------------------------