diff options
Diffstat (limited to 'toolkit/source/awt')
-rw-r--r-- | toolkit/source/awt/scrollabledialog.cxx | 46 | ||||
-rw-r--r-- | toolkit/source/awt/vclxwindows.cxx | 40 |
2 files changed, 50 insertions, 36 deletions
diff --git a/toolkit/source/awt/scrollabledialog.cxx b/toolkit/source/awt/scrollabledialog.cxx index 53388bf0b2e9..dc3d3ab2dba2 100644 --- a/toolkit/source/awt/scrollabledialog.cxx +++ b/toolkit/source/awt/scrollabledialog.cxx @@ -82,52 +82,26 @@ IMPL_LINK( ScrollableDialog, ScrollBarHdl, ScrollBar*, pSB ) lcl_Scroll(mnScrollPos.X(), nPos ); else if( pSB == &maHScrollBar ) lcl_Scroll(nPos, mnScrollPos.Y() ); -#if 0 - sal_uInt16 nPos = (sal_uInt16) pSB->GetThumbPos(); - Rectangle aScrollableArea( 0, 0, maScrollArea.Width(), maScrollArea.Height() ); - Point aScroll; - if( pSB == &maVScrollBar ) - { - printf("vertical scroll %d\n", nPos ); - Size aTmpScroll( nPos, nPos ); - long nScroll = mnScrollPos.Y() - aTmpScroll.Width(); - // I'm guessing I need to call scroll for ( stuff ) to happen - Scroll(0, nScroll, aScrollableArea ); - mnScrollPos.Y() = nPos; - aScroll.Y() = nScroll; - } - else if( pSB == &maHScrollBar ) - { - printf("horizontal scroll %d\n", nPos ); - Size aTmpScroll( nPos, nPos ); - long nScroll = mnScrollPos.X() - aTmpScroll.Width(); - Scroll( nScroll, 0, aScrollableArea); - mnScrollPos.X() = nPos; - aScroll.X() = nScroll; - } - - // Manually scroll all children ( except the scrollbars ) - for ( int index = 0; index < GetChildCount(); ++index ) - { - Window* pChild = GetChild( index ); - if ( pChild && pChild != &maVScrollBar && pChild != &maHScrollBar ) - { - Point aPos = pChild->GetPosPixel(); - aPos += Point( aScroll.X(), aScroll.Y() ); - pChild->SetPosPixel( aPos ); - } - } -#endif return 1; } +void ScrollableDialog::SetScrollTop( long nTop ) +{ + printf("ScrollableDialog::SetScrollTop(%d)\n", nTop ); +} +void ScrollableDialog::SetScrollLeft( long nLeft ) +{ + printf("ScrollableDialog::SetScrollLeft(%d)\n", nLeft ); +} void ScrollableDialog::SetScrollWidth( long nWidth ) { + printf("ScrollableDialog::SetScrollWidth(%d)\n", nWidth ); maScrollArea.Width() = nWidth; } void ScrollableDialog::SetScrollHeight( long nHeight ) { + printf("ScrollableDialog::SetScrollHeight(%d)\n", nHeight ); maScrollArea.Height() = nHeight; } diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx index d5a313dc5117..a70d5acd7337 100644 --- a/toolkit/source/awt/vclxwindows.cxx +++ b/toolkit/source/awt/vclxwindows.cxx @@ -27,6 +27,7 @@ ************************************************************************/ #include <toolkit/awt/vclxwindows.hxx> +#include "toolkit/awt/scrollabledialog.hxx" #include <com/sun/star/awt/ScrollBarOrientation.hpp> #include <com/sun/star/graphic/GraphicProvider.hpp> #include <com/sun/star/graphic/XGraphicProvider.hpp> @@ -2450,8 +2451,47 @@ throw(::com::sun::star::uno::RuntimeException) sal_Bool bVoid = Value.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_VOID; sal_uInt16 nPropType = GetPropertyId( PropertyName ); + printf("XDialog setProperty... %s\n", rtl::OUStringToOString( PropertyName, RTL_TEXTENCODING_UTF8 ).getStr() ); switch ( nPropType ) { + case BASEPROPERTY_SCROLLHEIGHT: + case BASEPROPERTY_SCROLLWIDTH: + case BASEPROPERTY_SCROLLTOP: + case BASEPROPERTY_SCROLLLEFT: + { + sal_Int32 nVal =0; + Value >>= nVal; + Size aSize( nVal, nVal ); + Window* pWindow = GetWindow(); + MapMode aMode( MAP_APPFONT ); + if ( pWindow ) + { + OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() ); + if ( !pDev ) + pDev = pWindow->GetParent(); + + aSize = pDev->LogicToPixel( aSize, aMode ); + toolkit::ScrollableDialog* pScrollable = static_cast< toolkit::ScrollableDialog* >( pWindow ); + switch ( nPropType ) + { + case BASEPROPERTY_SCROLLHEIGHT: + pScrollable->SetScrollHeight( aSize.Height() ); + break; + case BASEPROPERTY_SCROLLWIDTH: + pScrollable->SetScrollWidth( aSize.Width() ); + break; + case BASEPROPERTY_SCROLLTOP: + pScrollable->SetScrollTop( aSize.Height() ); + break; + case BASEPROPERTY_SCROLLLEFT: + pScrollable->SetScrollLeft( aSize.Width() ); + break; + default: + break; + } + } + break; + } case BASEPROPERTY_GRAPHIC: { Reference< XGraphic > xGraphic; |