handling wxSTAY_ON_TOP by changing the window group instead of window class

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2004-12-28 10:18:48 +00:00
parent d5301e336f
commit e353795ec5

View File

@ -1003,6 +1003,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
WindowClass wclass = 0;
WindowAttributes attr = kWindowNoAttributes ;
WindowGroupRef group = NULL ;
if ( HasFlag( wxFRAME_TOOL_WINDOW) )
{
@ -1073,8 +1074,10 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
attr |= kWindowLiveResizeAttribute;
}
if (HasFlag(wxSTAY_ON_TOP))
wclass = kUtilityWindowClass;
if ( HasFlag(wxSTAY_ON_TOP) )
{
group = GetWindowGroupOfClass(kUtilityWindowClass) ;
}
#if TARGET_API_MAC_OSX
attr |= kWindowCompositingAttribute;
@ -1095,6 +1098,9 @@ void wxTopLevelWindowMac::MacCreateRealWindow( const wxString& title,
err = ::CreateNewWindow( wclass , attr , &theBoundsRect , (WindowRef*)&m_macWindow ) ;
}
if ( err == noErr && m_macWindow != NULL && group != NULL )
SetWindowGroup( (WindowRef) m_macWindow , group ) ;
wxCHECK_RET( err == noErr, wxT("Mac OS error when trying to create new window") );
// the create commands are only for content rect, so we have to set the size again as