]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/toplevel.cpp
Finally removes occurences of OnMenuCommand and closes bug #1164678
[wxWidgets.git] / src / mac / carbon / toplevel.cpp
index 037f53b8e8c04ba9c93d886f8f9dda763d509502..538589ac0650ca4fab3cd29440b1b4ed2bd541a0 100644 (file)
@@ -531,7 +531,7 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
             eventleave.SetEventType( wxEVT_LEAVE_WINDOW );
             g_MacLastWindow->ScreenToClient( &eventleave.m_x, &eventleave.m_y );
             eventleave.SetEventObject( g_MacLastWindow ) ;
-
+            wxevent.SetId( g_MacLastWindow->GetId() ) ;
 #if wxUSE_TOOLTIPS
             wxToolTip::RelayEvent( g_MacLastWindow , eventleave);
 #endif // wxUSE_TOOLTIPS
@@ -543,6 +543,7 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
             evententer.SetEventType( wxEVT_ENTER_WINDOW );
             currentMouseWindow->ScreenToClient( &evententer.m_x, &evententer.m_y );
             evententer.SetEventObject( currentMouseWindow ) ;
+            wxevent.SetId( currentMouseWindow->GetId() ) ;
 #if wxUSE_TOOLTIPS
             wxToolTip::RelayEvent( currentMouseWindow , evententer);
 #endif // wxUSE_TOOLTIPS
@@ -567,6 +568,7 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev
         currentMouseWindow->ScreenToClient( &wxevent.m_x , &wxevent.m_y ) ;
 
         wxevent.SetEventObject( currentMouseWindow ) ;
+        wxevent.SetId( currentMouseWindow->GetId() ) ;
 
         // make tooltips current
 
@@ -1206,6 +1208,16 @@ void  wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
     // the root control level handleer
     MacInstallEventHandler( (WXWidget) m_peer->GetControlRef() ) ;
 
+#if TARGET_API_MAC_OSX
+    if ( m_macUsesCompositing && m_macWindow != NULL )
+    {
+        if ( GetExtraStyle() & wxFRAME_EX_METAL )
+            MacSetMetalAppearance( true ) ;
+    }
+#endif
+    
+    
+    
     // the frame window event handler
     InstallStandardEventHandler( GetWindowEventTarget(MAC_WXHWND(m_macWindow)) ) ;
     MacInstallTopLevelWindowEventHandler() ;
@@ -1270,7 +1282,7 @@ void wxTopLevelWindowMac::SetTitle(const wxString& title)
     UMASetWTitle( (WindowRef)m_macWindow , title , m_font.GetEncoding() ) ;
 }
 
-virtual wxString wxTopLevelWindowMac::GetTitle() const
+wxString wxTopLevelWindowMac::GetTitle() const
 {
     return wxWindow::GetLabel();
 }
@@ -1383,6 +1395,23 @@ bool wxTopLevelWindowMac::IsFullScreen() const
     return m_macFullScreenData != NULL ;
 }
 
+void wxTopLevelWindowMac::SetExtraStyle(long exStyle) 
+{
+    if ( GetExtraStyle() == exStyle )
+        return ;
+    
+    wxTopLevelWindowBase::SetExtraStyle( exStyle ) ;
+#if TARGET_API_MAC_OSX
+    if ( m_macUsesCompositing && m_macWindow != NULL )
+    {
+        bool metal = GetExtraStyle() & wxFRAME_EX_METAL ;
+        if ( MacGetMetalAppearance() != metal )
+            MacSetMetalAppearance( metal ) ;
+    }
+#endif
+}
+
+
 // we are still using coordinates of the content view, todo switch to structure bounds
 
 void wxTopLevelWindowMac::MacGetContentAreaInset( int &left , int &top , int &right , int &bottom )