X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/430e1eed73d7f733e336421374fec0b542c25272..be5a51fb592f3fa2ba38ac6cd1e488d6d806058c:/src/mac/carbon/window.cpp diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index d135688cb8..7669c42d60 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -2274,8 +2274,18 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) { + int width , height ; GetClientSize( &width , &height ) ; +#if TARGET_API_MAC_OSX + HIRect scrollrect = CGRectMake( MacGetLeftBorderSize() , MacGetTopBorderSize() , width , height ) ; + if ( rect ) + { + HIRect scrollarea = CGRectMake( rect->x , rect->y , rect->width , rect->height) ; + scrollrect = CGRectIntersection( scrollrect , scrollarea ) ; + } + HIViewScrollRect ( (ControlRef) m_macControl , &scrollrect , dx ,dy ) ; +#else wxPoint pos; pos.x = pos.y = 0; @@ -2283,14 +2293,11 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) Rect scrollrect; RgnHandle updateRgn = NewRgn() ; - { + { wxClientDC dc(this) ; wxMacPortSetter helper(&dc) ; GetControlBounds( (ControlRef) m_macControl, &scrollrect); -#if TARGET_API_MAC_OSX - GetParent()->MacWindowToRootWindow( &scrollrect.left , &scrollrect.top ) ; -#endif scrollrect.top += MacGetTopBorderSize() ; scrollrect.left += MacGetLeftBorderSize() ; scrollrect.bottom = scrollrect.top + height ; @@ -2305,14 +2312,6 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect) ScrollRect( &scrollrect , dx , dy , updateRgn ) ; } // ScrollWindowRect( (WindowRef) MacGetTopLevelWindowRef() , &scrollrect , dx , dy , kScrollWindowInvalidate, updateRgn ) ; -#if TARGET_API_MAC_OSX - Rect before,after ; - GetRegionBounds( updateRgn , &before ) ; - HIViewConvertRegion( updateRgn , (ControlRef) MacGetTopLevelWindow()->GetHandle() , (ControlRef) m_macControl ) ; - GetRegionBounds( updateRgn , &after ) ; - HIViewSetNeedsDisplayInRegion( (ControlRef) m_macControl , updateRgn , true ) ; -#else - // TODO TEST #endif } @@ -2478,7 +2477,6 @@ wxString wxWindowMac::MacGetToolTipString( wxPoint &pt ) void wxWindowMac::Update() { #if TARGET_API_MAC_OSX - HIViewSetNeedsDisplay( (ControlRef) m_macControl , true ) ; WindowRef window = (WindowRef)MacGetTopLevelWindowRef() ; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 // for composited windows this also triggers a redraw of all @@ -2507,6 +2505,8 @@ void wxWindowMac::Update() OSStatus status = noErr ; status = ReceiveNextEvent( 0 , NULL , kEventDurationNoWait , false , &theEvent ) ; } + else + HIViewSetNeedsDisplay( (ControlRef) m_macControl , true ) ; } #else ::Draw1Control( (ControlRef) m_macControl ) ;