Make wxSTAY_ON_TOP and other window styles toggleable via SetWindowStyleFlag under OS X Cocoa.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62568 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Kevin Ollivier 2009-11-08 03:03:06 +00:00
parent 5c892f574c
commit b6dc21e768
5 changed files with 33 additions and 1 deletions

View File

@ -210,6 +210,7 @@ public :
bool SetTransparent(wxByte alpha);
bool SetBackgroundColour(const wxColour& col );
void SetExtraStyle( long exStyle );
void SetWindowStyleFlag( long style );
bool SetBackgroundStyle(wxBackgroundStyle style);
bool CanSetTransparent();

View File

@ -685,7 +685,11 @@ public :
virtual void SetExtraStyle( long WXUNUSED(exStyle) )
{
}
virtual void SetWindowStyleFlag( long WXUNUSED(style) )
{
}
virtual bool SetBackgroundStyle(wxBackgroundStyle WXUNUSED(style))
{
return false ;

View File

@ -80,6 +80,7 @@ public:
static void MacDelayedDeactivation(long timestamp);
virtual void MacActivate( long timestamp , bool inIsActivating ) ;
virtual void SetWindowStyleFlag(long flags);
virtual void Raise();
virtual void Lower();

View 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;

View File

@ -217,6 +217,17 @@ bool wxNonOwnedWindow::SetBackgroundColour(const wxColour& c )
return true;
}
void wxNonOwnedWindow::SetWindowStyleFlag(long flags)
{
if (flags == GetWindowStyleFlag())
return;
wxWindow::SetWindowStyleFlag(flags);
if (m_nowpeer)
m_nowpeer->SetWindowStyleFlag(flags);
}
// Raise the window to the top of the Z order
void wxNonOwnedWindow::Raise()
{