X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7fc641aff97d5f100b94cabb0288d3c4261e5328..787f0fc4f3eb08f1065d86e44ace8d7453e1b1b3:/src/mac/carbon/toplevel.cpp?ds=sidebyside diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index 6a9fb50ef1..778bd56588 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -390,59 +390,6 @@ void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent ) } } -ControlRef wxMacFindSubControl( wxTopLevelWindowMac* toplevelWindow, const Point& location , ControlRef superControl , ControlPartCode *outPart ) -{ - if ( superControl ) - { - UInt16 childrenCount = 0 ; - ControlHandle sibling ; - Rect r ; - OSStatus err = CountSubControls( superControl , &childrenCount ) ; - if ( err == errControlIsNotEmbedder ) - return NULL ; - - wxASSERT_MSG( err == noErr , wxT("Unexpected error when accessing subcontrols") ) ; - - for ( UInt16 i = childrenCount ; i >=1 ; --i ) - { - err = GetIndexedSubControl( superControl , i , & sibling ) ; - if ( err == errControlIsNotEmbedder ) - return NULL ; - - wxASSERT_MSG( err == noErr , wxT("Unexpected error when accessing subcontrols") ) ; - if ( IsControlVisible( sibling ) ) - { - UMAGetControlBoundsInWindowCoords( sibling , &r ) ; - if ( MacPtInRect( location , &r ) ) - { - ControlHandle child = wxMacFindSubControl( toplevelWindow , location , sibling , outPart ) ; - if ( child ) - { - return child ; - } - else - { - Point testLocation = location ; - - if ( toplevelWindow ) - { - testLocation.h -= r.left ; - testLocation.v -= r.top ; - } - - *outPart = TestControl( sibling , testLocation ) ; - - return sibling ; - } - } - } - } - } - - return NULL ; -} - - #define NEW_CAPTURE_HANDLING 1 pascal OSStatus @@ -603,31 +550,6 @@ wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler), if (currentMouseWindow->CanAcceptFocus() && wxWindow::FindFocus()!=currentMouseWindow) currentMouseWindow->SetFocus(); } - - // if built-in find control is finding the wrong control (ie static box instead of overlaid - // button, we cannot let the standard handler do its job, but must handle manually - - if ( cEvent.GetKind() == kEventMouseDown ) - { - if ( currentMouseWindow->MacIsReallyEnabled() ) - { - EventModifiers modifiers = cEvent.GetParameter(kEventParamKeyModifiers, typeUInt32) ; - Point clickLocation = windowMouseLocation ; - - currentMouseWindow->MacRootWindowToWindow( &clickLocation.h , &clickLocation.v ) ; - - HandleControlClick( (ControlRef) currentMouseWindow->GetHandle() , clickLocation , - modifiers , (ControlActionUPP ) -1 ) ; - - if ((currentMouseWindowParent != NULL) && - (currentMouseWindowParent->GetChildren().Find(currentMouseWindow) == NULL)) - { - currentMouseWindow = NULL; - } - } - - result = noErr ; - } } if ( cEvent.GetKind() == kEventMouseUp && wxApp::s_captureWindow ) @@ -961,7 +883,7 @@ bool wxTopLevelWindowMac::Create(wxWindow *parent, DoMacCreateRealWindow( parent, title, pos , size , style , name ) ; - SetBackgroundColour(wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive))); + SetBackgroundColour(wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE )); if (GetExtraStyle() & wxFRAME_EX_METAL) MacSetMetalAppearance(true); @@ -1068,11 +990,16 @@ bool wxTopLevelWindowMac::SetBackgroundColour(const wxColour& col ) if ( !wxTopLevelWindowBase::SetBackgroundColour(col) && m_hasBgCol ) return false ; - if ( col == wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ) + if ( col == wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) || col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDocumentWindowBackground)) ) + { SetThemeWindowBackground( (WindowRef) m_macWindow, kThemeBrushDocumentWindowBackground, false ) ; - else if ( col == wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) ) + SetBackgroundStyle(wxBG_STYLE_CUSTOM); + } + else if ( col == wxSystemSettings::GetColour( wxSYS_COLOUR_3DFACE ) || col == wxColour(wxMacCreateCGColorFromHITheme(kThemeBrushDialogBackgroundActive)) ) + { SetThemeWindowBackground( (WindowRef) m_macWindow, kThemeBrushDialogBackgroundActive, false ) ; - // TODO BETTER THEME SUPPORT + SetBackgroundStyle(wxBG_STYLE_CUSTOM); + } return true; }