Kaydet (Commit) 7f5ca4c9 authored tarafından Noel Power's avatar Noel Power

fix scroll top & scroll left

Change-Id: If333932a0f3cfde6e8459ca3506a609207982f96
üst be045f69
......@@ -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 )
......
......@@ -358,6 +358,15 @@ void UnoDialogControl::createPeer( const Reference< XToolkit > & rxToolkit, cons
if ( maTopWindowListeners.getLength() )
xTW->addTopWindowListener( &maTopWindowListeners );
// there must be a better way than doing this, we can't
// process the scrolltop & scrollleft in XDialog because
// the children haven't been added when those props are applied
Reference< XPropertySet > xDlgProps( getModel(), UNO_QUERY );
Reference< XPropertySet > xPeerProps( getPeer(), uno::UNO_QUERY );
ImplSetPeerProperty( GetPropertyName( BASEPROPERTY_SCROLLTOP ), ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_SCROLLTOP ) ) );
ImplSetPeerProperty( GetPropertyName( BASEPROPERTY_SCROLLLEFT ), ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_SCROLLLEFT ) ) );
}
}
......@@ -1089,6 +1098,7 @@ void UnoFrameControl::ImplSetPosSize( Reference< XControl >& rxCtrl )
SimpleFontMetric aFM;
FontDescriptor aFD;
Any aVal = ImplGetPropertyValue( GetPropertyName( BASEPROPERTY_FONTDESCRIPTOR ) );
aVal >>= aFD;
if ( !aFD.StyleName.isEmpty() )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment