summaryrefslogtreecommitdiff
path: root/toolkit/source/awt/scrollabledialog.cxx
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2012-09-05 20:19:03 +0100
committerNoel Power <noel.power@suse.com>2012-09-11 16:04:11 +0100
commit7f5ca4c9e1061a626039d1042e71c34fc3f61005 (patch)
tree4e8d4ccfc90899ca17f37e89400d93ac719d574c /toolkit/source/awt/scrollabledialog.cxx
parentbe045f69d1746a287c48389785a0eaa91785d452 (diff)
fix scroll top & scroll left
Change-Id: If333932a0f3cfde6e8459ca3506a609207982f96
Diffstat (limited to 'toolkit/source/awt/scrollabledialog.cxx')
-rw-r--r--toolkit/source/awt/scrollabledialog.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/toolkit/source/awt/scrollabledialog.cxx b/toolkit/source/awt/scrollabledialog.cxx
index 2ffc793287c4..202a561cfaf1 100644
--- a/toolkit/source/awt/scrollabledialog.cxx
+++ b/toolkit/source/awt/scrollabledialog.cxx
@@ -56,12 +56,11 @@ void ScrollableDialog::lcl_Scroll( long nX, long nY )
{
long nXScroll = mnScrollPos.X() - nX;
long nYScroll = mnScrollPos.Y() - nY;
- printf( "ScrollableDialog::lcl_Scroll %d, %d nXScroll %d, nYScroll %d\n", nX, nY, nXScroll, nYScroll );
+ printf( "ScrollableDialog::lcl_Scroll %d, %d resulting in delta nXScroll %d, nYScroll %d for ( %d ) children\n", nX, nY, nXScroll, nYScroll, GetChildCount() -2 );
mnScrollPos = Point( nX, nY );
Rectangle aScrollableArea( 0, 0, maScrollArea.Width(), maScrollArea.Height() );
Window::Scroll(nXScroll, nYScroll, aScrollableArea );
-
// Manually scroll all children ( except the scrollbars )
for ( int index = 0; index < GetChildCount(); ++index )
{
@@ -89,18 +88,20 @@ void ScrollableDialog::SetScrollTop( long nTop )
{
printf("ScrollableDialog::SetScrollTop(%d)\n", nTop );
Point aOld = mnScrollPos;
- lcl_Scroll( mnScrollPos.X() , nTop );
+ lcl_Scroll( mnScrollPos.X() , mnScrollPos.Y() - nTop );
printf("about to set thumb\n");
maHScrollBar.SetThumbPos( 0 );
+ // new pos is 0,0
mnScrollPos = aOld;
}
void ScrollableDialog::SetScrollLeft( long nLeft )
{
printf("ScrollableDialog::SetScrollLeft(%d)\n", nLeft );
Point aOld = mnScrollPos;
- lcl_Scroll( nLeft , mnScrollPos.Y() );
+ lcl_Scroll( mnScrollPos.X() - nLeft , mnScrollPos.Y() );
printf("about to set thumb\n");
maVScrollBar.SetThumbPos( 0 );
+ // new pos is 0,0
mnScrollPos = aOld;
}
void ScrollableDialog::SetScrollWidth( long nWidth )