X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ef53a8e81460709c871aec9d1693c2f4770592d8..0c1cc9483ecba053bc9a0983a4a8d48898e334f2:/src/mac/carbon/window.cpp?ds=sidebyside diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 220960871a..acb4a6b6cb 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -232,17 +232,21 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl bool created = false ; CGContextRef cgContext = NULL ; OSStatus err = cEvent.GetParameter(kEventParamCGContextRef, &cgContext) ; - wxASSERT_MSG( err == noErr , wxT("Unable to retrieve CGContextRef") ) ; + if ( err != noErr ) + { + wxFAIL_MSG("Unable to retrieve CGContextRef"); + } + thisWindow->MacSetCGContextRef( cgContext ) ; { wxMacCGContextStateSaver sg( cgContext ) ; - float alpha = 1.0 ; + CGFloat alpha = (CGFloat)1.0 ; { wxWindow* iter = thisWindow ; while ( iter ) { - alpha *= (float) iter->GetTransparent()/255.0 ; + alpha *= (CGFloat)( iter->GetTransparent()/255.0 ) ; if ( iter->IsTopLevel() ) iter = NULL ; else @@ -885,9 +889,6 @@ void wxWindowMac::Init() m_macIsUserPane = true; m_clipChildren = false ; m_cachedClippedRectValid = false ; - - // we need a valid font for the encodings - wxWindowBase::SetFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT)); } wxWindowMac::~wxWindowMac() @@ -2118,6 +2119,12 @@ void wxWindowMac::OnEraseBackground(wxEraseEvent& event) { event.GetDC()->Clear() ; } + else if ( GetBackgroundStyle() == wxBG_STYLE_CUSTOM ) + { + // don't skip the event here, custom background means that the app + // is drawing it itself in its OnPaint(), so don't draw it at all + // now to avoid flicker + } else { event.Skip() ; @@ -2244,7 +2251,7 @@ void wxWindowMac::MacPaintGrowBox() } else { - CGContextSetRGBFillColor( cgContext, 1.0, 1.0 , 1.0 , 1.0 ); + CGContextSetRGBFillColor( cgContext, (CGFloat) 1.0, (CGFloat)1.0 ,(CGFloat) 1.0 , (CGFloat)1.0 ); } CGContextFillRect( cgContext, cgrect ); CGContextRestoreGState( cgContext ); @@ -3210,10 +3217,16 @@ bool wxWindowMac::IsShownOnScreen() const bool wxVis = wxWindowBase::IsShownOnScreen(); if( peerVis != wxVis ) { + // CS : put a breakpoint here to investigate differences + // between native an wx visibilities + // the only place where I've encountered them until now + // are the hiding/showing sequences where the vis-changed event is + // first sent to the innermost control, while wx does things + // from the outmost control wxVis = wxWindowBase::IsShownOnScreen(); return wxVis; } - + return m_peer->IsVisible(); } #endif