overseeing the obvious, there is already a perfect scroll call for HIView...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27409 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -2274,8 +2274,18 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
|
|||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
int width , height ;
|
int width , height ;
|
||||||
GetClientSize( &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;
|
wxPoint pos;
|
||||||
pos.x = pos.y = 0;
|
pos.x = pos.y = 0;
|
||||||
@@ -2283,20 +2293,11 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
|
|||||||
Rect scrollrect;
|
Rect scrollrect;
|
||||||
RgnHandle updateRgn = NewRgn() ;
|
RgnHandle updateRgn = NewRgn() ;
|
||||||
|
|
||||||
#if TARGET_API_MAC_OSX
|
|
||||||
// if there is already a pending redraw event, we first must flush that, as we don't have
|
|
||||||
// means to retrieve the dirty region of a HIView
|
|
||||||
if ( HIViewGetNeedsDisplay( (ControlRef) m_macControl ) )
|
|
||||||
Update() ;
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
wxClientDC dc(this) ;
|
wxClientDC dc(this) ;
|
||||||
wxMacPortSetter helper(&dc) ;
|
wxMacPortSetter helper(&dc) ;
|
||||||
|
|
||||||
GetControlBounds( (ControlRef) m_macControl, &scrollrect);
|
GetControlBounds( (ControlRef) m_macControl, &scrollrect);
|
||||||
#if TARGET_API_MAC_OSX
|
|
||||||
GetParent()->MacWindowToRootWindow( &scrollrect.left , &scrollrect.top ) ;
|
|
||||||
#endif
|
|
||||||
scrollrect.top += MacGetTopBorderSize() ;
|
scrollrect.top += MacGetTopBorderSize() ;
|
||||||
scrollrect.left += MacGetLeftBorderSize() ;
|
scrollrect.left += MacGetLeftBorderSize() ;
|
||||||
scrollrect.bottom = scrollrect.top + height ;
|
scrollrect.bottom = scrollrect.top + height ;
|
||||||
@@ -2311,11 +2312,6 @@ void wxWindowMac::ScrollWindow(int dx, int dy, const wxRect *rect)
|
|||||||
ScrollRect( &scrollrect , dx , dy , updateRgn ) ;
|
ScrollRect( &scrollrect , dx , dy , updateRgn ) ;
|
||||||
}
|
}
|
||||||
// ScrollWindowRect( (WindowRef) MacGetTopLevelWindowRef() , &scrollrect , dx , dy , kScrollWindowInvalidate, updateRgn ) ;
|
// ScrollWindowRect( (WindowRef) MacGetTopLevelWindowRef() , &scrollrect , dx , dy , kScrollWindowInvalidate, updateRgn ) ;
|
||||||
#if TARGET_API_MAC_OSX
|
|
||||||
HIViewConvertRegion( updateRgn , (ControlRef) MacGetTopLevelWindow()->GetHandle() , (ControlRef) m_macControl ) ;
|
|
||||||
HIViewSetNeedsDisplayInRegion( (ControlRef) m_macControl , updateRgn , true ) ;
|
|
||||||
#else
|
|
||||||
// TODO TEST
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user