diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-23 11:16:23 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-23 13:29:37 +0000 |
commit | b755c56c50cffb1e61c448dd34d54475e4993390 (patch) | |
tree | ae7bf9f44332ab1f0e761979160bcba07e8cf90c /vcl | |
parent | d27818c1f34b01190bf419c34d6a174f3cad7894 (diff) |
TODO: move to ScrollBar when binary incompatibility is no longer problematic
since...
commit 72ebade6ba9e88a5a24db57266a53e8f52049214
Author: Ivo Hinkelmann <ihi@openoffice.org>
Date: Thu Sep 13 15:33:31 2007 +0000
INTEGRATION: CWS aquavclcarbonfixes (1.20.70); FILE MERGED
2007/08/29 12:59:47 hdu 1.20.70.1: #i77549# extend native scrollbar NWF by adding PART_TRACK_*_AREA controls
Change-Id: I124c4014556f3a10b986a2886202210ebfc9eb10
Reviewed-on: https://gerrit.libreoffice.org/35586
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/control/scrbar.cxx | 58 |
1 files changed, 24 insertions, 34 deletions
diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 33ede81f7725..85207710d4b6 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -68,7 +68,6 @@ struct ImplScrollBarData { AutoTimer maTimer; // Timer bool mbHide; - Rectangle maTrackRect; // TODO: move to ScrollBar class when binary incompatibility of ScrollBar class is no longer problematic }; void ScrollBar::ImplInit( vcl::Window* pParent, WinBits nStyle ) @@ -90,14 +89,6 @@ void ScrollBar::ImplInit( vcl::Window* pParent, WinBits nStyle ) mbCalcSize = true; mbFullDrag = false; - if( !mpData ) // TODO: remove when maTrackRect is no longer in mpData - { - mpData = new ImplScrollBarData; - mpData->maTimer.SetInvokeHandler( LINK( this, ScrollBar, ImplAutoTimerHdl ) ); - mpData->maTimer.SetDebugName( "vcl::ScrollBar mpData->maTimer" ); - mpData->mbHide = false; - } - ImplInitStyle( nStyle ); Control::ImplInit( pParent, nStyle, nullptr ); @@ -135,12 +126,11 @@ void ScrollBar::ImplUpdateRects( bool bUpdate ) mnStateFlags &= ~SCRBAR_STATE_BTN1_DISABLE; mnStateFlags &= ~SCRBAR_STATE_BTN2_DISABLE; - Rectangle& aTrackRect = mpData->maTrackRect; // TODO: remove when maTrackRect is no longer in mpData if ( mnThumbPixRange ) { if ( GetStyle() & WB_HORZ ) { - maThumbRect.Left() = aTrackRect.Left()+mnThumbPixPos; + maThumbRect.Left() = maTrackRect.Left()+mnThumbPixPos; maThumbRect.Right() = maThumbRect.Left()+mnThumbPixSize-1; if ( !mnThumbPixPos ) maPage1Rect.Right() = RECT_EMPTY; @@ -151,12 +141,12 @@ void ScrollBar::ImplUpdateRects( bool bUpdate ) else { maPage2Rect.Left() = maThumbRect.Right()+1; - maPage2Rect.Right() = aTrackRect.Right(); + maPage2Rect.Right() = maTrackRect.Right(); } } else { - maThumbRect.Top() = aTrackRect.Top()+mnThumbPixPos; + maThumbRect.Top() = maTrackRect.Top()+mnThumbPixPos; maThumbRect.Bottom() = maThumbRect.Top()+mnThumbPixSize-1; if ( !mnThumbPixPos ) maPage1Rect.Bottom() = RECT_EMPTY; @@ -167,7 +157,7 @@ void ScrollBar::ImplUpdateRects( bool bUpdate ) else { maPage2Rect.Top() = maThumbRect.Bottom()+1; - maPage2Rect.Bottom() = aTrackRect.Bottom(); + maPage2Rect.Bottom() = maTrackRect.Bottom(); } } } @@ -175,24 +165,24 @@ void ScrollBar::ImplUpdateRects( bool bUpdate ) { if ( GetStyle() & WB_HORZ ) { - const long nSpace = aTrackRect.Right() - aTrackRect.Left(); + const long nSpace = maTrackRect.Right() - maTrackRect.Left(); if ( nSpace > 0 ) { - maPage1Rect.Left() = aTrackRect.Left(); - maPage1Rect.Right() = aTrackRect.Left() + (nSpace/2); + maPage1Rect.Left() = maTrackRect.Left(); + maPage1Rect.Right() = maTrackRect.Left() + (nSpace/2); maPage2Rect.Left() = maPage1Rect.Right() + 1; - maPage2Rect.Right() = aTrackRect.Right(); + maPage2Rect.Right() = maTrackRect.Right(); } } else { - const long nSpace = aTrackRect.Bottom() - aTrackRect.Top(); + const long nSpace = maTrackRect.Bottom() - maTrackRect.Top(); if ( nSpace > 0 ) { - maPage1Rect.Top() = aTrackRect.Top(); - maPage1Rect.Bottom() = aTrackRect.Top() + (nSpace/2); + maPage1Rect.Top() = maTrackRect.Top(); + maPage1Rect.Bottom() = maTrackRect.Top() + (nSpace/2); maPage2Rect.Top() = maPage1Rect.Bottom() + 1; - maPage2Rect.Bottom() = aTrackRect.Bottom(); + maPage2Rect.Bottom() = maTrackRect.Bottom(); } } } @@ -247,7 +237,6 @@ void ScrollBar::ImplCalc( bool bUpdate ) const Size aSize = GetOutputSizePixel(); const long nMinThumbSize = GetSettings().GetStyleSettings().GetMinThumbSize(); - Rectangle& aTrackRect = mpData->maTrackRect; // TODO: remove when maTrackRect is no longer in mpData if ( mbCalcSize ) { Size aOldSize = getCurrentCalcSize(); @@ -276,18 +265,18 @@ void ScrollBar::ImplCalc( bool bUpdate ) if ( GetNativeControlRegion( ControlType::Scrollbar, ControlPart::TrackHorzArea, aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) ) - aTrackRect = aTrackRegion; + maTrackRect = aTrackRegion; else - aTrackRect = Rectangle( maBtn1Rect.TopRight(), maBtn2Rect.BottomLeft() ); + maTrackRect = Rectangle( maBtn1Rect.TopRight(), maBtn2Rect.BottomLeft() ); // Check if available space is big enough for thumb ( min thumb size = ScrBar width/height ) - mnThumbPixRange = aTrackRect.Right() - aTrackRect.Left(); + mnThumbPixRange = maTrackRect.Right() - maTrackRect.Left(); if( mnThumbPixRange > 0 ) { - maPage1Rect.Left() = aTrackRect.Left(); + maPage1Rect.Left() = maTrackRect.Left(); maPage1Rect.Bottom() = maPage2Rect.Bottom() = - maThumbRect.Bottom() = aTrackRect.Bottom(); + maThumbRect.Bottom() = maTrackRect.Bottom(); } else { @@ -317,18 +306,18 @@ void ScrollBar::ImplCalc( bool bUpdate ) if ( GetNativeControlRegion( ControlType::Scrollbar, ControlPart::TrackVertArea, aControlRegion, ControlState::NONE, ImplControlValue(), OUString(), aBoundingRegion, aTrackRegion ) ) - aTrackRect = aTrackRegion; + maTrackRect = aTrackRegion; else - aTrackRect = Rectangle( maBtn1Rect.BottomLeft()+Point(0,1), maBtn2Rect.TopRight() ); + maTrackRect = Rectangle( maBtn1Rect.BottomLeft()+Point(0,1), maBtn2Rect.TopRight() ); // Check if available space is big enough for thumb - mnThumbPixRange = aTrackRect.Bottom() - aTrackRect.Top(); + mnThumbPixRange = maTrackRect.Bottom() - maTrackRect.Top(); if( mnThumbPixRange > 0 ) { - maPage1Rect.Top() = aTrackRect.Top(); + maPage1Rect.Top() = maTrackRect.Top(); maPage1Rect.Right() = maPage2Rect.Right() = - maThumbRect.Right() = aTrackRect.Right(); + maThumbRect.Right() = maTrackRect.Right(); } else { @@ -422,7 +411,7 @@ void ScrollBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& /* rSiz maBtn1Rect+=aPos; maBtn2Rect+=aPos; maThumbRect+=aPos; - mpData->maTrackRect+=aPos; // TODO: update when maTrackRect is no longer in mpData + maTrackRect+=aPos; maPage1Rect+=aPos; maPage2Rect+=aPos; @@ -1157,6 +1146,7 @@ void ScrollBar::GetFocus() { mpData = new ImplScrollBarData; mpData->maTimer.SetInvokeHandler( LINK( this, ScrollBar, ImplAutoTimerHdl ) ); + mpData->maTimer.SetDebugName( "vcl::ScrollBar mpData->maTimer" ); mpData->mbHide = false; } ImplInvert(); // react immediately |