diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-15 12:55:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-19 06:04:33 +0000 |
commit | f9fd6390cd88b87ca81538385da028ff5b1783c0 (patch) | |
tree | 02adaf2d5e1913fec12df2326115c125cad8dda1 /include | |
parent | 2a79ec7fe5abab9c3ba5f4f07a016dbc4287c1b8 (diff) |
ScrollableWrapper -> ScrollableDialog
no point in having a template and a virtual base class when it's only
used for one type
Change-Id: Idb1a1a551064cc10896eff33652038eb5be0297e
Reviewed-on: https://gerrit.libreoffice.org/32041
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/toolkit/awt/scrollabledialog.hxx | 39 |
1 files changed, 15 insertions, 24 deletions
diff --git a/include/toolkit/awt/scrollabledialog.hxx b/include/toolkit/awt/scrollabledialog.hxx index c414c8f3966e..83c0123717c9 100644 --- a/include/toolkit/awt/scrollabledialog.hxx +++ b/include/toolkit/awt/scrollabledialog.hxx @@ -26,19 +26,12 @@ namespace toolkit { - class ScrollableInterface + class ScrollableDialog : public Dialog { public: - virtual ~ScrollableInterface() {} - virtual void SetScrollWidth( long nWidth ) = 0; - virtual void SetScrollHeight( long nHeight ) = 0; - virtual void SetScrollLeft( long nLeft ) = 0; - virtual void SetScrollTop( long Top ) = 0; - }; + enum ScrollBarVisibility { None, Vert, Hori, Both }; - template < class T > - class ScrollableWrapper : public T, public ScrollableInterface - { + private: VclPtr<ScrollBar> maHScrollBar; VclPtr<ScrollBar> maVScrollBar; Size maScrollArea; @@ -46,26 +39,24 @@ namespace toolkit bool mbHasVertBar; Point mnScrollPos; long mnScrWidth; - - public: - enum ScrollBarVisibility { None, Vert, Hori, Both }; - private: ScrollBarVisibility maScrollVis; + void lcl_Scroll( long nX, long nY ); + DECL_LINK( ScrollBarHdl, ScrollBar*, void ); + public: - ScrollableWrapper( vcl::Window* pParent, WinBits nStyle = WB_STDDIALOG, Dialog::InitFlag eFlag = Dialog::InitFlag::Default ); - virtual ~ScrollableWrapper() override; + ScrollableDialog( vcl::Window* pParent, WinBits nStyle = WB_STDDIALOG, Dialog::InitFlag eFlag = Dialog::InitFlag::Default ); + virtual ~ScrollableDialog() override; virtual void dispose() override; - virtual void SetScrollWidth( long nWidth ) override; - virtual void SetScrollHeight( long nHeight ) override; - virtual void SetScrollLeft( long nLeft ) override; - virtual void SetScrollTop( long Top ) override; - - void setScrollVisibility( ScrollBarVisibility rState ); - DECL_LINK( ScrollBarHdl, ScrollBar*, void ); - void ResetScrollBars(); // Window virtual void Resize() override; + + void SetScrollWidth( long nWidth ); + void SetScrollHeight( long nHeight ); + void SetScrollLeft( long nLeft ); + void SetScrollTop( long Top ); + void setScrollVisibility( ScrollBarVisibility rState ); + void ResetScrollBars(); }; } // namespacetoolkit |