From: Stefan Csomor Date: Mon, 7 Mar 2011 19:04:55 +0000 (+0000) Subject: window level support X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/9d243a476a77e252cfbed5939f3fa1830728196e window level support git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67144 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/osx/cocoa/private.h b/include/wx/osx/cocoa/private.h index 0bdaa13c59..78b5c3d2f9 100644 --- a/include/wx/osx/cocoa/private.h +++ b/include/wx/osx/cocoa/private.h @@ -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) diff --git a/include/wx/osx/core/private.h b/include/wx/osx/core/private.h index 6da5f8c7b0..08558c8750 100644 --- a/include/wx/osx/core/private.h +++ b/include/wx/osx/core/private.h @@ -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) diff --git a/src/osx/cocoa/nonownedwnd.mm b/src/osx/cocoa/nonownedwnd.mm index 4b73f1e26a..d479cc6e0d 100644 --- a/src/osx/cocoa/nonownedwnd.mm +++ b/src/osx/cocoa/nonownedwnd.mm @@ -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; } +