X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/328f0df87c7c315602ed0a8b39ace1ff8f88eb89..f7d2128f3c89b2d00fbac0d8c9798409ae23b408:/src/mac/carbon/window.cpp?ds=sidebyside diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index c283e6472f..aa9503fb3b 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -211,7 +211,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl if ( thisWindow->MacIsUserPane() ) { static float color = 0.5 ; - static channel = 0 ; + static int channel = 0 ; HIRect bounds; CGContextRef cgContext = cEvent.GetParameter(kEventParamCGContextRef) ; @@ -2060,8 +2060,12 @@ void wxWindowMac::GetTextExtent(const wxString& string, int *x, int *y, int *descent, int *externalLeading, const wxFont *theFont ) const { const wxFont *fontToUse = theFont; + wxFont tempFont; if ( !fontToUse ) - fontToUse = &m_font; + { + tempFont = GetFont(); + fontToUse = &tempFont; + } wxClientDC dc( (wxWindowMac*) this ) ; wxCoord lx,ly,ld,le ; @@ -3171,11 +3175,15 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event ) void wxWindowMac::OnPaint( wxPaintEvent & WXUNUSED(event) ) { - if ( wxTheApp->MacGetCurrentEvent() != NULL && wxTheApp->MacGetCurrentEventHandlerCallRef() != NULL - && GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT ) - CallNextEventHandler( - (EventHandlerCallRef)wxTheApp->MacGetCurrentEventHandlerCallRef() , - (EventRef) wxTheApp->MacGetCurrentEvent() ) ; + // for native controls: call their native paint method + if ( !MacIsUserPane() || ( IsTopLevel() && GetBackgroundStyle() == wxBG_STYLE_SYSTEM ) ) + { + if ( wxTheApp->MacGetCurrentEvent() != NULL && wxTheApp->MacGetCurrentEventHandlerCallRef() != NULL + && GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT ) + CallNextEventHandler( + (EventHandlerCallRef)wxTheApp->MacGetCurrentEventHandlerCallRef() , + (EventRef) wxTheApp->MacGetCurrentEvent() ) ; + } } void wxWindowMac::MacHandleControlClick(WXWidget WXUNUSED(control),