diff options
author | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-11-11 16:17:44 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-11-12 08:41:22 +0100 |
commit | 941b5a0bb597285737b4796106974468ac357b17 (patch) | |
tree | 2cedd15bb7d3bfd0d2d5db1dba880e9faf30dc40 /toolkit | |
parent | d6d7beae483ec58e45c0f38fd66dc6c24e996275 (diff) |
Permit scrollable AWT tab pages a la scrolled Dialog
UNO dialogs since LibreOffice 4.0 permitted setting HScroll /
VScroll properties to enable scrolling for too large a content.
Conceptually clone this code over to TabPage as well, and register
necessary UNO properties in the toolkit UNO wrappers.
Add missing API documentation also to UnoControlDialogModel,
plus the new properties to the UnoControlTabPageModel
Layout code really doesn't like any extra controls it didn't create
itself - so create scrollbars only on demand.
Change-Id: I67894597ac104320e67ad7989ebf9a7955d99103
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105573
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxcontainer.cxx | 16 | ||||
-rw-r--r-- | toolkit/source/awt/vclxtoolkit.cxx | 3 | ||||
-rw-r--r-- | toolkit/source/controls/tabpagemodel.cxx | 6 |
3 files changed, 19 insertions, 6 deletions
diff --git a/toolkit/source/awt/vclxcontainer.cxx b/toolkit/source/awt/vclxcontainer.cxx index 541a9913440c..44f0844f6965 100644 --- a/toolkit/source/awt/vclxcontainer.cxx +++ b/toolkit/source/awt/vclxcontainer.cxx @@ -26,6 +26,7 @@ #include <vcl/svapp.hxx> #include <vcl/window.hxx> +#include <vcl/tabpage.hxx> #include <tools/debug.hxx> #include <helper/scrollabledialog.hxx> #include <toolkit/helper/property.hxx> @@ -251,7 +252,8 @@ void SAL_CALL VCLXContainer::setProperty( VclPtr<vcl::Window> pWindow = GetWindow(); MapMode aMode( MapUnit::MapAppFont ); toolkit::ScrollableDialog* pScrollable = dynamic_cast< toolkit::ScrollableDialog* >( pWindow.get() ); - if ( pWindow && pScrollable ) + TabPage* pScrollTabPage = dynamic_cast< TabPage* >( pWindow.get() ); + if ( pWindow && (pScrollable || pScrollTabPage) ) { OutputDevice* pDev = VCLUnoHelper::GetOutputDevice( getGraphics() ); if ( !pDev ) @@ -265,16 +267,20 @@ void SAL_CALL VCLXContainer::setProperty( switch ( nPropType ) { case BASEPROPERTY_SCROLLHEIGHT: - pScrollable->SetScrollHeight( aSize.Height() ); + pScrollable ? pScrollable->SetScrollHeight( aSize.Height() ) : (void)0; + pScrollTabPage ? pScrollTabPage->SetScrollHeight( aSize.Height() ) : (void)0; break; case BASEPROPERTY_SCROLLWIDTH: - pScrollable->SetScrollWidth( aSize.Width() ); + pScrollable ? pScrollable->SetScrollWidth( aSize.Width() ) : (void)0; + pScrollTabPage ? pScrollTabPage->SetScrollWidth( aSize.Width() ) : (void)0; break; case BASEPROPERTY_SCROLLTOP: - pScrollable->SetScrollTop( aSize.Height() ); + pScrollable ? pScrollable->SetScrollTop( aSize.Height() ) : (void)0; + pScrollTabPage ? pScrollTabPage->SetScrollTop( aSize.Height() ) : (void)0; break; case BASEPROPERTY_SCROLLLEFT: - pScrollable->SetScrollLeft( aSize.Width() ); + pScrollable ? pScrollable->SetScrollLeft( aSize.Width() ) : (void)0; + pScrollTabPage ? pScrollTabPage->SetScrollLeft( aSize.Width() ) : (void)0; break; default: break; diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index 12fb64bee90b..8d7cff46e7d8 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -664,7 +664,8 @@ std::pair<WinBits,MessBoxStyle> ImplGetWinBits( sal_uInt32 nComponentAttribs, Wi if( nComponentAttribs & css::awt::VclWindowPeerAttribute::DEF_NO ) nStyle |= MessBoxStyle::DefaultNo; } - if ( nCompType == WindowType::MULTILINEEDIT || nCompType == WindowType::DIALOG || nCompType == WindowType::GROUPBOX ) + if ( nCompType == WindowType::MULTILINEEDIT || nCompType == WindowType::DIALOG + || nCompType == WindowType::GROUPBOX || nCompType == WindowType::TABPAGE ) { if( nComponentAttribs & css::awt::VclWindowPeerAttribute::AUTOHSCROLL ) nWinBits |= WB_AUTOHSCROLL; diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index 8a0856f2d08a..30f45d9258bd 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -46,6 +46,12 @@ UnoControlTabPageModel::UnoControlTabPageModel( Reference< XComponentContext > c ImplRegisterProperty( BASEPROPERTY_HELPTEXT ); ImplRegisterProperty( BASEPROPERTY_HELPURL ); ImplRegisterProperty( BASEPROPERTY_USERFORMCONTAINEES ); + ImplRegisterProperty( BASEPROPERTY_HSCROLL ); + ImplRegisterProperty( BASEPROPERTY_VSCROLL ); + ImplRegisterProperty( BASEPROPERTY_SCROLLWIDTH ); + ImplRegisterProperty( BASEPROPERTY_SCROLLHEIGHT ); + ImplRegisterProperty( BASEPROPERTY_SCROLLTOP ); + ImplRegisterProperty( BASEPROPERTY_SCROLLLEFT ); } OUString SAL_CALL UnoControlTabPageModel::getImplementationName() |