]> git.saurik.com Git - wxWidgets.git/commitdiff
ShowWithoutActivating fix for OS X Cocoa, and also add support for shaped windows...
authorKevin Ollivier <kevino@theolliviers.com>
Sun, 15 Nov 2009 01:36:30 +0000 (01:36 +0000)
committerKevin Ollivier <kevino@theolliviers.com>
Sun, 15 Nov 2009 01:36:30 +0000 (01:36 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/cocoa/nonownedwnd.mm

index e5e031a6046bf90a7a4ed9bd7bbebd6fcbe01382..066989265c88e06b15dd782706f10f6b5eddc245 100644 (file)
@@ -481,7 +481,8 @@ void wxNonOwnedWindowCocoaImpl::Lower()
 
 void wxNonOwnedWindowCocoaImpl::ShowWithoutActivating()
 {
-    [[m_macWindow contentView] setNeedsDisplay:YES];
+    [m_macWindow orderBack:nil];
+    [[m_macWindow contentView] setNeedsDisplay: YES];
 }
 
 bool wxNonOwnedWindowCocoaImpl::Show(bool show)
@@ -493,7 +494,7 @@ bool wxNonOwnedWindowCocoaImpl::Show(bool show)
             [m_macWindow makeKeyAndOrderFront:nil];
         else 
             [m_macWindow orderFront:nil]; 
-        ShowWithoutActivating();
+        [[m_macWindow contentView] setNeedsDisplay: YES];
     }
     else
         [m_macWindow orderOut:nil];
@@ -556,8 +557,14 @@ void wxNonOwnedWindowCocoaImpl::SetWindowStyleFlag( long style )
     }
 }
 
-bool wxNonOwnedWindowCocoaImpl::SetBackgroundStyle(wxBackgroundStyle WXUNUSED(style))
+bool wxNonOwnedWindowCocoaImpl::SetBackgroundStyle(wxBackgroundStyle style)
 {
+    if ( style == wxBG_STYLE_TRANSPARENT )
+    {
+        [m_macWindow setOpaque:NO];
+        [m_macWindow setBackgroundColor:[NSColor clearColor]];
+    }
+
     return true;
 }
 
@@ -600,7 +607,10 @@ void wxNonOwnedWindowCocoaImpl::GetContentArea( int& left, int &top, int &width,
 
 bool wxNonOwnedWindowCocoaImpl::SetShape(const wxRegion& WXUNUSED(region))
 {
-    return false;
+    [m_macWindow setOpaque:NO];
+    [m_macWindow setBackgroundColor:[NSColor clearColor]];
+
+    return true;
 }
 
 void wxNonOwnedWindowCocoaImpl::SetTitle( const wxString& title, wxFontEncoding encoding )