]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/nonownedwnd.mm
Make wxSTAY_ON_TOP and other window styles toggleable via SetWindowStyleFlag under...
[wxWidgets.git] / src / osx / cocoa / nonownedwnd.mm
index c19341742eea0e826179eb545a486e6e171f9baf..b0af31cc070e3306d1da6fc9994b8797849bce47 100644 (file)
@@ -533,6 +533,21 @@ void wxNonOwnedWindowCocoaImpl::SetExtraStyle( long exStyle )
     }
 }
 
+void wxNonOwnedWindowCocoaImpl::SetWindowStyleFlag( long style )
+{
+    if (m_macWindow)
+    {
+        CGWindowLevel level = kCGNormalWindowLevel;
+        
+        if (style & wxSTAY_ON_TOP)
+            level = kCGUtilityWindowLevel;
+        else if (( style & wxFRAME_FLOAT_ON_PARENT ) || ( style & wxFRAME_TOOL_WINDOW ))
+            level = kCGFloatingWindowLevel;
+        
+        [m_macWindow setLevel: level];
+    }
+}
+
 bool wxNonOwnedWindowCocoaImpl::SetBackgroundStyle(wxBackgroundStyle WXUNUSED(style))
 {
     return true;