]> git.saurik.com Git - wxWidgets.git/commitdiff
window level support
authorStefan Csomor <csomor@advancedconcepts.ch>
Mon, 7 Mar 2011 19:04:55 +0000 (19:04 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Mon, 7 Mar 2011 19:04:55 +0000 (19:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67144 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/osx/cocoa/private.h
include/wx/osx/core/private.h
src/osx/cocoa/nonownedwnd.mm

index 0bdaa13c59ec30290804e314fcc1ae6ce8a8808f..78b5c3d2f9ecb681fba94ea318995033d1b04399 100644 (file)
@@ -240,7 +240,11 @@ public :
     virtual bool IsModified() const;
 
     wxNonOwnedWindow*   GetWXPeer() { return m_wxPeer; }
+    
+    CGWindowLevel   GetWindowLevel() const { return m_macWindowLevel; }
+    void            RestoreWindowLevel();
 protected :
+    CGWindowLevel   m_macWindowLevel;
     WXWindow        m_macWindow;
     void *          m_macFullScreenData ;
     DECLARE_DYNAMIC_CLASS_NO_COPY(wxNonOwnedWindowCocoaImpl)
index 6da5f8c7b0b9b2aaa569627d5650f32ee3a08da3..08558c875015d9baa4998c0743b45432b2f6fa47 100644 (file)
@@ -853,6 +853,8 @@ public :
     virtual void SetModified(bool WXUNUSED(modified)) { }
     virtual bool IsModified() const { return false; }
 
+    virtual CGWindowLevel GetWindowLevel() const { return kCGNormalWindowLevel; }
+    virtual void RestoreWindowLevel() {}
 protected :
     wxNonOwnedWindow*   m_wxPeer;
     DECLARE_ABSTRACT_CLASS(wxNonOwnedWindowImpl)
index 4b73f1e26afade85dc9f9a3ade6e3f9f1b3e6bb1..d479cc6e0d2909f7b2f60649629d20b0433e4dff 100644 (file)
@@ -632,6 +632,7 @@ long style, long extraStyle, const wxString& WXUNUSED(name) )
     }
 
     [m_macWindow setLevel:level];
+    m_macWindowLevel = level;
 
     [m_macWindow setDelegate:controller];
 
@@ -742,6 +743,7 @@ void wxNonOwnedWindowCocoaImpl::SetWindowStyleFlag( long style )
             level = kCGFloatingWindowLevel;
         
         [m_macWindow setLevel: level];
+        m_macWindowLevel = level;
     }
 }
 
@@ -950,6 +952,16 @@ bool wxNonOwnedWindowCocoaImpl::IsModified() const
     return [m_macWindow isDocumentEdited];
 }
 
+void wxNonOwnedWindowCocoaImpl::RestoreWindowLevel()
+{
+    if ( [m_macWindow level] != m_macWindowLevel )
+        [m_macWindow setLevel:m_macWindowLevel];
+}
+
+//
+//
+//
+
 wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, WXWindow nativeWindow)
 {
     wxNonOwnedWindowCocoaImpl* now = new wxNonOwnedWindowCocoaImpl( wxpeer );
@@ -964,3 +976,4 @@ wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWind
     now->Create( parent, pos, size, style , extraStyle, name );
     return now;
 }
+