X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c887f67c21d408c0b24ddc843ad9e0fc5f868e21..27de83cd5b05a06ce08af0203d5d8ffecce83de3:/src/mac/carbon/nonownedwnd.cpp diff --git a/src/mac/carbon/nonownedwnd.cpp b/src/mac/carbon/nonownedwnd.cpp index c6d9c28841..c52ce38738 100644 --- a/src/mac/carbon/nonownedwnd.cpp +++ b/src/mac/carbon/nonownedwnd.cpp @@ -42,9 +42,6 @@ // globals // ---------------------------------------------------------------------------- -// list of all frames and modeless dialogs -wxWindowList wxModelessWindows; - static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 message, SInt32 param); // ============================================================================ @@ -852,8 +849,6 @@ bool wxNonOwnedWindow::Create(wxWindow *parent, if (GetExtraStyle() & wxFRAME_EX_METAL) MacSetMetalAppearance(true); - wxTopLevelWindows.Append(this); - if ( parent ) parent->AddChild(this); @@ -878,9 +873,6 @@ wxNonOwnedWindow::~wxNonOwnedWindow() wxRemoveMacWindowAssociation( this ) ; - if ( wxModelessWindows.Find(this) ) - wxModelessWindows.DeleteObject(this); - // avoid dangling refs if ( s_macDeactivateWindow == this ) s_macDeactivateWindow = NULL; @@ -903,18 +895,21 @@ bool wxNonOwnedWindow::SetBackgroundColour(const wxColour& c ) else if ( col == wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ) col = wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive)); - if ( !wxWindowBase::SetBackgroundColour(col) && m_hasBgCol ) + if ( !wxWindow::SetBackgroundColour(col) && m_hasBgCol ) return false ; - if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDocumentWindowBackground)) ) + if ( GetBackgroundStyle() != wxBG_STYLE_CUSTOM ) { - SetThemeWindowBackground( (WindowRef) m_macWindow, kThemeBrushDocumentWindowBackground, false ) ; - SetBackgroundStyle(wxBG_STYLE_CUSTOM); - } - else if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive)) ) - { - SetThemeWindowBackground( (WindowRef) m_macWindow, kThemeBrushDialogBackgroundActive, false ) ; - SetBackgroundStyle(wxBG_STYLE_CUSTOM); + if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDocumentWindowBackground)) ) + { + SetThemeWindowBackground( (WindowRef) m_macWindow, kThemeBrushDocumentWindowBackground, false ) ; + SetBackgroundStyle(wxBG_STYLE_SYSTEM); + } + else if ( col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive)) ) + { + SetThemeWindowBackground( (WindowRef) m_macWindow, kThemeBrushDialogBackgroundActive, false ) ; + SetBackgroundStyle(wxBG_STYLE_SYSTEM); + } } return true; } @@ -1005,17 +1000,19 @@ void wxNonOwnedWindow::DoMacCreateRealWindow( } else if ( HasFlag( wxPOPUP_WINDOW ) ) { - // TEMPORARY HACK! - // Until we've got a real wxPopupWindow class on wxMac make it a - // little easier for wxFrame to be used to emulate it and workaround - // the lack of wxPopupWindow. if ( HasFlag( wxBORDER_NONE ) ) + { wclass = kHelpWindowClass ; // has no border + attr |= kWindowNoShadowAttribute; + } else + { wclass = kPlainWindowClass ; // has a single line border, it will have to do for now - //attr |= kWindowNoShadowAttribute; // turn off the shadow Should we?? - group = GetWindowGroupOfClass( // float above other windows - kFloatingWindowClass) ; + } + group = GetWindowGroupOfClass(kFloatingWindowClass) ; + // make sure we don't deactivate something + activationScopeSet = true; + activationScope = kWindowActivationScopeNone; } else if ( HasFlag( wxCAPTION ) ) {