diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-12-14 14:52:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-12-20 09:51:15 +0100 |
commit | 4e6be990eaf6a524740299e8d00fb5401c1a21c0 (patch) | |
tree | 2b3cf7708eef105d8e3cad039ff1e6109342c667 /vcl/source | |
parent | 009108aa53896ccd3a2bad4380654d22f7c2206f (diff) |
weld SwTOXEntryTabPage
Change-Id: Ib093fbb78a73b26060613ea72030e92f7d3681a5
Reviewed-on: https://gerrit.libreoffice.org/65325
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/salvtables.cxx | 114 | ||||
-rw-r--r-- | vcl/source/window/layout.cxx | 34 |
2 files changed, 106 insertions, 42 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index a75ff34a0ed0..c89455b0f511 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -973,9 +973,11 @@ class SalInstanceScrolledWindow : public SalInstanceContainer, public virtual we private: VclPtr<VclScrolledWindow> m_xScrolledWindow; Link<ScrollBar*,void> m_aOrigVScrollHdl; + Link<ScrollBar*,void> m_aOrigHScrollHdl; bool m_bUserManagedScrolling; DECL_LINK(VscrollHdl, ScrollBar*, void); + DECL_LINK(HscrollHdl, ScrollBar*, void); public: SalInstanceScrolledWindow(VclScrolledWindow* pScrolledWindow, bool bTakeOwnership) @@ -986,6 +988,80 @@ public: ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); m_aOrigVScrollHdl = rVertScrollBar.GetScrollHdl(); rVertScrollBar.SetScrollHdl(LINK(this, SalInstanceScrolledWindow, VscrollHdl)); + ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar(); + m_aOrigHScrollHdl = rHorzScrollBar.GetScrollHdl(); + rHorzScrollBar.SetScrollHdl(LINK(this, SalInstanceScrolledWindow, HscrollHdl)); + } + + virtual void hadjustment_configure(int value, int lower, int upper, + int step_increment, int page_increment, + int page_size) override + { + ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar(); + rHorzScrollBar.SetRangeMin(lower); + rHorzScrollBar.SetRangeMax(upper); + rHorzScrollBar.SetLineSize(step_increment); + rHorzScrollBar.SetPageSize(page_increment); + rHorzScrollBar.SetThumbPos(value); + rHorzScrollBar.SetVisibleSize(page_size); + } + + virtual int hadjustment_get_value() const override + { + ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar(); + return rHorzScrollBar.GetThumbPos(); + } + + virtual void hadjustment_set_value(int value) override + { + ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar(); + rHorzScrollBar.SetThumbPos(value); + if (!m_bUserManagedScrolling) + m_aOrigHScrollHdl.Call(&rHorzScrollBar); + } + + virtual int hadjustment_get_upper() const override + { + ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar(); + return rHorzScrollBar.GetRangeMax(); + } + + virtual void hadjustment_set_upper(int upper) override + { + ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar(); + rHorzScrollBar.SetRangeMax(upper); + } + + virtual int hadjustment_get_page_size() const override + { + ScrollBar& rHorzScrollBar = m_xScrolledWindow->getHorzScrollBar(); + return rHorzScrollBar.GetVisibleSize(); + } + + virtual void set_hpolicy(VclPolicyType eHPolicy) override + { + WinBits nWinBits = m_xScrolledWindow->GetStyle() & ~(WB_AUTOHSCROLL|WB_HSCROLL); + if (eHPolicy == VclPolicyType::ALWAYS) + nWinBits |= WB_HSCROLL; + else if (eHPolicy == VclPolicyType::AUTOMATIC) + nWinBits |= WB_AUTOHSCROLL; + m_xScrolledWindow->SetStyle(nWinBits); + m_xScrolledWindow->queue_resize(); + } + + virtual VclPolicyType get_hpolicy() const override + { + WinBits nWinBits = m_xScrolledWindow->GetStyle(); + if (nWinBits & WB_AUTOHSCROLL) + return VclPolicyType::AUTOMATIC; + else if (nWinBits & WB_HSCROLL) + return VclPolicyType::ALWAYS; + return VclPolicyType::NEVER; + } + + virtual int get_hscroll_height() const override + { + return m_xScrolledWindow->getHorzScrollBar().get_preferred_size().Height(); } virtual void vadjustment_configure(int value, int lower, int upper, @@ -1027,25 +1103,10 @@ public: rVertScrollBar.SetRangeMax(upper); } - virtual void set_hpolicy(VclPolicyType eHPolicy) override - { - WinBits nWinBits = m_xScrolledWindow->GetStyle() & ~(WB_AUTOHSCROLL|WB_HSCROLL); - if (eHPolicy == VclPolicyType::ALWAYS) - nWinBits |= WB_HSCROLL; - else if (eHPolicy == VclPolicyType::AUTOMATIC) - nWinBits |= WB_AUTOHSCROLL; - m_xScrolledWindow->SetStyle(nWinBits); - m_xScrolledWindow->queue_resize(); - } - - virtual VclPolicyType get_hpolicy() const override + virtual int vadjustment_get_page_size() const override { - WinBits nWinBits = m_xScrolledWindow->GetStyle(); - if (nWinBits & WB_AUTOHSCROLL) - return VclPolicyType::AUTOMATIC; - else if (nWinBits & WB_HSCROLL) - return VclPolicyType::ALWAYS; - return VclPolicyType::NEVER; + ScrollBar& rVertScrollBar = m_xScrolledWindow->getVertScrollBar(); + return rVertScrollBar.GetVisibleSize(); } virtual void set_vpolicy(VclPolicyType eVPolicy) override @@ -1094,6 +1155,13 @@ IMPL_LINK_NOARG(SalInstanceScrolledWindow, VscrollHdl, ScrollBar*, void) m_aOrigVScrollHdl.Call(&m_xScrolledWindow->getVertScrollBar()); } +IMPL_LINK_NOARG(SalInstanceScrolledWindow, HscrollHdl, ScrollBar*, void) +{ + signal_hadjustment_changed(); + if (!m_bUserManagedScrolling) + m_aOrigHScrollHdl.Call(&m_xScrolledWindow->getHorzScrollBar()); +} + class SalInstanceNotebook : public SalInstanceContainer, public virtual weld::Notebook { private: @@ -3172,6 +3240,11 @@ public: assert(false); } + virtual void set_entry_max_length(int /*nChars*/) override + { + assert(false); + } + virtual void set_entry_completion(bool) override { assert(false); @@ -3260,6 +3333,11 @@ public: m_xComboBox->SetWidthInChars(nChars); } + virtual void set_entry_max_length(int nChars) override + { + m_xComboBox->SetMaxTextLen(nChars); + } + virtual void set_entry_completion(bool bEnable) override { m_xComboBox->EnableAutocomplete(bEnable); diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx index bace88d1d59c..6f30a230b43a 100644 --- a/vcl/source/window/layout.cxx +++ b/vcl/source/window/layout.cxx @@ -1842,18 +1842,7 @@ IMPL_LINK_NOARG(VclScrolledWindow, ScrollBarHdl, ScrollBar*, void) if (!pChild) return; - Point aWinPos; - - if (m_pHScroll->IsVisible()) - { - aWinPos.setX( -m_pHScroll->GetThumbPos() ); - } - - if (m_pVScroll->IsVisible()) - { - aWinPos.setY( -m_pVScroll->GetThumbPos() ); - } - + Point aWinPos(-m_pHScroll->GetThumbPos(), -m_pVScroll->GetThumbPos()); pChild->SetPosPixel(aWinPos); } @@ -1897,19 +1886,16 @@ void VclScrolledWindow::InitScrollBars(const Size &rRequest) Size aOutSize(getVisibleChildSize()); - if (m_pVScroll->IsVisible()) - { - m_pVScroll->SetRangeMax(rRequest.Height()); - m_pVScroll->SetVisibleSize(aOutSize.Height()); - m_pVScroll->SetPageSize(16); - } + m_pVScroll->SetRangeMax(rRequest.Height()); + m_pVScroll->SetVisibleSize(aOutSize.Height()); + m_pVScroll->SetPageSize(16); - if (m_pHScroll->IsVisible()) - { - m_pHScroll->SetRangeMax(rRequest.Width()); - m_pHScroll->SetVisibleSize(aOutSize.Width()); - m_pHScroll->SetPageSize(16); - } + m_pHScroll->SetRangeMax(rRequest.Width()); + m_pHScroll->SetVisibleSize(aOutSize.Width()); + m_pHScroll->SetPageSize(16); + + m_pVScroll->Scroll(); + m_pHScroll->Scroll(); } void VclScrolledWindow::setAllocation(const Size &rAllocation) |