]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/mdi.cpp
Set missing Language: headers in PO files.
[wxWidgets.git] / src / osx / carbon / mdi.cpp
index 3367c1bc8ba1482cd5a07af96d511c84b1531f3c..9ccc98880a8ef0fdf9f0b48ca5143f9755c40b21 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     1998-01-01
-// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -71,6 +70,8 @@ void UMAHighlightAndActivateWindow( WindowRef inWindowRef , bool inActivate )
 #endif
     }
 #elif defined(wxOSX_USE_COCOA)
+    wxUnusedVar(inActivate);
+    wxUnusedVar(inWindowRef);
 // TODO: implement me!
 #endif
 }
@@ -86,7 +87,7 @@ void wxMDIParentFrame::Init()
 }
 
 bool wxMDIParentFrame::Create(wxWindow *parent,
-    wxWindowID id,
+    wxWindowID winid,
     const wxString& title,
     const wxPoint& pos,
     const wxSize& size,
@@ -112,14 +113,16 @@ 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;
 
     m_clientWindow = OnCreateClient();
+    if ( !m_clientWindow || !m_clientWindow->CreateClient(this, style) )
+        return false;
 
-    return m_clientWindow != NULL;
+    return true;
 }
 
 wxMDIParentFrame::~wxMDIParentFrame()
@@ -245,7 +248,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;
@@ -322,7 +327,7 @@ void wxMDIChildFrame::Init()
 }
 
 bool wxMDIChildFrame::Create(wxMDIParentFrame *parent,
-                             wxWindowID id,
+                             wxWindowID winid,
                              const wxString& title,
                              const wxPoint& pos,
                              const wxSize& size,
@@ -333,10 +338,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 );
 
@@ -354,7 +359,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)
@@ -398,7 +403,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;
@@ -409,7 +416,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();
 }
 
 //-----------------------------------------------------------------------------