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 /include/vcl | |
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 'include/vcl')
-rw-r--r-- | include/vcl/tabpage.hxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/vcl/tabpage.hxx b/include/vcl/tabpage.hxx index bd308a96a355..1a66bab9eabd 100644 --- a/include/vcl/tabpage.hxx +++ b/include/vcl/tabpage.hxx @@ -24,6 +24,9 @@ #include <vcl/window.hxx> #include <vcl/IContext.hxx> +class ScrollBar; +class ScrollBarBox; + class VCL_DLLPUBLIC TabPage : public vcl::Window , public vcl::IContext @@ -32,10 +35,22 @@ private: using Window::ImplInit; SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle ); SAL_DLLPRIVATE void ImplInitSettings(); + void lcl_Scroll( tools::Long nX, tools::Long nY ); + DECL_LINK( ScrollBarHdl, ScrollBar*, void ); + + VclPtr<ScrollBar> m_pVScroll; + VclPtr<ScrollBar> m_pHScroll; + VclPtr<ScrollBarBox> m_aScrollBarBox; + Size maScrollArea; + bool mbHasHoriBar; + bool mbHasVertBar; + Point mnScrollPos; + tools::Long mnScrWidth; public: explicit TabPage( vcl::Window* pParent, WinBits nStyle = 0 ); virtual ~TabPage() override; + virtual void dispose() override; virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; virtual void Draw( OutputDevice* pDev, const Point& rPos, DrawFlags nFlags ) override; @@ -48,6 +63,15 @@ public: virtual void SetPosPixel(const Point& rNewPos) override; virtual void SetSizePixel(const Size& rNewSize) override; virtual Size GetOptimalSize() const override; + + // for scrollable tabpage + virtual void Resize() override; + + void SetScrollWidth( tools::Long nWidth ); + void SetScrollHeight( tools::Long nHeight ); + void SetScrollLeft( tools::Long nLeft ); + void SetScrollTop( tools::Long Top ); + void ResetScrollBars(); }; #endif // INCLUDED_VCL_TABPAGE_HXX |