summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-11 20:34:08 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-10-11 22:38:42 +0200
commit06e9c32d8be8192cd2b6c840aa639622ca0ff44e (patch)
tree3fcdc16182b1851efb55babd15c609e31a170bd8 /vcl
parent1020191c9772c869a9ac4d83264d35e54e8694c9 (diff)
Revert "Permit scrollable AWT tab pages a la scrolled Dialog"
UITest_sort failing https://gerrit.libreoffice.org/c/core/+/103942 Jenkins Verified-1 Patch Set 7: Verified-1 where UITest_sort failed Jenkins Verified+1 Patch Set 7: Verified+1 but that's just an android build which doesn't run any tests This reverts commit b3f2530aa2767ba43cd4702422fc3ed0d37821d6. Change-Id: I9414e5d7cc5873848f95dab65f03836ccb2ff0c6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104194 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/tabpage.cxx137
1 files changed, 0 insertions, 137 deletions
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index e980b762e1ca..827fbc35cd24 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -23,12 +23,9 @@
#include <vcl/tabpage.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/settings.hxx>
-#include <vcl/scrbar.hxx>
void TabPage::ImplInit( vcl::Window* pParent, WinBits nStyle )
{
- assert((nStyle & WB_VSCROLL) == 0 && (nStyle & WB_HSCROLL) == 0);
-
if ( !(nStyle & WB_NODIALOGCONTROL) )
nStyle |= WB_DIALOGCONTROL;
@@ -36,34 +33,6 @@ void TabPage::ImplInit( vcl::Window* pParent, WinBits nStyle )
ImplInitSettings();
- m_pVScroll.set(VclPtr<ScrollBar>::Create(this, ((nStyle & WB_VSCROLL) ? WB_HIDE : 0) | WB_VSCROLL | WB_DRAG));
- m_pHScroll.set(VclPtr<ScrollBar>::Create(this, ((nStyle & WB_HSCROLL) ? WB_HIDE : 0) | WB_HSCROLL | WB_DRAG));
- m_aScrollBarBox.set(
- VclPtr<ScrollBarBox>::Create(this,
- ((nStyle & (WB_VSCROLL|WB_HSCROLL)) ? WB_HIDE : 0)));
- mbHasHoriBar = false;
- mbHasVertBar = false;
- ScrollBarVisibility aVis = None;
-
- if ( nStyle & ( WB_AUTOHSCROLL | WB_AUTOVSCROLL ) )
- {
- if ( nStyle & WB_AUTOHSCROLL )
- aVis = Hori;
- if ( nStyle & WB_AUTOVSCROLL )
- {
- if ( aVis == Hori )
- aVis = Both;
- else
- aVis = Vert;
- }
- }
- setScrollVisibility( aVis );
- mnScrWidth = Application::GetSettings().GetStyleSettings().GetScrollBarSize();
-
- Link<ScrollBar*,void> aLink( LINK( this, TabPage, ScrollBarHdl ) );
- m_pVScroll->SetScrollHdl(aLink);
- m_pHScroll->SetScrollHdl(aLink);
-
// if the tabpage is drawn (ie filled) by a native widget, make sure all controls will have transparent background
// otherwise they will paint with a wrong background
if( IsNativeControlSupported(ControlType::TabBody, ControlPart::Entire) && GetParent() && (GetParent()->GetType() == WindowType::TABCONTROL) )
@@ -105,14 +74,6 @@ TabPage::~TabPage()
disposeOnce();
}
-void TabPage::dispose()
-{
- m_pVScroll.disposeAndClear();
- m_pHScroll.disposeAndClear();
- m_aScrollBarBox.disposeAndClear();
- vcl::Window::dispose();
-}
-
void TabPage::StateChanged( StateChangedType nType )
{
Window::StateChanged( nType );
@@ -221,102 +182,4 @@ void TabPage::SetPosPixel(const Point& rAllocPos)
}
}
-void TabPage::setScrollVisibility( ScrollBarVisibility rVisState )
-{
- maScrollVis = rVisState;
- if ( maScrollVis == Hori || maScrollVis == Both )
- {
- mbHasHoriBar = true;
- m_pHScroll->Show();
- }
- if ( maScrollVis == Vert || maScrollVis == Both )
- {
- mbHasVertBar = true;
- m_pVScroll->Show();
- }
- if ( mbHasHoriBar || mbHasVertBar )
- SetStyle( GetStyle() | WB_CLIPCHILDREN );
-}
-
-void TabPage::lcl_Scroll( long nX, long nY )
-{
- long nXScroll = mnScrollPos.X() - nX;
- long nYScroll = mnScrollPos.Y() - nY;
- mnScrollPos = Point( nX, nY );
-
- tools::Rectangle aScrollableArea( 0, 0, maScrollArea.Width(), maScrollArea.Height() );
- Scroll(nXScroll, nYScroll, aScrollableArea );
- // Manually scroll all children ( except the scrollbars )
- for ( int index = 0; index < GetChildCount(); ++index )
- {
- vcl::Window* pChild = GetChild( index );
- if ( pChild && pChild != m_pVScroll.get() && pChild != m_pHScroll.get() )
- {
- Point aPos = pChild->GetPosPixel();
- aPos += Point( nXScroll, nYScroll );
- pChild->SetPosPixel( aPos );
- }
- }
-}
-
-IMPL_LINK( TabPage, ScrollBarHdl, ScrollBar*, pSB, void )
-{
- sal_uInt16 nPos = static_cast<sal_uInt16>(pSB->GetThumbPos());
- if( pSB == m_pVScroll.get() )
- lcl_Scroll(mnScrollPos.X(), nPos );
- else if( pSB == m_pHScroll.get() )
- lcl_Scroll(nPos, mnScrollPos.Y() );
-}
-
-void TabPage::SetScrollTop( long nTop )
-{
- Point aOld = mnScrollPos;
- lcl_Scroll( mnScrollPos.X() , mnScrollPos.Y() - nTop );
- m_pHScroll->SetThumbPos( 0 );
- // new pos is 0,0
- mnScrollPos = aOld;
-}
-void TabPage::SetScrollLeft( long nLeft )
-{
- Point aOld = mnScrollPos;
- lcl_Scroll( mnScrollPos.X() - nLeft , mnScrollPos.Y() );
- m_pVScroll->SetThumbPos( 0 );
- // new pos is 0,0
- mnScrollPos = aOld;
-}
-
-void TabPage::SetScrollWidth( long nWidth )
-{
- maScrollArea.setWidth( nWidth );
- ResetScrollBars();
-}
-
-void TabPage::SetScrollHeight( long nHeight )
-{
- maScrollArea.setHeight( nHeight );
- ResetScrollBars();
-}
-
-void TabPage::Resize()
-{
- ResetScrollBars();
-}
-
-void TabPage::ResetScrollBars()
-{
- Size aOutSz = GetOutputSizePixel();
-
- Point aVPos( aOutSz.Width() - mnScrWidth, 0 );
- Point aHPos( 0, aOutSz.Height() - mnScrWidth );
-
- m_pVScroll->SetPosSizePixel( aVPos, Size( mnScrWidth, GetSizePixel().Height() - mnScrWidth ) );
- m_pHScroll->SetPosSizePixel( aHPos, Size( GetSizePixel().Width() - mnScrWidth, mnScrWidth ) );
-
- m_pHScroll->SetRangeMax( maScrollArea.Width() + mnScrWidth );
- m_pHScroll->SetVisibleSize( GetSizePixel().Width() );
-
- m_pVScroll->SetRangeMax( maScrollArea.Height() + mnScrWidth );
- m_pVScroll->SetVisibleSize( GetSizePixel().Height() );
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */