vcl/inc/salvtables.hxx | 947 +++++++++++ vcl/source/app/salvtables.cxx | 3379 ++++++++++++++++++------------------------ 2 files changed, 2472 insertions(+), 1854 deletions(-)
New commits: commit 93998a0e0a70d24e732690e8bb5a062f516eebeb Author: Szymon Kłos <[email protected]> AuthorDate: Wed Mar 18 11:07:02 2020 +0100 Commit: Szymon Kłos <[email protected]> CommitDate: Thu May 14 14:38:06 2020 +0200 Move SalInstanceCheckButton to header file Change-Id: Id6597cd259abefe69a61f0ab414c6bd2114c9749 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93977 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index d126db67a116..4a8d70bcf16a 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -924,4 +924,24 @@ public: virtual Container* weld_message_area() override; }; +class SalInstanceCheckButton : public SalInstanceButton, public virtual weld::CheckButton +{ +private: + VclPtr<CheckBox> m_xCheckButton; + + DECL_LINK(ToggleHdl, CheckBox&, void); +public: + SalInstanceCheckButton(CheckBox* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership); + + virtual void set_active(bool active) override; + + virtual bool get_active() const override; + + virtual void set_inconsistent(bool inconsistent) override; + + virtual bool get_inconsistent() const override; + + virtual ~SalInstanceCheckButton() override; +}; + #endif \ No newline at end of file diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 058d7a39bf72..2711b40f1a67 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2777,51 +2777,43 @@ IMPL_LINK(SalInstanceToggleButton, ToggleListener, VclWindowEvent&, rEvent, void signal_toggled(); } -class SalInstanceCheckButton : public SalInstanceButton, public virtual weld::CheckButton +SalInstanceCheckButton::SalInstanceCheckButton(CheckBox* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership) + : SalInstanceButton(pButton, pBuilder, bTakeOwnership) + , m_xCheckButton(pButton) { -private: - VclPtr<CheckBox> m_xCheckButton; - - DECL_LINK(ToggleHdl, CheckBox&, void); -public: - SalInstanceCheckButton(CheckBox* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership) - : SalInstanceButton(pButton, pBuilder, bTakeOwnership) - , m_xCheckButton(pButton) - { - m_xCheckButton->SetToggleHdl(LINK(this, SalInstanceCheckButton, ToggleHdl)); - } + m_xCheckButton->SetToggleHdl(LINK(this, SalInstanceCheckButton, ToggleHdl)); +} - virtual void set_active(bool active) override - { - disable_notify_events(); - m_xCheckButton->EnableTriState(false); - m_xCheckButton->Check(active); - enable_notify_events(); - } +void SalInstanceCheckButton::set_active(bool active) +{ + disable_notify_events(); + m_xCheckButton->EnableTriState(false); + m_xCheckButton->Check(active); + enable_notify_events(); +} - virtual bool get_active() const override - { - return m_xCheckButton->IsChecked(); - } +bool SalInstanceCheckButton::get_active() const +{ + return m_xCheckButton->IsChecked(); +} - virtual void set_inconsistent(bool inconsistent) override - { - disable_notify_events(); - m_xCheckButton->EnableTriState(true); - m_xCheckButton->SetState(inconsistent ? TRISTATE_INDET : TRISTATE_FALSE); - enable_notify_events(); - } +void SalInstanceCheckButton::set_inconsistent(bool inconsistent) +{ + disable_notify_events(); + m_xCheckButton->EnableTriState(true); + m_xCheckButton->SetState(inconsistent ? TRISTATE_INDET : TRISTATE_FALSE); + enable_notify_events(); +} - virtual bool get_inconsistent() const override - { - return m_xCheckButton->GetState() == TRISTATE_INDET; - } +bool SalInstanceCheckButton::get_inconsistent() const +{ + return m_xCheckButton->GetState() == TRISTATE_INDET; +} - virtual ~SalInstanceCheckButton() override - { - m_xCheckButton->SetToggleHdl(Link<CheckBox&, void>()); - } -}; +SalInstanceCheckButton::~SalInstanceCheckButton() +{ + m_xCheckButton->SetToggleHdl(Link<CheckBox&, void>()); +} IMPL_LINK_NOARG(SalInstanceCheckButton, ToggleHdl, CheckBox&, void) { commit ddbab2afdb7043e109073c6b647c35d40d54b8a2 Author: Szymon Kłos <[email protected]> AuthorDate: Tue Mar 17 14:25:01 2020 +0100 Commit: Szymon Kłos <[email protected]> CommitDate: Thu May 14 14:38:06 2020 +0200 Move SalInstanceMessageDialog to header file Change-Id: Ie982bae356f3e13ec40012e5dd9bac45887d2925 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93976 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index a786788065ae..d126db67a116 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -13,6 +13,7 @@ #include <vcl/lstbox.hxx> #include <vcl/tabctrl.hxx> #include <vcl/layout.hxx> +#include <messagedialog.hxx> class SalInstanceBuilder : public weld::Builder { @@ -903,4 +904,24 @@ public: virtual ~SalInstanceNotebook() override; }; +class SalInstanceMessageDialog : public SalInstanceDialog, public virtual weld::MessageDialog +{ +private: + VclPtr<::MessageDialog> m_xMessageDialog; + +public: + SalInstanceMessageDialog(::MessageDialog* pDialog, SalInstanceBuilder* pBuilder, + bool bTakeOwnership); + + virtual void set_primary_text(const OUString& rText) override; + + virtual OUString get_primary_text() const override; + + virtual void set_secondary_text(const OUString& rText) override; + + virtual OUString get_secondary_text() const override; + + virtual Container* weld_message_area() override; +}; + #endif \ No newline at end of file diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 4ae946df7ba5..058d7a39bf72 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1593,42 +1593,36 @@ IMPL_LINK(SalInstanceDialog, PopupScreenShotMenuHdl, const CommandEvent&, rCEvt, return false; } -class SalInstanceMessageDialog : public SalInstanceDialog, public virtual weld::MessageDialog +SalInstanceMessageDialog::SalInstanceMessageDialog(::MessageDialog* pDialog, SalInstanceBuilder* pBuilder, bool bTakeOwnership) + : SalInstanceDialog(pDialog, pBuilder, bTakeOwnership) + , m_xMessageDialog(pDialog) { -private: - VclPtr<::MessageDialog> m_xMessageDialog; -public: - SalInstanceMessageDialog(::MessageDialog* pDialog, SalInstanceBuilder* pBuilder, bool bTakeOwnership) - : SalInstanceDialog(pDialog, pBuilder, bTakeOwnership) - , m_xMessageDialog(pDialog) - { - } +} - virtual void set_primary_text(const OUString& rText) override - { - m_xMessageDialog->set_primary_text(rText); - } +void SalInstanceMessageDialog::set_primary_text(const OUString& rText) +{ + m_xMessageDialog->set_primary_text(rText); +} - virtual OUString get_primary_text() const override - { - return m_xMessageDialog->get_primary_text(); - } +OUString SalInstanceMessageDialog::get_primary_text() const +{ + return m_xMessageDialog->get_primary_text(); +} - virtual void set_secondary_text(const OUString& rText) override - { - m_xMessageDialog->set_secondary_text(rText); - } +void SalInstanceMessageDialog::set_secondary_text(const OUString& rText) +{ + m_xMessageDialog->set_secondary_text(rText); +} - virtual OUString get_secondary_text() const override - { - return m_xMessageDialog->get_secondary_text(); - } +OUString SalInstanceMessageDialog::get_secondary_text() const +{ + return m_xMessageDialog->get_secondary_text(); +} - virtual Container* weld_message_area() override - { - return new SalInstanceContainer(m_xMessageDialog->get_message_area(), m_pBuilder, false); - } -}; +weld::Container* SalInstanceMessageDialog::weld_message_area() +{ + return new SalInstanceContainer(m_xMessageDialog->get_message_area(), m_pBuilder, false); +} class SalInstanceAboutDialog : public SalInstanceDialog, public virtual weld::AboutDialog { commit 91074fce875e68978f34c1103982d2d5887a0894 Author: Szymon Kłos <[email protected]> AuthorDate: Wed Mar 4 16:03:01 2020 +0100 Commit: Szymon Kłos <[email protected]> CommitDate: Thu May 14 14:38:06 2020 +0200 Move SalInstanceNotebook to header file Change-Id: Id14b6fca6f12f49691a621f636300f9da320834c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93975 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 4117330701ef..a786788065ae 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -11,6 +11,8 @@ #include <vcl/spinfld.hxx> #include <vcl/fixed.hxx> #include <vcl/lstbox.hxx> +#include <vcl/tabctrl.hxx> +#include <vcl/layout.hxx> class SalInstanceBuilder : public weld::Builder { @@ -862,4 +864,43 @@ public: virtual ~SalInstanceButton() override; }; +class SalInstanceNotebook : public SalInstanceContainer, public virtual weld::Notebook +{ +private: + VclPtr<TabControl> m_xNotebook; + mutable std::vector<std::unique_ptr<SalInstanceContainer>> m_aPages; + std::vector<VclPtr<TabPage>> m_aAddedPages; + std::vector<VclPtr<VclGrid>> m_aAddedGrids; + + DECL_LINK(DeactivatePageHdl, TabControl*, bool); + DECL_LINK(ActivatePageHdl, TabControl*, void); + +public: + SalInstanceNotebook(TabControl* pNotebook, SalInstanceBuilder* pBuilder, bool bTakeOwnership); + + virtual int get_current_page() const override; + + virtual OString get_page_ident(int nPage) const override; + + virtual OString get_current_page_ident() const override; + + virtual weld::Container* get_page(const OString& rIdent) const override; + + virtual void set_current_page(int nPage) override; + + virtual void set_current_page(const OString& rIdent) override; + + virtual void remove_page(const OString& rIdent) override; + + virtual void append_page(const OString& rIdent, const OUString& rLabel) override; + + virtual int get_n_pages() const override; + + virtual OUString get_tab_label_text(const OString& rIdent) const override; + + virtual void set_tab_label_text(const OString& rIdent, const OUString& rText) override; + + virtual ~SalInstanceNotebook() override; +}; + #endif \ No newline at end of file diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index c6a2ea519714..4ae946df7ba5 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2164,114 +2164,101 @@ IMPL_LINK_NOARG(SalInstanceScrolledWindow, HscrollHdl, ScrollBar*, void) m_aOrigHScrollHdl.Call(&m_xScrolledWindow->getHorzScrollBar()); } -class SalInstanceNotebook : public SalInstanceContainer, public virtual weld::Notebook +SalInstanceNotebook::SalInstanceNotebook(TabControl* pNotebook, SalInstanceBuilder* pBuilder, bool bTakeOwnership) + : SalInstanceContainer(pNotebook, pBuilder, bTakeOwnership) + , m_xNotebook(pNotebook) { -private: - VclPtr<TabControl> m_xNotebook; - mutable std::vector<std::unique_ptr<SalInstanceContainer>> m_aPages; - std::vector<VclPtr<TabPage>> m_aAddedPages; - std::vector<VclPtr<VclGrid>> m_aAddedGrids; - - DECL_LINK(DeactivatePageHdl, TabControl*, bool); - DECL_LINK(ActivatePageHdl, TabControl*, void); - -public: - SalInstanceNotebook(TabControl* pNotebook, SalInstanceBuilder* pBuilder, bool bTakeOwnership) - : SalInstanceContainer(pNotebook, pBuilder, bTakeOwnership) - , m_xNotebook(pNotebook) - { - m_xNotebook->SetActivatePageHdl(LINK(this, SalInstanceNotebook, ActivatePageHdl)); - m_xNotebook->SetDeactivatePageHdl(LINK(this, SalInstanceNotebook, DeactivatePageHdl)); - } + m_xNotebook->SetActivatePageHdl(LINK(this, SalInstanceNotebook, ActivatePageHdl)); + m_xNotebook->SetDeactivatePageHdl(LINK(this, SalInstanceNotebook, DeactivatePageHdl)); +} - virtual int get_current_page() const override - { - return m_xNotebook->GetPagePos(m_xNotebook->GetCurPageId()); - } +int SalInstanceNotebook::get_current_page() const +{ + return m_xNotebook->GetPagePos(m_xNotebook->GetCurPageId()); +} - virtual OString get_page_ident(int nPage) const override - { - return m_xNotebook->GetPageName(m_xNotebook->GetPageId(nPage)); - } +OString SalInstanceNotebook::get_page_ident(int nPage) const +{ + return m_xNotebook->GetPageName(m_xNotebook->GetPageId(nPage)); +} - virtual OString get_current_page_ident() const override - { - return m_xNotebook->GetPageName(m_xNotebook->GetCurPageId()); - } +OString SalInstanceNotebook::get_current_page_ident() const +{ + return m_xNotebook->GetPageName(m_xNotebook->GetCurPageId()); +} - virtual weld::Container* get_page(const OString& rIdent) const override - { - sal_uInt16 nPageId = m_xNotebook->GetPageId(rIdent); - sal_uInt16 nPageIndex = m_xNotebook->GetPagePos(nPageId); - if (nPageIndex == TAB_PAGE_NOTFOUND) - return nullptr; - TabPage* pPage = m_xNotebook->GetTabPage(nPageId); - vcl::Window* pChild = pPage->GetChild(0); - if (m_aPages.size() < nPageIndex + 1U) - m_aPages.resize(nPageIndex + 1U); - if (!m_aPages[nPageIndex]) - m_aPages[nPageIndex].reset(new SalInstanceContainer(pChild, m_pBuilder, false)); - return m_aPages[nPageIndex].get(); - } +weld::Container* SalInstanceNotebook::get_page(const OString& rIdent) const +{ + sal_uInt16 nPageId = m_xNotebook->GetPageId(rIdent); + sal_uInt16 nPageIndex = m_xNotebook->GetPagePos(nPageId); + if (nPageIndex == TAB_PAGE_NOTFOUND) + return nullptr; + TabPage* pPage = m_xNotebook->GetTabPage(nPageId); + vcl::Window* pChild = pPage->GetChild(0); + if (m_aPages.size() < nPageIndex + 1U) + m_aPages.resize(nPageIndex + 1U); + if (!m_aPages[nPageIndex]) + m_aPages[nPageIndex].reset(new SalInstanceContainer(pChild, m_pBuilder, false)); + return m_aPages[nPageIndex].get(); +} - virtual void set_current_page(int nPage) override - { - m_xNotebook->SetCurPageId(m_xNotebook->GetPageId(nPage)); - } +void SalInstanceNotebook::set_current_page(int nPage) +{ + m_xNotebook->SetCurPageId(m_xNotebook->GetPageId(nPage)); +} - virtual void set_current_page(const OString& rIdent) override - { - m_xNotebook->SetCurPageId(m_xNotebook->GetPageId(rIdent)); - } +void SalInstanceNotebook::set_current_page(const OString& rIdent) +{ + m_xNotebook->SetCurPageId(m_xNotebook->GetPageId(rIdent)); +} - virtual void remove_page(const OString& rIdent) override - { - m_xNotebook->RemovePage(m_xNotebook->GetPageId(rIdent)); - } +void SalInstanceNotebook::remove_page(const OString& rIdent) +{ + m_xNotebook->RemovePage(m_xNotebook->GetPageId(rIdent)); +} - virtual void append_page(const OString& rIdent, const OUString& rLabel) override - { - sal_uInt16 nPageCount = m_xNotebook->GetPageCount(); - sal_uInt16 nLastPageId = nPageCount ? m_xNotebook->GetPageId(nPageCount - 1) : 0; - sal_uInt16 nNewPageId = nLastPageId + 1; - m_xNotebook->InsertPage(nNewPageId, rLabel); - VclPtrInstance<TabPage> xPage(m_xNotebook); - VclPtrInstance<VclGrid> xGrid(xPage); - xPage->Show(); - xGrid->set_hexpand(true); - xGrid->set_vexpand(true); - xGrid->Show(); - m_xNotebook->SetTabPage(nNewPageId, xPage); - m_xNotebook->SetPageName(nNewPageId, rIdent); - m_aAddedPages.push_back(xPage); - m_aAddedGrids.push_back(xGrid); - } +void SalInstanceNotebook::append_page(const OString& rIdent, const OUString& rLabel) +{ + sal_uInt16 nPageCount = m_xNotebook->GetPageCount(); + sal_uInt16 nLastPageId = nPageCount ? m_xNotebook->GetPageId(nPageCount - 1) : 0; + sal_uInt16 nNewPageId = nLastPageId + 1; + m_xNotebook->InsertPage(nNewPageId, rLabel); + VclPtrInstance<TabPage> xPage(m_xNotebook); + VclPtrInstance<VclGrid> xGrid(xPage); + xPage->Show(); + xGrid->set_hexpand(true); + xGrid->set_vexpand(true); + xGrid->Show(); + m_xNotebook->SetTabPage(nNewPageId, xPage); + m_xNotebook->SetPageName(nNewPageId, rIdent); + m_aAddedPages.push_back(xPage); + m_aAddedGrids.push_back(xGrid); +} - virtual int get_n_pages() const override - { - return m_xNotebook->GetPageCount(); - } +int SalInstanceNotebook::get_n_pages() const +{ + return m_xNotebook->GetPageCount(); +} - virtual OUString get_tab_label_text(const OString& rIdent) const override - { - return m_xNotebook->GetPageText(m_xNotebook->GetPageId(rIdent)); - } +OUString SalInstanceNotebook::get_tab_label_text(const OString& rIdent) const +{ + return m_xNotebook->GetPageText(m_xNotebook->GetPageId(rIdent)); +} - virtual void set_tab_label_text(const OString& rIdent, const OUString& rText) override - { - return m_xNotebook->SetPageText(m_xNotebook->GetPageId(rIdent), rText); - } +void SalInstanceNotebook::set_tab_label_text(const OString& rIdent, const OUString& rText) +{ + return m_xNotebook->SetPageText(m_xNotebook->GetPageId(rIdent), rText); +} - virtual ~SalInstanceNotebook() override - { - for (auto &rGrid : m_aAddedGrids) - rGrid.disposeAndClear(); - for (auto &rPage : m_aAddedPages) - rPage.disposeAndClear(); - m_xNotebook->SetActivatePageHdl(Link<TabControl*,void>()); - m_xNotebook->SetDeactivatePageHdl(Link<TabControl*,bool>()); - } -}; +SalInstanceNotebook::~SalInstanceNotebook() +{ + for (auto &rGrid : m_aAddedGrids) + rGrid.disposeAndClear(); + for (auto &rPage : m_aAddedPages) + rPage.disposeAndClear(); + m_xNotebook->SetActivatePageHdl(Link<TabControl*,void>()); + m_xNotebook->SetDeactivatePageHdl(Link<TabControl*,bool>()); +} IMPL_LINK_NOARG(SalInstanceNotebook, DeactivatePageHdl, TabControl*, bool) { commit ec838f4b57044549058ed204f226198576d53564 Author: Szymon Kłos <[email protected]> AuthorDate: Fri Feb 28 14:40:03 2020 +0100 Commit: Szymon Kłos <[email protected]> CommitDate: Thu May 14 14:38:06 2020 +0200 Move SalInstanceButton to header file Change-Id: I3f6aa1975ae5859e0c340c82627d95e49313a668 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93483 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 88a827fb1f45..4117330701ef 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -836,4 +836,30 @@ public: virtual ~SalInstanceComboBoxWithEdit() override; }; +class SalInstanceButton : public SalInstanceContainer, public virtual weld::Button +{ +private: + VclPtr<::Button> m_xButton; + Link<::Button*, void> const m_aOldClickHdl; + + DECL_LINK(ClickHdl, ::Button*, void); + +public: + SalInstanceButton(::Button* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership); + + virtual void set_label(const OUString& rText) override; + + virtual void set_image(VirtualDevice* pDevice) override; + + virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override; + + virtual void set_from_icon_name(const OUString& rIconName) override; + + virtual void set_label_line_wrap(bool wrap) override; + + virtual OUString get_label() const override; + + virtual ~SalInstanceButton() override; +}; + #endif \ No newline at end of file diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 8ff2268c17b7..c6a2ea519714 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -2384,67 +2384,58 @@ IMPL_LINK_NOARG(SalInstanceVerticalNotebook, ActivatePageHdl, VerticalTabControl m_aEnterPageHdl.Call(get_current_page_ident()); } -class SalInstanceButton : public SalInstanceContainer, public virtual weld::Button +SalInstanceButton::SalInstanceButton(::Button* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership) + : SalInstanceContainer(pButton, pBuilder, bTakeOwnership) + , m_xButton(pButton) + , m_aOldClickHdl(pButton->GetClickHdl()) { -private: - VclPtr<::Button> m_xButton; - Link<::Button*,void> const m_aOldClickHdl; - - DECL_LINK(ClickHdl, ::Button*, void); -public: - SalInstanceButton(::Button* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership) - : SalInstanceContainer(pButton, pBuilder, bTakeOwnership) - , m_xButton(pButton) - , m_aOldClickHdl(pButton->GetClickHdl()) - { - m_xButton->SetClickHdl(LINK(this, SalInstanceButton, ClickHdl)); - } + m_xButton->SetClickHdl(LINK(this, SalInstanceButton, ClickHdl)); +} - virtual void set_label(const OUString& rText) override - { - m_xButton->SetText(rText); - } +void SalInstanceButton::set_label(const OUString& rText) +{ + m_xButton->SetText(rText); +} - virtual void set_image(VirtualDevice* pDevice) override - { - m_xButton->SetImageAlign(ImageAlign::Left); - if (pDevice) - m_xButton->SetModeImage(createImage(*pDevice)); - else - m_xButton->SetModeImage(Image()); - } +void SalInstanceButton::set_image(VirtualDevice* pDevice) +{ + m_xButton->SetImageAlign(ImageAlign::Left); + if (pDevice) + m_xButton->SetModeImage(createImage(*pDevice)); + else + m_xButton->SetModeImage(Image()); +} - virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override - { - m_xButton->SetImageAlign(ImageAlign::Left); - m_xButton->SetModeImage(Image(rImage)); - } +void SalInstanceButton::set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) +{ + m_xButton->SetImageAlign(ImageAlign::Left); + m_xButton->SetModeImage(Image(rImage)); +} - virtual void set_from_icon_name(const OUString& rIconName) override - { - m_xButton->SetModeImage(Image(StockImage::Yes, rIconName)); - } +void SalInstanceButton::set_from_icon_name(const OUString& rIconName) +{ + m_xButton->SetModeImage(Image(StockImage::Yes, rIconName)); +} - virtual void set_label_line_wrap(bool wrap) override - { - WinBits nBits = m_xButton->GetStyle(); - nBits &= ~WB_WORDBREAK; - if (wrap) - nBits |= WB_WORDBREAK; - m_xButton->SetStyle(nBits); - m_xButton->queue_resize(); - } +void SalInstanceButton::set_label_line_wrap(bool wrap) +{ + WinBits nBits = m_xButton->GetStyle(); + nBits &= ~WB_WORDBREAK; + if (wrap) + nBits |= WB_WORDBREAK; + m_xButton->SetStyle(nBits); + m_xButton->queue_resize(); +} - virtual OUString get_label() const override - { - return m_xButton->GetText(); - } +OUString SalInstanceButton::get_label() const +{ + return m_xButton->GetText(); +} - virtual ~SalInstanceButton() override - { - m_xButton->SetClickHdl(Link<::Button*,void>()); - } -}; +SalInstanceButton::~SalInstanceButton() +{ + m_xButton->SetClickHdl(Link<::Button*,void>()); +} IMPL_LINK(SalInstanceButton, ClickHdl, ::Button*, pButton, void) { commit 74d307351ec2af5758c7f416623af072c8fba527 Author: Szymon Kłos <[email protected]> AuthorDate: Tue Feb 25 12:36:29 2020 +0100 Commit: Szymon Kłos <[email protected]> CommitDate: Thu May 14 14:38:06 2020 +0200 Move SalInstanceComboBox to header file Change-Id: Iafa449cc1ebba93cc69da194857ea33b8f8510b4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93482 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 418a4d0eddae..88a827fb1f45 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -9,6 +9,8 @@ #include <vcl/ctrl.hxx> #include <vcl/edit.hxx> #include <vcl/spinfld.hxx> +#include <vcl/fixed.hxx> +#include <vcl/lstbox.hxx> class SalInstanceBuilder : public weld::Builder { @@ -605,4 +607,233 @@ public: virtual ~SalInstanceSpinButton() override; }; +//ComboBox and ListBox have similar apis, ComboBoxes in LibreOffice have an edit box and ListBoxes +//don't. This distinction isn't there in Gtk. Use a template to sort this problem out. +template <class vcl_type> +class SalInstanceComboBox : public SalInstanceContainer, public virtual weld::ComboBox +{ +protected: + // owner for ListBox/ComboBox UserData + std::vector<std::unique_ptr<OUString>> m_aUserData; + VclPtr<vcl_type> m_xComboBox; + +public: + SalInstanceComboBox(vcl_type* pComboBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership) + : SalInstanceContainer(pComboBox, pBuilder, bTakeOwnership) + , m_xComboBox(pComboBox) + { + } + + virtual int get_active() const override + { + const sal_Int32 nRet = m_xComboBox->GetSelectedEntryPos(); + if (nRet == LISTBOX_ENTRY_NOTFOUND) + return -1; + return nRet; + } + + const OUString* getEntryData(int index) const + { + return static_cast<const OUString*>(m_xComboBox->GetEntryData(index)); + } + + // ComboBoxes are comprised of multiple subwidgets, consider the lot as + // one thing for focus + virtual bool has_focus() const override { return m_xWidget->HasChildPathFocus(); } + + virtual OUString get_active_id() const override + { + sal_Int32 nPos = m_xComboBox->GetSelectedEntryPos(); + const OUString* pRet; + if (nPos != LISTBOX_ENTRY_NOTFOUND) + pRet = getEntryData(m_xComboBox->GetSelectedEntryPos()); + else + pRet = nullptr; + if (!pRet) + return OUString(); + return *pRet; + } + + virtual void set_active_id(const OUString& rStr) override + { + for (int i = 0; i < get_count(); ++i) + { + const OUString* pId = getEntryData(i); + if (!pId) + continue; + if (*pId == rStr) + m_xComboBox->SelectEntryPos(i); + } + } + + virtual void set_active(int pos) override + { + if (pos == -1) + { + m_xComboBox->SetNoSelection(); + return; + } + m_xComboBox->SelectEntryPos(pos); + } + + virtual OUString get_text(int pos) const override { return m_xComboBox->GetEntry(pos); } + + virtual OUString get_id(int pos) const override + { + const OUString* pRet = getEntryData(pos); + if (!pRet) + return OUString(); + return *pRet; + } + + virtual void set_id(int row, const OUString& rId) override + { + m_aUserData.emplace_back(std::make_unique<OUString>(rId)); + m_xComboBox->SetEntryData(row, m_aUserData.back().get()); + } + + virtual void insert_vector(const std::vector<weld::ComboBoxEntry>& rItems, + bool bKeepExisting) override + { + freeze(); + if (!bKeepExisting) + clear(); + for (const auto& rItem : rItems) + { + insert(-1, rItem.sString, rItem.sId.isEmpty() ? nullptr : &rItem.sId, + rItem.sImage.isEmpty() ? nullptr : &rItem.sImage, nullptr); + } + thaw(); + } + + virtual int get_count() const override { return m_xComboBox->GetEntryCount(); } + + virtual int find_text(const OUString& rStr) const override + { + const sal_Int32 nRet = m_xComboBox->GetEntryPos(rStr); + if (nRet == LISTBOX_ENTRY_NOTFOUND) + return -1; + return nRet; + } + + virtual int find_id(const OUString& rStr) const override + { + for (int i = 0; i < get_count(); ++i) + { + const OUString* pId = getEntryData(i); + if (!pId) + continue; + if (*pId == rStr) + return i; + } + return -1; + } + + virtual void clear() override + { + m_xComboBox->Clear(); + m_aUserData.clear(); + } + + virtual void make_sorted() override + { + m_xComboBox->SetStyle(m_xComboBox->GetStyle() | WB_SORT); + } + + virtual bool get_popup_shown() const override { return m_xComboBox->IsInDropDown(); } + + virtual void connect_popup_toggled(const Link<ComboBox&, void>& rLink) override + { + weld::ComboBox::connect_popup_toggled(rLink); + ensure_event_listener(); + } + + virtual void HandleEventListener(VclWindowEvent& rEvent) override + { + if (rEvent.GetId() == VclEventId::DropdownPreOpen + || rEvent.GetId() == VclEventId::DropdownClose) + { + signal_popup_toggled(); + return; + } + SalInstanceContainer::HandleEventListener(rEvent); + } +}; + +class SalInstanceComboBoxWithoutEdit : public SalInstanceComboBox<ListBox> +{ +private: + DECL_LINK(SelectHdl, ListBox&, void); + +public: + SalInstanceComboBoxWithoutEdit(ListBox* pListBox, SalInstanceBuilder* pBuilder, + bool bTakeOwnership); + + virtual OUString get_active_text() const override; + + virtual void remove(int pos) override; + + virtual void insert(int pos, const OUString& rStr, const OUString* pId, + const OUString* pIconName, VirtualDevice* pImageSurface) override; + + virtual void insert_separator(int pos, const OUString& /*rId*/) override; + + virtual bool has_entry() const override; + + virtual void set_entry_message_type(weld::EntryMessageType /*eType*/) override; + + virtual void set_entry_text(const OUString& /*rText*/) override; + + virtual void select_entry_region(int /*nStartPos*/, int /*nEndPos*/) override; + + virtual bool get_entry_selection_bounds(int& /*rStartPos*/, int& /*rEndPos*/) override; + + virtual void set_entry_width_chars(int /*nChars*/) override; + + virtual void set_entry_max_length(int /*nChars*/) override; + + virtual void set_entry_completion(bool, bool) override; + + virtual ~SalInstanceComboBoxWithoutEdit() override; +}; + +class SalInstanceComboBoxWithEdit : public SalInstanceComboBox<ComboBox> +{ +private: + DECL_LINK(ChangeHdl, Edit&, void); + DECL_LINK(EntryActivateHdl, Edit&, bool); + WeldTextFilter m_aTextFilter; + +public: + SalInstanceComboBoxWithEdit(::ComboBox* pComboBox, SalInstanceBuilder* pBuilder, + bool bTakeOwnership); + + virtual bool has_entry() const override; + + virtual void set_entry_message_type(weld::EntryMessageType eType) override; + + virtual OUString get_active_text() const override; + + virtual void remove(int pos) override; + + virtual void insert(int pos, const OUString& rStr, const OUString* pId, + const OUString* pIconName, VirtualDevice* pImageSurface) override; + + virtual void insert_separator(int pos, const OUString& /*rId*/) override; + + virtual void set_entry_text(const OUString& rText) override; + + virtual void set_entry_width_chars(int nChars) override; + + virtual void set_entry_max_length(int nChars) override; + + virtual void set_entry_completion(bool bEnable, bool bCaseSensitive) override; + + virtual void select_entry_region(int nStartPos, int nEndPos) override; + + virtual bool get_entry_selection_bounds(int& rStartPos, int& rEndPos) override; + + virtual ~SalInstanceComboBoxWithEdit() override; +}; + #endif \ No newline at end of file diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index f104cc505712..8ff2268c17b7 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -5486,275 +5486,97 @@ IMPL_LINK(SalInstanceDrawingArea, QueryTooltipHdl, tools::Rectangle&, rHelpArea, return m_aQueryTooltipHdl.Call(rHelpArea); } -//ComboBox and ListBox have similar apis, ComboBoxes in LibreOffice have an edit box and ListBoxes -//don't. This distinction isn't there in Gtk. Use a template to sort this problem out. -template <class vcl_type> -class SalInstanceComboBox : public SalInstanceContainer, public virtual weld::ComboBox +SalInstanceComboBoxWithoutEdit::SalInstanceComboBoxWithoutEdit(ListBox* pListBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership) + : SalInstanceComboBox<ListBox>(pListBox, pBuilder, bTakeOwnership) { -protected: - // owner for ListBox/ComboBox UserData - std::vector<std::unique_ptr<OUString>> m_aUserData; - VclPtr<vcl_type> m_xComboBox; - -public: - SalInstanceComboBox(vcl_type* pComboBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership) - : SalInstanceContainer(pComboBox, pBuilder, bTakeOwnership) - , m_xComboBox(pComboBox) - { - } - - virtual int get_active() const override - { - const sal_Int32 nRet = m_xComboBox->GetSelectedEntryPos(); - if (nRet == LISTBOX_ENTRY_NOTFOUND) - return -1; - return nRet; - } - - const OUString* getEntryData(int index) const - { - return static_cast<const OUString*>(m_xComboBox->GetEntryData(index)); - } - - // ComboBoxes are comprised of multiple subwidgets, consider the lot as - // one thing for focus - virtual bool has_focus() const override - { - return m_xWidget->HasChildPathFocus(); - } - - virtual OUString get_active_id() const override - { - sal_Int32 nPos = m_xComboBox->GetSelectedEntryPos(); - const OUString* pRet; - if (nPos != LISTBOX_ENTRY_NOTFOUND) - pRet = getEntryData(m_xComboBox->GetSelectedEntryPos()); - else - pRet = nullptr; - if (!pRet) - return OUString(); - return *pRet; - } - - virtual void set_active_id(const OUString& rStr) override - { - for (int i = 0; i < get_count(); ++i) - { - const OUString* pId = getEntryData(i); - if (!pId) - continue; - if (*pId == rStr) - m_xComboBox->SelectEntryPos(i); - } - } - - virtual void set_active(int pos) override - { - if (pos == -1) - { - m_xComboBox->SetNoSelection(); - return; - } - m_xComboBox->SelectEntryPos(pos); - } - - virtual OUString get_text(int pos) const override - { - return m_xComboBox->GetEntry(pos); - } - - virtual OUString get_id(int pos) const override - { - const OUString* pRet = getEntryData(pos); - if (!pRet) - return OUString(); - return *pRet; - } - - virtual void set_id(int row, const OUString& rId) override - { - m_aUserData.emplace_back(std::make_unique<OUString>(rId)); - m_xComboBox->SetEntryData(row, m_aUserData.back().get()); - } - - virtual void insert_vector(const std::vector<weld::ComboBoxEntry>& rItems, bool bKeepExisting) override - { - freeze(); - if (!bKeepExisting) - clear(); - for (const auto& rItem : rItems) - { - insert(-1, rItem.sString, rItem.sId.isEmpty() ? nullptr : &rItem.sId, - rItem.sImage.isEmpty() ? nullptr : &rItem.sImage, nullptr); - } - thaw(); - } - - virtual int get_count() const override - { - return m_xComboBox->GetEntryCount(); - } - - virtual int find_text(const OUString& rStr) const override - { - const sal_Int32 nRet = m_xComboBox->GetEntryPos(rStr); - if (nRet == LISTBOX_ENTRY_NOTFOUND) - return -1; - return nRet; - } - - virtual int find_id(const OUString& rStr) const override - { - for (int i = 0; i < get_count(); ++i) - { - const OUString* pId = getEntryData(i); - if (!pId) - continue; - if (*pId == rStr) - return i; - } - return -1; - } - - virtual void clear() override - { - m_xComboBox->Clear(); - m_aUserData.clear(); - } - - virtual void make_sorted() override - { - m_xComboBox->SetStyle(m_xComboBox->GetStyle() | WB_SORT); - } - - virtual bool get_popup_shown() const override - { - return m_xComboBox->IsInDropDown(); - } - - virtual void connect_popup_toggled(const Link<ComboBox&, void>& rLink) override - { - weld::ComboBox::connect_popup_toggled(rLink); - ensure_event_listener(); - } - - virtual void HandleEventListener(VclWindowEvent& rEvent) override - { - if (rEvent.GetId() == VclEventId::DropdownPreOpen || - rEvent.GetId() == VclEventId::DropdownClose) - { - signal_popup_toggled(); - return; - } - SalInstanceContainer::HandleEventListener(rEvent); - } -}; + m_xComboBox->SetSelectHdl(LINK(this, SalInstanceComboBoxWithoutEdit, SelectHdl)); +} -class SalInstanceComboBoxWithoutEdit : public SalInstanceComboBox<ListBox> +OUString SalInstanceComboBoxWithoutEdit::get_active_text() const { -private: - DECL_LINK(SelectHdl, ListBox&, void); - -public: - SalInstanceComboBoxWithoutEdit(ListBox* pListBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership) - : SalInstanceComboBox<ListBox>(pListBox, pBuilder, bTakeOwnership) - { - m_xComboBox->SetSelectHdl(LINK(this, SalInstanceComboBoxWithoutEdit, SelectHdl)); - } + return m_xComboBox->GetSelectedEntry(); +} - virtual OUString get_active_text() const override - { - return m_xComboBox->GetSelectedEntry(); - } +void SalInstanceComboBoxWithoutEdit::remove(int pos) +{ + m_xComboBox->RemoveEntry(pos); +} - virtual void remove(int pos) override +void SalInstanceComboBoxWithoutEdit::insert(int pos, const OUString& rStr, const OUString* pId, const OUString* pIconName, VirtualDevice* pImageSurface) +{ + auto nInsertPos = pos == -1 ? COMBOBOX_APPEND : pos; + sal_Int32 nInsertedAt; + if (!pIconName && !pImageSurface) + nInsertedAt = m_xComboBox->InsertEntry(rStr, nInsertPos); + else if (pIconName) + nInsertedAt = m_xComboBox->InsertEntry(rStr, createImage(*pIconName), nInsertPos); + else + nInsertedAt = m_xComboBox->InsertEntry(rStr, createImage(*pImageSurface), nInsertPos); + if (pId) { - m_xComboBox->RemoveEntry(pos); - } - - virtual void insert(int pos, const OUString& rStr, const OUString* pId, const OUString* pIconName, VirtualDevice* pImageSurface) override - { - auto nInsertPos = pos == -1 ? COMBOBOX_APPEND : pos; - sal_Int32 nInsertedAt; - if (!pIconName && !pImageSurface) - nInsertedAt = m_xComboBox->InsertEntry(rStr, nInsertPos); - else if (pIconName) - nInsertedAt = m_xComboBox->InsertEntry(rStr, createImage(*pIconName), nInsertPos); - else - nInsertedAt = m_xComboBox->InsertEntry(rStr, createImage(*pImageSurface), nInsertPos); - if (pId) - { - m_aUserData.emplace_back(std::make_unique<OUString>(*pId)); - m_xComboBox->SetEntryData(nInsertedAt, m_aUserData.back().get()); - } + m_aUserData.emplace_back(std::make_unique<OUString>(*pId)); + m_xComboBox->SetEntryData(nInsertedAt, m_aUserData.back().get()); } +} - virtual void insert_separator(int pos, const OUString& /*rId*/) override - { - auto nInsertPos = pos == -1 ? m_xComboBox->GetEntryCount() : pos; - m_xComboBox->AddSeparator(nInsertPos - 1); - } +void SalInstanceComboBoxWithoutEdit::insert_separator(int pos, const OUString& /*rId*/) +{ + auto nInsertPos = pos == -1 ? m_xComboBox->GetEntryCount() : pos; + m_xComboBox->AddSeparator(nInsertPos - 1); +} - virtual bool has_entry() const override - { - return false; - } +bool SalInstanceComboBoxWithoutEdit::has_entry() const +{ + return false; +} - virtual void set_entry_message_type(weld::EntryMessageType /*eType*/) override - { - assert(false); - } +void SalInstanceComboBoxWithoutEdit::set_entry_message_type(weld::EntryMessageType /*eType*/) +{ + assert(false); +} - virtual void set_entry_text(const OUString& /*rText*/) override - { - assert(false); - } +void SalInstanceComboBoxWithoutEdit::set_entry_text(const OUString& /*rText*/) +{ + assert(false); +} - virtual void select_entry_region(int /*nStartPos*/, int /*nEndPos*/) override - { - assert(false); - } +void SalInstanceComboBoxWithoutEdit::select_entry_region(int /*nStartPos*/, int /*nEndPos*/) +{ + assert(false); +} - virtual bool get_entry_selection_bounds(int& /*rStartPos*/, int& /*rEndPos*/) override - { - assert(false); - return false; - } +bool SalInstanceComboBoxWithoutEdit::get_entry_selection_bounds(int& /*rStartPos*/, int& /*rEndPos*/) +{ + assert(false); + return false; +} - virtual void set_entry_width_chars(int /*nChars*/) override - { - assert(false); - } +void SalInstanceComboBoxWithoutEdit::set_entry_width_chars(int /*nChars*/) +{ + assert(false); +} - virtual void set_entry_max_length(int /*nChars*/) override - { - assert(false); - } +void SalInstanceComboBoxWithoutEdit::set_entry_max_length(int /*nChars*/) +{ + assert(false); +} - virtual void set_entry_completion(bool, bool) override - { - assert(false); - } +void SalInstanceComboBoxWithoutEdit::set_entry_completion(bool, bool) +{ + assert(false); +} - virtual ~SalInstanceComboBoxWithoutEdit() override - { - m_xComboBox->SetSelectHdl(Link<ListBox&, void>()); - } -}; +SalInstanceComboBoxWithoutEdit::~SalInstanceComboBoxWithoutEdit() +{ + m_xComboBox->SetSelectHdl(Link<ListBox&, void>()); +} IMPL_LINK_NOARG(SalInstanceComboBoxWithoutEdit, SelectHdl, ListBox&, void) { return signal_changed(); } -class SalInstanceComboBoxWithEdit : public SalInstanceComboBox<ComboBox> -{ -private: - DECL_LINK(ChangeHdl, Edit&, void); - DECL_LINK(EntryActivateHdl, Edit&, bool); - WeldTextFilter m_aTextFilter; -public: - SalInstanceComboBoxWithEdit(::ComboBox* pComboBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership) + SalInstanceComboBoxWithEdit::SalInstanceComboBoxWithEdit(::ComboBox* pComboBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership) : SalInstanceComboBox<::ComboBox>(pComboBox, pBuilder, bTakeOwnership) , m_aTextFilter(m_aEntryInsertTextHdl) { @@ -5763,12 +5585,12 @@ public: m_xComboBox->SetTextFilter(&m_aTextFilter); } - virtual bool has_entry() const override + bool SalInstanceComboBoxWithEdit::has_entry() const { return true; } - virtual void set_entry_message_type(weld::EntryMessageType eType) override + void SalInstanceComboBoxWithEdit::set_entry_message_type(weld::EntryMessageType eType) { if (eType == weld::EntryMessageType::Error) m_xComboBox->SetControlForeground(Color(0xf0, 0, 0)); @@ -5778,17 +5600,17 @@ public: m_xComboBox->SetControlForeground(); } - virtual OUString get_active_text() const override + OUString SalInstanceComboBoxWithEdit::get_active_text() const { return m_xComboBox->GetText(); } - virtual void remove(int pos) override + void SalInstanceComboBoxWithEdit::remove(int pos) { m_xComboBox->RemoveEntryAt(pos); } - virtual void insert(int pos, const OUString& rStr, const OUString* pId, const OUString* pIconName, VirtualDevice* pImageSurface) override + void SalInstanceComboBoxWithEdit::insert(int pos, const OUString& rStr, const OUString* pId, const OUString* pIconName, VirtualDevice* pImageSurface) { auto nInsertPos = pos == -1 ? COMBOBOX_APPEND : pos; sal_Int32 nInsertedAt; @@ -5805,38 +5627,38 @@ public: } } - virtual void insert_separator(int pos, const OUString& /*rId*/) override + void SalInstanceComboBoxWithEdit::insert_separator(int pos, const OUString& /*rId*/) { auto nInsertPos = pos == -1 ? m_xComboBox->GetEntryCount() : pos; m_xComboBox->AddSeparator(nInsertPos - 1); } - virtual void set_entry_text(const OUString& rText) override + void SalInstanceComboBoxWithEdit::set_entry_text(const OUString& rText) { m_xComboBox->SetText(rText); } - virtual void set_entry_width_chars(int nChars) override + void SalInstanceComboBoxWithEdit::set_entry_width_chars(int nChars) { m_xComboBox->SetWidthInChars(nChars); } - virtual void set_entry_max_length(int nChars) override + void SalInstanceComboBoxWithEdit::set_entry_max_length(int nChars) { m_xComboBox->SetMaxTextLen(nChars); } - virtual void set_entry_completion(bool bEnable, bool bCaseSensitive) override + void SalInstanceComboBoxWithEdit::set_entry_completion(bool bEnable, bool bCaseSensitive) { m_xComboBox->EnableAutocomplete(bEnable, bCaseSensitive); } - virtual void select_entry_region(int nStartPos, int nEndPos) override + void SalInstanceComboBoxWithEdit::select_entry_region(int nStartPos, int nEndPos) { m_xComboBox->SetSelection(Selection(nStartPos, nEndPos < 0 ? SELECTION_MAX : nEndPos)); } - virtual bool get_entry_selection_bounds(int& rStartPos, int& rEndPos) override + bool SalInstanceComboBoxWithEdit::get_entry_selection_bounds(int& rStartPos, int& rEndPos) { const Selection& rSelection = m_xComboBox->GetSelection(); rStartPos = rSelection.Min(); @@ -5844,13 +5666,12 @@ public: return rSelection.Len(); } - virtual ~SalInstanceComboBoxWithEdit() override + SalInstanceComboBoxWithEdit::~SalInstanceComboBoxWithEdit() { m_xComboBox->SetTextFilter(nullptr); m_xComboBox->SetEntryActivateHdl(Link<Edit&, bool>()); m_xComboBox->SetModifyHdl(Link<Edit&, void>()); } -}; IMPL_LINK_NOARG(SalInstanceComboBoxWithEdit, ChangeHdl, Edit&, void) { commit 11075a2ae05cdad28fdd7f11631ebd498e380d4e Author: Szymon Kłos <[email protected]> AuthorDate: Fri Feb 21 14:35:13 2020 +0100 Commit: Szymon Kłos <[email protected]> CommitDate: Thu May 14 14:38:06 2020 +0200 Move SalInstanceEdit declaration to the header file Change-Id: I660de317b88c4e83ccc310743dc4ef5b4c955a21 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89370 Tested-by: Jenkins Reviewed-by: Szymon Kłos <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93481 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index c25c163c6561..418a4d0eddae 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -7,6 +7,8 @@ #include <vcl/settings.hxx> #include <vcl/virdev.hxx> #include <vcl/ctrl.hxx> +#include <vcl/edit.hxx> +#include <vcl/spinfld.hxx> class SalInstanceBuilder : public weld::Builder { @@ -491,4 +493,116 @@ public: virtual Container* weld_content_area() override; }; +class WeldTextFilter : public TextFilter +{ +private: + Link<OUString&, bool>& m_rInsertTextHdl; + +public: + WeldTextFilter(Link<OUString&, bool>& rInsertTextHdl); + + virtual OUString filter(const OUString& rText) override; +}; + +class SalInstanceEntry : public SalInstanceWidget, public virtual weld::Entry +{ +private: + VclPtr<Edit> m_xEntry; + + DECL_LINK(ChangeHdl, Edit&, void); + DECL_LINK(CursorListener, VclWindowEvent&, void); + DECL_LINK(ActivateHdl, Edit&, bool); + + WeldTextFilter m_aTextFilter; + +public: + SalInstanceEntry(Edit* pEntry, SalInstanceBuilder* pBuilder, bool bTakeOwnership); + + virtual void set_text(const OUString& rText) override; + + virtual OUString get_text() const override; + + virtual void set_width_chars(int nChars) override; + + virtual int get_width_chars() const override; + + virtual void set_max_length(int nChars) override; + + virtual void select_region(int nStartPos, int nEndPos) override; + + bool get_selection_bounds(int& rStartPos, int& rEndPos) override; + + virtual void replace_selection(const OUString& rText) override; + + virtual void set_position(int nCursorPos) override; + + virtual int get_position() const override; + + virtual void set_editable(bool bEditable) override; + + virtual bool get_editable() const override; + + virtual void set_message_type(weld::EntryMessageType eType) override; + + virtual void set_font(const vcl::Font& rFont) override; + + virtual void connect_cursor_position(const Link<Entry&, void>& rLink) override; + + Edit& getEntry(); + + void fire_signal_changed(); + + virtual void cut_clipboard() override; + + virtual void copy_clipboard() override; + + virtual void paste_clipboard() override; + + virtual ~SalInstanceEntry() override; +}; + +class SalInstanceSpinButton : public SalInstanceEntry, public virtual weld::SpinButton +{ +private: + VclPtr<FormattedField> m_xButton; + + DECL_LINK(UpDownHdl, SpinField&, void); + DECL_LINK(LoseFocusHdl, Control&, void); + DECL_LINK(OutputHdl, Edit&, bool); + DECL_LINK(InputHdl, sal_Int64*, TriState); + DECL_LINK(ActivateHdl, Edit&, bool); + + double toField(int nValue) const; + + int fromField(double fValue) const; + +public: + SalInstanceSpinButton(FormattedField* pButton, SalInstanceBuilder* pBuilder, + bool bTakeOwnership); + + virtual int get_value() const override; + + virtual void set_value(int value) override; + + virtual void set_range(int min, int max) override; + + virtual void get_range(int& min, int& max) const override; + + virtual void set_increments(int step, int /*page*/) override; + + virtual void get_increments(int& step, int& page) const override; + + virtual void set_digits(unsigned int digits) override; + + //so with hh::mm::ss, incrementing mm will not reset ss + void DisableRemainderFactor(); + + //off by default for direct SpinButtons, MetricSpinButton enables it + void SetUseThousandSep(); + + virtual unsigned int get_digits() const override; + + virtual ~SalInstanceSpinButton() override; +}; + #endif \ No newline at end of file diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 65eb6083f1db..f104cc505712 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -3030,198 +3030,177 @@ IMPL_LINK_NOARG(SalInstanceCalendar, ActivateHdl, ::Calendar*, void) signal_activated(); } -namespace +WeldTextFilter::WeldTextFilter(Link<OUString&, bool>& rInsertTextHdl) + : TextFilter(OUString()) + , m_rInsertTextHdl(rInsertTextHdl) { - class WeldTextFilter : public TextFilter - { - private: - Link<OUString&, bool>& m_rInsertTextHdl; - public: - WeldTextFilter(Link<OUString&, bool>& rInsertTextHdl) - : TextFilter(OUString()) - , m_rInsertTextHdl(rInsertTextHdl) - { - } +} - virtual OUString filter(const OUString &rText) override - { - if (!m_rInsertTextHdl.IsSet()) - return rText; - OUString sText(rText); - const bool bContinue = m_rInsertTextHdl.Call(sText); - if (!bContinue) - return OUString(); - return sText; - } - }; +OUString WeldTextFilter::filter(const OUString &rText) +{ + if (!m_rInsertTextHdl.IsSet()) + return rText; + OUString sText(rText); + const bool bContinue = m_rInsertTextHdl.Call(sText); + if (!bContinue) + return OUString(); + return sText; } -class SalInstanceEntry : public SalInstanceWidget, public virtual weld::Entry +SalInstanceEntry::SalInstanceEntry(Edit* pEntry, SalInstanceBuilder* pBuilder, bool bTakeOwnership) + : SalInstanceWidget(pEntry, pBuilder, bTakeOwnership) + , m_xEntry(pEntry) + , m_aTextFilter(m_aInsertTextHdl) { -private: - VclPtr<Edit> m_xEntry; + m_xEntry->SetModifyHdl(LINK(this, SalInstanceEntry, ChangeHdl)); + m_xEntry->SetActivateHdl(LINK(this, SalInstanceEntry, ActivateHdl)); + m_xEntry->SetTextFilter(&m_aTextFilter); +} - DECL_LINK(ChangeHdl, Edit&, void); - DECL_LINK(CursorListener, VclWindowEvent&, void); - DECL_LINK(ActivateHdl, Edit&, bool); +void SalInstanceEntry::set_text(const OUString& rText) +{ + disable_notify_events(); + m_xEntry->SetText(rText); + enable_notify_events(); +} - WeldTextFilter m_aTextFilter; -public: - SalInstanceEntry(Edit* pEntry, SalInstanceBuilder* pBuilder, bool bTakeOwnership) - : SalInstanceWidget(pEntry, pBuilder, bTakeOwnership) - , m_xEntry(pEntry) - , m_aTextFilter(m_aInsertTextHdl) - { - m_xEntry->SetModifyHdl(LINK(this, SalInstanceEntry, ChangeHdl)); - m_xEntry->SetActivateHdl(LINK(this, SalInstanceEntry, ActivateHdl)); - m_xEntry->SetTextFilter(&m_aTextFilter); - } +OUString SalInstanceEntry::get_text() const +{ + return m_xEntry->GetText(); +} - virtual void set_text(const OUString& rText) override - { - disable_notify_events(); - m_xEntry->SetText(rText); - enable_notify_events(); - } +void SalInstanceEntry::set_width_chars(int nChars) +{ + m_xEntry->SetWidthInChars(nChars); +} - virtual OUString get_text() const override - { - return m_xEntry->GetText(); - } +int SalInstanceEntry::get_width_chars() const +{ + return m_xEntry->GetWidthInChars(); +} - virtual void set_width_chars(int nChars) override - { - m_xEntry->SetWidthInChars(nChars); - } +void SalInstanceEntry::set_max_length(int nChars) +{ + m_xEntry->SetMaxTextLen(nChars); +} - virtual int get_width_chars() const override - { - return m_xEntry->GetWidthInChars(); - } +void SalInstanceEntry::select_region(int nStartPos, int nEndPos) +{ + disable_notify_events(); + m_xEntry->SetSelection(Selection(nStartPos, nEndPos < 0 ? SELECTION_MAX : nEndPos)); + enable_notify_events(); +} - virtual void set_max_length(int nChars) override - { - m_xEntry->SetMaxTextLen(nChars); - } +bool SalInstanceEntry::get_selection_bounds(int& rStartPos, int &rEndPos) +{ + const Selection& rSelection = m_xEntry->GetSelection(); + rStartPos = rSelection.Min(); + rEndPos = rSelection.Max(); + return rSelection.Len(); +} - virtual void select_region(int nStartPos, int nEndPos) override - { - disable_notify_events(); - m_xEntry->SetSelection(Selection(nStartPos, nEndPos < 0 ? SELECTION_MAX : nEndPos)); - enable_notify_events(); - } +void SalInstanceEntry::replace_selection(const OUString& rText) +{ + m_xEntry->ReplaceSelected(rText); +} - bool get_selection_bounds(int& rStartPos, int &rEndPos) override - { - const Selection& rSelection = m_xEntry->GetSelection(); - rStartPos = rSelection.Min(); - rEndPos = rSelection.Max(); - return rSelection.Len(); - } +void SalInstanceEntry::set_position(int nCursorPos) +{ + disable_notify_events(); + if (nCursorPos < 0) + m_xEntry->SetCursorAtLast(); + else + m_xEntry->SetSelection(Selection(nCursorPos, nCursorPos)); + enable_notify_events(); +} - virtual void replace_selection(const OUString& rText) override - { - m_xEntry->ReplaceSelected(rText); - } +int SalInstanceEntry::get_position() const +{ + return m_xEntry->GetSelection().Max(); +} - virtual void set_position(int nCursorPos) override - { - disable_notify_events(); - if (nCursorPos < 0) - m_xEntry->SetCursorAtLast(); - else - m_xEntry->SetSelection(Selection(nCursorPos, nCursorPos)); - enable_notify_events(); - } +void SalInstanceEntry::set_editable(bool bEditable) +{ + m_xEntry->SetReadOnly(!bEditable); +} - virtual int get_position() const override - { - return m_xEntry->GetSelection().Max(); - } +bool SalInstanceEntry::get_editable() const +{ + return !m_xEntry->IsReadOnly(); +} - virtual void set_editable(bool bEditable) override +void SalInstanceEntry::set_message_type(weld::EntryMessageType eType) +{ + if (eType == weld::EntryMessageType::Error) { - m_xEntry->SetReadOnly(!bEditable); + // tdf#114603: enable setting the background to a different color; + // relevant for GTK; see also #i75179# + m_xEntry->SetForceControlBackground(true); + m_xEntry->SetControlForeground(COL_WHITE); + m_xEntry->SetControlBackground(0xff6563); } - - virtual bool get_editable() const override + else if (eType == weld::EntryMessageType::Warning) { - return !m_xEntry->IsReadOnly(); + // tdf#114603: enable setting the background to a different color; + // relevant for GTK; see also #i75179# + m_xEntry->SetForceControlBackground(true); + m_xEntry->SetControlForeground(); + m_xEntry->SetControlBackground(COL_YELLOW); } - - virtual void set_message_type(weld::EntryMessageType eType) override + else { - if (eType == weld::EntryMessageType::Error) - { - // tdf#114603: enable setting the background to a different color; - // relevant for GTK; see also #i75179# - m_xEntry->SetForceControlBackground(true); - m_xEntry->SetControlForeground(COL_WHITE); - m_xEntry->SetControlBackground(0xff6563); - } - else if (eType == weld::EntryMessageType::Warning) - { - // tdf#114603: enable setting the background to a different color; - // relevant for GTK; see also #i75179# - m_xEntry->SetForceControlBackground(true); - m_xEntry->SetControlForeground(); - m_xEntry->SetControlBackground(COL_YELLOW); - } - else - { - m_xEntry->SetForceControlBackground(false); - m_xEntry->SetControlForeground(); - m_xEntry->SetControlBackground(); - } + m_xEntry->SetForceControlBackground(false); + m_xEntry->SetControlForeground(); + m_xEntry->SetControlBackground(); } +} - virtual void set_font(const vcl::Font& rFont) override - { - m_xEntry->SetPointFont(*m_xEntry, rFont); - m_xEntry->Invalidate(); - } +void SalInstanceEntry::set_font(const vcl::Font& rFont) +{ + m_xEntry->SetPointFont(*m_xEntry, rFont); + m_xEntry->Invalidate(); +} - virtual void connect_cursor_position(const Link<Entry&, void>& rLink) override - { - assert(!m_aCursorPositionHdl.IsSet()); - m_xEntry->AddEventListener(LINK(this, SalInstanceEntry, CursorListener)); - weld::Entry::connect_cursor_position(rLink); - } +void SalInstanceEntry::connect_cursor_position(const Link<Entry&, void>& rLink) +{ + assert(!m_aCursorPositionHdl.IsSet()); + m_xEntry->AddEventListener(LINK(this, SalInstanceEntry, CursorListener)); + weld::Entry::connect_cursor_position(rLink); +} - Edit& getEntry() - { - return *m_xEntry; - } +Edit& SalInstanceEntry::getEntry() +{ + return *m_xEntry; +} - void fire_signal_changed() - { - signal_changed(); - } +void SalInstanceEntry::fire_signal_changed() +{ + signal_changed(); +} - virtual void cut_clipboard() override - { - m_xEntry->Cut(); - } +void SalInstanceEntry::cut_clipboard() +{ + m_xEntry->Cut(); +} - virtual void copy_clipboard() override - { - m_xEntry->Copy(); - } +void SalInstanceEntry::copy_clipboard() +{ + m_xEntry->Copy(); +} - virtual void paste_clipboard() override - { - m_xEntry->Paste(); - } +void SalInstanceEntry::paste_clipboard() +{ + m_xEntry->Paste(); +} - virtual ~SalInstanceEntry() override - { - if (m_aCursorPositionHdl.IsSet()) - m_xEntry->RemoveEventListener(LINK(this, SalInstanceEntry, CursorListener)); - m_xEntry->SetTextFilter(nullptr); - m_xEntry->SetActivateHdl(Link<Edit&, bool>()); - m_xEntry->SetModifyHdl(Link<Edit&, void>()); - } -}; +SalInstanceEntry::~SalInstanceEntry() +{ + if (m_aCursorPositionHdl.IsSet()) + m_xEntry->RemoveEventListener(LINK(this, SalInstanceEntry, CursorListener)); + m_xEntry->SetTextFilter(nullptr); + m_xEntry->SetActivateHdl(Link<Edit&, bool>()); + m_xEntry->SetModifyHdl(Link<Edit&, void>()); +} IMPL_LINK_NOARG(SalInstanceEntry, ChangeHdl, Edit&, void) { @@ -4893,112 +4872,99 @@ IMPL_LINK_NOARG(SalInstanceIconView, DoubleClickHdl, SvTreeListBox*, bool) return !signal_item_activated(); } -class SalInstanceSpinButton : public SalInstanceEntry, public virtual weld::SpinButton +double SalInstanceSpinButton::toField(int nValue) const { -private: - VclPtr<FormattedField> m_xButton; - - DECL_LINK(UpDownHdl, SpinField&, void); - DECL_LINK(LoseFocusHdl, Control&, void); - DECL_LINK(OutputHdl, Edit&, bool); - DECL_LINK(InputHdl, sal_Int64*, TriState); - DECL_LINK(ActivateHdl, Edit&, bool); - - double toField(int nValue) const - { - return static_cast<double>(nValue) / Power10(get_digits()); - } + return static_cast<double>(nValue) / Power10(get_digits()); +} - int fromField(double fValue) const - { - return FRound(fValue * Power10(get_digits())); - } +int SalInstanceSpinButton::fromField(double fValue) const +{ + return FRound(fValue * Power10(get_digits())); +} -public: - SalInstanceSpinButton(FormattedField* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership) - : SalInstanceEntry(pButton, pBuilder, bTakeOwnership) - , m_xButton(pButton) - { - m_xButton->SetThousandsSep(false); //off by default, MetricSpinButton enables it - m_xButton->SetUpHdl(LINK(this, SalInstanceSpinButton, UpDownHdl)); - m_xButton->SetDownHdl(LINK(this, SalInstanceSpinButton, UpDownHdl)); - m_xButton->SetLoseFocusHdl(LINK(this, SalInstanceSpinButton, LoseFocusHdl)); - m_xButton->SetOutputHdl(LINK(this, SalInstanceSpinButton, OutputHdl)); - m_xButton->SetInputHdl(LINK(this, SalInstanceSpinButton, InputHdl)); - if (Edit* pEdit = m_xButton->GetSubEdit()) - pEdit->SetActivateHdl(LINK(this, SalInstanceSpinButton, ActivateHdl)); - else - m_xButton->SetActivateHdl(LINK(this, SalInstanceSpinButton, ActivateHdl)); - } +SalInstanceSpinButton::SalInstanceSpinButton(FormattedField* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership) + : SalInstanceEntry(pButton, pBuilder, bTakeOwnership) + , m_xButton(pButton) +{ + m_xButton->SetThousandsSep(false); //off by default, MetricSpinButton enables it + m_xButton->SetUpHdl(LINK(this, SalInstanceSpinButton, UpDownHdl)); + m_xButton->SetDownHdl(LINK(this, SalInstanceSpinButton, UpDownHdl)); + m_xButton->SetLoseFocusHdl(LINK(this, SalInstanceSpinButton, LoseFocusHdl)); + m_xButton->SetOutputHdl(LINK(this, SalInstanceSpinButton, OutputHdl)); + m_xButton->SetInputHdl(LINK(this, SalInstanceSpinButton, InputHdl)); + if (Edit* pEdit = m_xButton->GetSubEdit()) + pEdit->SetActivateHdl(LINK(this, SalInstanceSpinButton, ActivateHdl)); + else + m_xButton->SetActivateHdl(LINK(this, SalInstanceSpinButton, ActivateHdl)); +} - virtual int get_value() const override - { - return fromField(m_xButton->GetValue()); - } +int SalInstanceSpinButton::get_value() const +{ + return fromField(m_xButton->GetValue()); +} - virtual void set_value(int value) override - { - m_xButton->SetValue(toField(value)); - } +void SalInstanceSpinButton::set_value(int value) +{ + m_xButton->SetValue(toField(value)); +} - virtual void set_range(int min, int max) override - { - m_xButton->SetMinValue(toField(min)); - m_xButton->SetMaxValue(toField(max)); - } +void SalInstanceSpinButton::set_range(int min, int max) +{ + m_xButton->SetMinValue(toField(min)); + m_xButton->SetMaxValue(toField(max)); +} - virtual void get_range(int& min, int& max) const override - { - min = fromField(m_xButton->GetMinValue()); - max = fromField(m_xButton->GetMaxValue()); - } +void SalInstanceSpinButton::get_range(int& min, int& max) const +{ + min = fromField(m_xButton->GetMinValue()); + max = fromField(m_xButton->GetMaxValue()); +} - virtual void set_increments(int step, int /*page*/) override - { - m_xButton->SetSpinSize(toField(step)); - } +void SalInstanceSpinButton::set_increments(int step, int /*page*/) +{ + m_xButton->SetSpinSize(toField(step)); +} - virtual void get_increments(int& step, int& page) const override - { - step = fromField(m_xButton->GetSpinSize()); - page = fromField(m_xButton->GetSpinSize()); - } +void SalInstanceSpinButton::get_increments(int& step, int& page) const +{ + step = fromField(m_xButton->GetSpinSize()); + page = fromField(m_xButton->GetSpinSize()); +} - virtual void set_digits(unsigned int digits) override - { - m_xButton->SetDecimalDigits(digits); - } +void SalInstanceSpinButton::set_digits(unsigned int digits) +{ + m_xButton->SetDecimalDigits(digits); +} - //so with hh::mm::ss, incrementing mm will not reset ss - void DisableRemainderFactor() - { - m_xButton->DisableRemainderFactor(); - } +//so with hh::mm::ss, incrementing mm will not reset ss +void SalInstanceSpinButton::DisableRemainderFactor() +{ + m_xButton->DisableRemainderFactor(); +} - //off by default for direct SpinButtons, MetricSpinButton enables it - void SetUseThousandSep() - { - m_xButton->SetThousandsSep(true); - } +//off by default for direct SpinButtons, MetricSpinButton enables it +void SalInstanceSpinButton::SetUseThousandSep() +{ + m_xButton->SetThousandsSep(true); +} - virtual unsigned int get_digits() const override - { - return m_xButton->GetDecimalDigits(); - } +unsigned int SalInstanceSpinButton::get_digits() const +{ + return m_xButton->GetDecimalDigits(); +} - virtual ~SalInstanceSpinButton() override - { - if (Edit* pEdit = m_xButton->GetSubEdit()) - pEdit->SetActivateHdl(Link<Edit&, bool>()); - else - m_xButton->SetActivateHdl(Link<Edit&, bool>()); - m_xButton->SetInputHdl(Link<sal_Int64*, TriState>()); - m_xButton->SetOutputHdl(Link<Edit&, bool>()); - m_xButton->SetLoseFocusHdl(Link<Control&, void>()); - m_xButton->SetDownHdl(Link<SpinField&, void>()); - m_xButton->SetUpHdl(Link<SpinField&, void>()); - } -}; +SalInstanceSpinButton::~SalInstanceSpinButton() +{ + if (Edit* pEdit = m_xButton->GetSubEdit()) + pEdit->SetActivateHdl(Link<Edit&, bool>()); + else + m_xButton->SetActivateHdl(Link<Edit&, bool>()); + m_xButton->SetInputHdl(Link<sal_Int64*, TriState>()); + m_xButton->SetOutputHdl(Link<Edit&, bool>()); + m_xButton->SetLoseFocusHdl(Link<Control&, void>()); + m_xButton->SetDownHdl(Link<SpinField&, void>()); + m_xButton->SetUpHdl(Link<SpinField&, void>()); +} IMPL_LINK_NOARG(SalInstanceSpinButton, ActivateHdl, Edit&, bool) { commit 88451e6be4e21913c2c9875ba74d80fbc393b292 Author: Szymon Kłos <[email protected]> AuthorDate: Wed Feb 19 13:32:14 2020 +0100 Commit: Szymon Kłos <[email protected]> CommitDate: Thu May 14 14:38:06 2020 +0200 Create header file for SalInstanceBuilder Move more declarations for SalInstance to header file b7240ffd003e202be04b462209cfb2abafcc18ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89102 Tested-by: Szymon Kłos <[email protected]> Reviewed-by: Szymon Kłos <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93480 Tested-by: Jenkins CollaboraOffice <[email protected]> Change-Id: If8d7578d9a5926cdf565efbf0bc12719e5ef6fc2 diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx new file mode 100644 index 000000000000..c25c163c6561 --- /dev/null +++ b/vcl/inc/salvtables.hxx @@ -0,0 +1,494 @@ +#ifndef INCLUDED_VCL_INC_SALVTABLES_HXX +#define INCLUDED_VCL_INC_SALVTABLES_HXX + +#include <vcl/weld.hxx> +#include <vcl/svapp.hxx> +#include <vcl/syswin.hxx> +#include <vcl/settings.hxx> +#include <vcl/virdev.hxx> +#include <vcl/ctrl.hxx> + +class SalInstanceBuilder : public weld::Builder +{ +private: + std::unique_ptr<VclBuilder> m_xBuilder; + VclPtr<vcl::Window> m_aOwnedToplevel; + +public: + SalInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile); + + VclBuilder& get_builder() const; + + virtual std::unique_ptr<weld::MessageDialog> + weld_message_dialog(const OString& id, bool bTakeOwnership = true) override; + + virtual std::unique_ptr<weld::AboutDialog> + weld_about_dialog(const OString& id, bool bTakeOwnership = true) override; + + virtual std::unique_ptr<weld::Dialog> weld_dialog(const OString& id, + bool bTakeOwnership = true) override; + + virtual std::unique_ptr<weld::Assistant> weld_assistant(const OString& id, + bool bTakeOwnership = true) override; + + virtual std::unique_ptr<weld::Window> create_screenshot_window() override; + + virtual std::unique_ptr<weld::Window> weld_window(const OString& id, + bool bTakeOwnership = true) override; + + virtual std::unique_ptr<weld::Widget> weld_widget(const OString& id, + bool bTakeOwnership = true) override; + + virtual std::unique_ptr<weld::Container> weld_container(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::Box> weld_box(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::Frame> weld_frame(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::ScrolledWindow> + weld_scrolled_window(const OString& id, bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::Notebook> weld_notebook(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::Button> weld_button(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::MenuButton> + weld_menu_button(const OString& id, bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::LinkButton> + weld_link_button(const OString& id, bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::ToggleButton> + weld_toggle_button(const OString& id, bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::RadioButton> + weld_radio_button(const OString& id, bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::CheckButton> + weld_check_button(const OString& id, bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::Scale> weld_scale(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::ProgressBar> + weld_progress_bar(const OString& id, bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::Spinner> weld_spinner(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::Image> weld_image(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::Calendar> weld_calendar(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::Entry> weld_entry(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::SpinButton> + weld_spin_button(const OString& id, bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::MetricSpinButton> + weld_metric_spin_button(const OString& id, FieldUnit eUnit, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::FormattedSpinButton> + weld_formatted_spin_button(const OString& id, bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::TimeSpinButton> + weld_time_spin_button(const OString& id, TimeFieldFormat eFormat, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::ComboBox> weld_combo_box(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::EntryTreeView> + weld_entry_tree_view(const OString& containerid, const OString& entryid, + const OString& treeviewid, bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::TreeView> weld_tree_view(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::IconView> weld_icon_view(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::Label> weld_label(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::TextView> weld_text_view(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::Expander> weld_expander(const OString& id, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::DrawingArea> + weld_drawing_area(const OString& id, const a11yref& rA11yImpl, + FactoryFunction pUITestFactoryFunction, void* pUserData, + bool bTakeOwnership = false) override; + + virtual std::unique_ptr<weld::Menu> weld_menu(const OString& id, + bool bTakeOwnership = true) override; + + virtual std::unique_ptr<weld::Toolbar> weld_toolbar(const OString& id, + bool bTakeOwnership = true) override; + + virtual std::unique_ptr<weld::SizeGroup> create_size_group() override; + + OString get_current_page_help_id() const; + + virtual ~SalInstanceBuilder() override; +}; + +class SalInstanceWidget : public virtual weld::Widget +{ +protected: + VclPtr<vcl::Window> m_xWidget; + SalInstanceBuilder* m_pBuilder; + +private: + DECL_LINK(EventListener, VclWindowEvent&, void); + DECL_LINK(KeyEventListener, VclWindowEvent&, bool); + DECL_LINK(MouseEventListener, VclSimpleEvent&, void); + DECL_LINK(MnemonicActivateHdl, vcl::Window&, bool); + + const bool m_bTakeOwnership; + bool m_bEventListener; + bool m_bKeyEventListener; + bool m_bMouseEventListener; + int m_nBlockNotify; + +protected: + void ensure_event_listener(); + + // we want the ability to mark key events as handled, so use this variant + // for those, we get all keystrokes in this case, so we will need to filter + // them later + void ensure_key_listener(); + + // we want the ability to know about mouse events that happen in our children + // so use this variant, we will need to filter them later + void ensure_mouse_listener(); + + virtual void HandleEventListener(VclWindowEvent& rEvent); + virtual bool HandleKeyEventListener(VclWindowEvent& rEvent); + virtual void HandleMouseEventListener(VclSimpleEvent& rEvent); + + void set_background(const Color& rColor); + +public: + SalInstanceWidget(vcl::Window* pWidget, SalInstanceBuilder* pBuilder, bool bTakeOwnership); + + virtual void set_sensitive(bool sensitive) override; + + virtual bool get_sensitive() const override; + + virtual bool get_visible() const override; + + virtual bool is_visible() const override; + + virtual void set_can_focus(bool bCanFocus) override; + + virtual void grab_focus() override; + + virtual bool has_focus() const override; + + virtual bool is_active() const override; + + virtual void set_has_default(bool has_default) override; + + virtual bool get_has_default() const override; + + virtual void show() override; + + virtual void hide() override; + + virtual void set_size_request(int nWidth, int nHeight) override; + + virtual Size get_size_request() const override; + + virtual Size get_preferred_size() const override; + + virtual float get_approximate_digit_width() const override; + + virtual int get_text_height() const override; + + virtual Size get_pixel_size(const OUString& rText) const override; + + virtual vcl::Font get_font() override; + + virtual OString get_buildable_name() const override; + + virtual void set_help_id(const OString& rId) override; + + virtual OString get_help_id() const override; + + virtual void set_grid_left_attach(int nAttach) override; + + virtual int get_grid_left_attach() const override; + + virtual void set_grid_width(int nCols) override; + + virtual void set_grid_top_attach(int nAttach) override; + + virtual int get_grid_top_attach() const override; + + virtual void set_hexpand(bool bExpand) override; + + virtual bool get_hexpand() const override; + + virtual void set_vexpand(bool bExpand) override; + + virtual bool get_vexpand() const override; + + virtual void set_secondary(bool bSecondary) override; + + virtual void set_margin_top(int nMargin) override; + + virtual void set_margin_bottom(int nMargin) override; + + virtual void set_margin_left(int nMargin) override; + + virtual void set_margin_right(int nMargin) override; + + virtual int get_margin_top() const override; + + virtual int get_margin_bottom() const override; + + virtual int get_margin_left() const override; + + virtual int get_margin_right() const override; + + virtual void set_accessible_name(const OUString& rName) override; + + virtual OUString get_accessible_name() const override; + + virtual OUString get_accessible_description() const override; + + virtual void set_accessible_relation_labeled_by(weld::Widget* pLabel) override; + + virtual void set_accessible_relation_label_for(weld::Widget* pLabeled) override; + + virtual void + add_extra_accessible_relation(const css::accessibility::AccessibleRelation& rRelation) override; + + virtual void clear_extra_accessible_relations() override; + + virtual void set_tooltip_text(const OUString& rTip) override; + + virtual OUString get_tooltip_text() const override; + + virtual void connect_focus_in(const Link<Widget&, void>& rLink) override; + + virtual void connect_mnemonic_activate(const Link<Widget&, bool>& rLink) override; + + virtual void connect_focus_out(const Link<Widget&, void>& rLink) override; + + virtual void connect_size_allocate(const Link<const Size&, void>& rLink) override; + + virtual void connect_mouse_press(const Link<const MouseEvent&, bool>& rLink) override; + + virtual void connect_mouse_move(const Link<const MouseEvent&, bool>& rLink) override; + + virtual void connect_mouse_release(const Link<const MouseEvent&, bool>& rLink) override; + + virtual void connect_key_press(const Link<const KeyEvent&, bool>& rLink) override; + + virtual void connect_key_release(const Link<const KeyEvent&, bool>& rLink) override; + + virtual bool get_extents_relative_to(Widget& rRelative, int& x, int& y, int& width, + int& height) override; + + virtual void grab_add() override; + + virtual bool has_grab() const override; + + virtual void grab_remove() override; + + virtual bool get_direction() const override; + + virtual void set_direction(bool bRTL) override; + + virtual void freeze() override; + + virtual void thaw() override; + + virtual std::unique_ptr<weld::Container> weld_parent() const override; + + virtual ~SalInstanceWidget() override; + + vcl::Window* getWidget(); + + void disable_notify_events(); + + bool notify_events_disabled(); + + void enable_notify_events(); + + virtual void help_hierarchy_foreach(const std::function<bool(const OString&)>& func) override; + + virtual OUString strip_mnemonic(const OUString& rLabel) const override; + + virtual VclPtr<VirtualDevice> create_virtual_device() const override; + + virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() override; + + virtual void set_stack_background() override; + + virtual void set_highlight_background() override; + + SystemWindow* getSystemWindow(); +}; + +class SalInstanceLabel : public SalInstanceWidget, public virtual weld::Label +{ +private: + // Control instead of FixedText so we can also use this for + // SelectableFixedText which is derived from Edit. We just typically need + // [G|S]etText which exists in their shared baseclass + VclPtr<Control> m_xLabel; + +public: + SalInstanceLabel(Control* pLabel, SalInstanceBuilder* pBuilder, bool bTakeOwnership); + + virtual void set_label(const OUString& rText) override; + + virtual OUString get_label() const override; + + virtual void set_mnemonic_widget(Widget* pTarget) override; + + virtual void set_message_type(weld::EntryMessageType eType) override; + + virtual void set_font(const vcl::Font& rFont) override; +}; + +class SalInstanceContainer : public SalInstanceWidget, public virtual weld::Container +{ +protected: + VclPtr<vcl::Window> m_xContainer; + +private: + void implResetDefault(const vcl::Window* _pWindow); + +public: + SalInstanceContainer(vcl::Window* pContainer, SalInstanceBuilder* pBuilder, + bool bTakeOwnership); + virtual void move(weld::Widget* pWidget, weld::Container* pNewParent) override; + virtual void recursively_unset_default_buttons() override; + virtual css::uno::Reference<css::awt::XWindow> CreateChildFrame() override; +}; + +class SalInstanceWindow : public SalInstanceContainer, public virtual weld::Window +{ +private: + VclPtr<vcl::Window> m_xWindow; + + DECL_LINK(HelpHdl, vcl::Window&, bool); + + void override_child_help(vcl::Window* pParent); + + void clear_child_help(vcl::Window* pParent); + +public: + SalInstanceWindow(vcl::Window* pWindow, SalInstanceBuilder* pBuilder, bool bTakeOwnership); + + virtual void set_title(const OUString& rTitle) override; + + virtual OUString get_title() const override; + + void help(); + + virtual void set_busy_cursor(bool bBusy) override; + + virtual css::uno::Reference<css::awt::XWindow> GetXWindow() override; + + virtual void resize_to_request() override; + + virtual void set_modal(bool bModal) override; + + virtual bool get_modal() const override; + + virtual void window_move(int x, int y) override; + + virtual Size get_size() const override; + + virtual Point get_position() const override; + + virtual tools::Rectangle get_monitor_workarea() const override; + + virtual void set_centered_on_parent(bool /*bTrackGeometryRequests*/) override; + + virtual bool get_resizable() const override; + + virtual bool has_toplevel_focus() const override; + + virtual void present() override; + + virtual void set_window_state(const OString& rStr) override; + + virtual OString get_window_state(WindowStateMask nMask) const override; + + virtual SystemEnvData get_system_data() const override; + + virtual void connect_toplevel_focus_changed(const Link<weld::Widget&, void>& rLink) override; + + virtual void HandleEventListener(VclWindowEvent& rEvent) override; + + virtual void draw(VirtualDevice& rOutput) override; + + virtual weld::ScreenShotCollection collect_screenshot_data() override; + + virtual ~SalInstanceWindow() override; +}; + +class SalInstanceDialog : public SalInstanceWindow, public virtual weld::Dialog +{ +private: + VclPtr<::Dialog> m_xDialog; + + // for calc ref dialog that shrink to range selection widgets and resize back + VclPtr<vcl::Window> m_xRefEdit; + std::vector<VclPtr<vcl::Window>> m_aHiddenWidgets; // vector of hidden Controls + long m_nOldEditWidthReq; // Original width request of the input field + sal_Int32 m_nOldBorderWidth; // border width for expanded dialog + + DECL_LINK(PopupScreenShotMenuHdl, const CommandEvent&, bool); + +public: + SalInstanceDialog(::Dialog* pDialog, SalInstanceBuilder* pBuilder, bool bTakeOwnership); + + virtual bool runAsync(std::shared_ptr<weld::DialogController> aOwner, + const std::function<void(sal_Int32)>& rEndDialogFn) override; + + virtual bool runAsync(std::shared_ptr<Dialog> const& rxSelf, + const std::function<void(sal_Int32)>& rEndDialogFn) override; + + virtual void collapse(weld::Widget* pEdit, weld::Widget* pButton) override; + + virtual void undo_collapse() override; + + virtual void + SetInstallLOKNotifierHdl(const Link<void*, vcl::ILibreOfficeKitNotifier*>& rLink) override; + + virtual int run() override; + + virtual void response(int nResponse) override; + + virtual void add_button(const OUString& rText, int nResponse, const OString& rHelpId) override; + + virtual void set_modal(bool bModal) override; + + virtual bool get_modal() const override; + + virtual weld::Button* weld_widget_for_response(int nResponse) override; + + virtual void set_default_response(int nResponse) override; + + virtual Container* weld_content_area() override; +}; + +#endif \ No newline at end of file diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index d9d25ee5494f..65eb6083f1db 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -71,6 +71,7 @@ #include <aboutdialog.hxx> #include <bitmaps.hlst> #include <wizdlg.hxx> +#include <salvtables.hxx> SalFrame::SalFrame() : m_pWindow(nullptr) @@ -233,507 +234,476 @@ SalMenuItem::~SalMenuItem() { } -class SalInstanceBuilder; - -class SalInstanceWidget : public virtual weld::Widget +void SalInstanceWidget::ensure_event_listener() { -protected: - VclPtr<vcl::Window> m_xWidget; - SalInstanceBuilder* m_pBuilder; - -private: - DECL_LINK(EventListener, VclWindowEvent&, void); - DECL_LINK(KeyEventListener, VclWindowEvent&, bool); - DECL_LINK(MouseEventListener, VclSimpleEvent&, void); - DECL_LINK(MnemonicActivateHdl, vcl::Window&, bool); - - const bool m_bTakeOwnership; - bool m_bEventListener; - bool m_bKeyEventListener; - bool m_bMouseEventListener; - int m_nBlockNotify; - -protected: - void ensure_event_listener() + if (!m_bEventListener) { - if (!m_bEventListener) - { - m_xWidget->AddEventListener(LINK(this, SalInstanceWidget, EventListener)); - m_bEventListener = true; - } - } - - // we want the ability to mark key events as handled, so use this variant - // for those, we get all keystrokes in this case, so we will need to filter - // them later - void ensure_key_listener() - { - if (!m_bKeyEventListener) - { - Application::AddKeyListener(LINK(this, SalInstanceWidget, KeyEventListener)); - m_bKeyEventListener = true; - } - } - - // we want the ability to know about mouse events that happen in our children - // so use this variant, we will need to filter them later - void ensure_mouse_listener() - { - if (!m_bMouseEventListener) - { - Application::AddEventListener(LINK(this, SalInstanceWidget, MouseEventListener)); - m_bMouseEventListener = true; - } + m_xWidget->AddEventListener(LINK(this, SalInstanceWidget, EventListener)); + m_bEventListener = true; } +} - virtual void HandleEventListener(VclWindowEvent& rEvent); - virtual bool HandleKeyEventListener(VclWindowEvent& rEvent); - virtual void HandleMouseEventListener(VclSimpleEvent& rEvent); - - void set_background(const Color& rColor) +// we want the ability to mark key events as handled, so use this variant +// for those, we get all keystrokes in this case, so we will need to filter +// them later +void SalInstanceWidget::ensure_key_listener() +{ + if (!m_bKeyEventListener) { - m_xWidget->SetControlBackground(rColor); - m_xWidget->SetBackground(m_xWidget->GetControlBackground()); - // turn off WB_CLIPCHILDREN otherwise the bg won't extend "under" - // transparent children of the widget - m_xWidget->SetStyle(m_xWidget->GetStyle() & ~WB_CLIPCHILDREN); + Application::AddKeyListener(LINK(this, SalInstanceWidget, KeyEventListener)); + m_bKeyEventListener = true; } +} -public: - SalInstanceWidget(vcl::Window* pWidget, SalInstanceBuilder* pBuilder, bool bTakeOwnership) - : m_xWidget(pWidget) - , m_pBuilder(pBuilder) - , m_bTakeOwnership(bTakeOwnership) - , m_bEventListener(false) - , m_bKeyEventListener(false) - , m_bMouseEventListener(false) - , m_nBlockNotify(0) +// we want the ability to know about mouse events that happen in our children +// so use this variant, we will need to filter them later +void SalInstanceWidget::ensure_mouse_listener() +{ + if (!m_bMouseEventListener) { + Application::AddEventListener(LINK(this, SalInstanceWidget, MouseEventListener)); + m_bMouseEventListener = true; } +} - virtual void set_sensitive(bool sensitive) override - { - m_xWidget->Enable(sensitive); - } +void SalInstanceWidget::set_background(const Color& rColor) +{ + m_xWidget->SetControlBackground(rColor); + m_xWidget->SetBackground(m_xWidget->GetControlBackground()); + // turn off WB_CLIPCHILDREN otherwise the bg won't extend "under" + // transparent children of the widget + m_xWidget->SetStyle(m_xWidget->GetStyle() & ~WB_CLIPCHILDREN); +} - virtual bool get_sensitive() const override - { - return m_xWidget->IsEnabled(); - } +SalInstanceWidget::SalInstanceWidget(vcl::Window* pWidget, SalInstanceBuilder* pBuilder, bool bTakeOwnership) + : m_xWidget(pWidget) + , m_pBuilder(pBuilder) + , m_bTakeOwnership(bTakeOwnership) + , m_bEventListener(false) + , m_bKeyEventListener(false) + , m_bMouseEventListener(false) + , m_nBlockNotify(0) +{ +} - virtual bool get_visible() const override - { - return m_xWidget->IsVisible(); - } +void SalInstanceWidget::set_sensitive(bool sensitive) +{ + m_xWidget->Enable(sensitive); +} - virtual bool is_visible() const override - { - return m_xWidget->IsReallyVisible(); - } +bool SalInstanceWidget::get_sensitive() const +{ + return m_xWidget->IsEnabled(); +} - virtual void set_can_focus(bool bCanFocus) override - { - auto nStyle = m_xWidget->GetStyle() & ~(WB_TABSTOP | WB_NOTABSTOP); - if (bCanFocus) - nStyle |= WB_TABSTOP; - else - nStyle |= WB_NOTABSTOP; - m_xWidget->SetStyle(nStyle); - } +bool SalInstanceWidget::get_visible() const +{ + return m_xWidget->IsVisible(); +} - virtual void grab_focus() override - { - m_xWidget->GrabFocus(); - } +bool SalInstanceWidget::is_visible() const +{ + return m_xWidget->IsReallyVisible(); +} - virtual bool has_focus() const override - { - return m_xWidget->HasFocus(); - } +void SalInstanceWidget::set_can_focus(bool bCanFocus) +{ + auto nStyle = m_xWidget->GetStyle() & ~(WB_TABSTOP | WB_NOTABSTOP); + if (bCanFocus) + nStyle |= WB_TABSTOP; + else + nStyle |= WB_NOTABSTOP; + m_xWidget->SetStyle(nStyle); +} - virtual bool is_active() const override - { - return m_xWidget->IsActive(); - } +void SalInstanceWidget::grab_focus() +{ + m_xWidget->GrabFocus(); +} - virtual void set_has_default(bool has_default) override - { - m_xWidget->set_property("has-default", OUString::boolean(has_default)); - } +bool SalInstanceWidget::has_focus() const +{ + return m_xWidget->HasFocus(); +} - virtual bool get_has_default() const override - { - return m_xWidget->GetStyle() & WB_DEFBUTTON; - } +bool SalInstanceWidget::is_active() const +{ + return m_xWidget->IsActive(); +} - virtual void show() override - { - m_xWidget->Show(); - } +void SalInstanceWidget::set_has_default(bool has_default) +{ + m_xWidget->set_property("has-default", OUString::boolean(has_default)); +} - virtual void hide() override - { - m_xWidget->Hide(); - } +bool SalInstanceWidget::get_has_default() const +{ + return m_xWidget->GetStyle() & WB_DEFBUTTON; +} - virtual void set_size_request(int nWidth, int nHeight) override - { - m_xWidget->set_width_request(nWidth); - m_xWidget->set_height_request(nHeight); - } +void SalInstanceWidget::show() +{ + m_xWidget->Show(); +} - virtual Size get_size_request() const override - { - return Size(m_xWidget->get_width_request(), - m_xWidget->get_height_request()); - } +void SalInstanceWidget::hide() +{ + m_xWidget->Hide(); +} - virtual Size get_preferred_size() const override - { - return m_xWidget->get_preferred_size(); - } +void SalInstanceWidget::set_size_request(int nWidth, int nHeight) +{ + m_xWidget->set_width_request(nWidth); + m_xWidget->set_height_request(nHeight); +} - virtual float get_approximate_digit_width() const override - { - return m_xWidget->approximate_digit_width(); - } +Size SalInstanceWidget::get_size_request() const +{ + return Size(m_xWidget->get_width_request(), + m_xWidget->get_height_request()); +} - virtual int get_text_height() const override - { - return m_xWidget->GetTextHeight(); - } +Size SalInstanceWidget::get_preferred_size() const +{ + return m_xWidget->get_preferred_size(); +} - virtual Size get_pixel_size(const OUString& rText) const override - { - //TODO, or do I want GetTextBoundRect ?, just using width at the moment anyway - return Size(m_xWidget->GetTextWidth(rText), m_xWidget->GetTextHeight()); - } +float SalInstanceWidget::get_approximate_digit_width() const +{ + return m_xWidget->approximate_digit_width(); +} - virtual vcl::Font get_font() override - { - return m_xWidget->GetPointFont(*m_xWidget); - } +int SalInstanceWidget::get_text_height() const +{ + return m_xWidget->GetTextHeight(); +} - virtual OString get_buildable_name() const override - { - return m_xWidget->get_id().toUtf8(); - } +Size SalInstanceWidget::get_pixel_size(const OUString& rText) const +{ + //TODO, or do I want GetTextBoundRect ?, just using width at the moment anyway + return Size(m_xWidget->GetTextWidth(rText), m_xWidget->GetTextHeight()); +} - virtual void set_help_id(const OString& rId) override - { - return m_xWidget->SetHelpId(rId); - } +vcl::Font SalInstanceWidget::get_font() +{ + return m_xWidget->GetPointFont(*m_xWidget); +} - virtual OString get_help_id() const override - { - return m_xWidget->GetHelpId(); - } +OString SalInstanceWidget::get_buildable_name() const +{ + return m_xWidget->get_id().toUtf8(); +} - virtual void set_grid_left_attach(int nAttach) override - { - m_xWidget->set_grid_left_attach(nAttach); - } +void SalInstanceWidget::set_help_id(const OString& rId) +{ + return m_xWidget->SetHelpId(rId); +} - virtual int get_grid_left_attach() const override - { - return m_xWidget->get_grid_left_attach(); - } +OString SalInstanceWidget::get_help_id() const +{ + return m_xWidget->GetHelpId(); +} - virtual void set_grid_width(int nCols) override - { - m_xWidget->set_grid_width(nCols); - } +void SalInstanceWidget::set_grid_left_attach(int nAttach) +{ + m_xWidget->set_grid_left_attach(nAttach); +} - virtual void set_grid_top_attach(int nAttach) override - { - m_xWidget->set_grid_top_attach(nAttach); - } +int SalInstanceWidget::get_grid_left_attach() const +{ + return m_xWidget->get_grid_left_attach(); +} - virtual int get_grid_top_attach() const override - { - return m_xWidget->get_grid_top_attach(); - } +void SalInstanceWidget::set_grid_width(int nCols) +{ + m_xWidget->set_grid_width(nCols); +} - virtual void set_hexpand(bool bExpand) override - { - m_xWidget->set_hexpand(bExpand); - } +void SalInstanceWidget::set_grid_top_attach(int nAttach) +{ + m_xWidget->set_grid_top_attach(nAttach); +} - virtual bool get_hexpand() const override - { - return m_xWidget->get_hexpand(); - } +int SalInstanceWidget::get_grid_top_attach() const +{ + return m_xWidget->get_grid_top_attach(); +} - virtual void set_vexpand(bool bExpand) override - { - m_xWidget->set_vexpand(bExpand); - } +void SalInstanceWidget::set_hexpand(bool bExpand) +{ + m_xWidget->set_hexpand(bExpand); +} - virtual bool get_vexpand() const override - { - return m_xWidget->get_vexpand(); - } +bool SalInstanceWidget::get_hexpand() const +{ + return m_xWidget->get_hexpand(); +} - virtual void set_secondary(bool bSecondary) override - { - m_xWidget->set_secondary(bSecondary); - } +void SalInstanceWidget::set_vexpand(bool bExpand) +{ + m_xWidget->set_vexpand(bExpand); +} - virtual void set_margin_top(int nMargin) override - { - m_xWidget->set_margin_top(nMargin); - } +bool SalInstanceWidget::get_vexpand() const +{ + return m_xWidget->get_vexpand(); +} - virtual void set_margin_bottom(int nMargin) override - { - m_xWidget->set_margin_bottom(nMargin); - } +void SalInstanceWidget::set_secondary(bool bSecondary) +{ + m_xWidget->set_secondary(bSecondary); +} - virtual void set_margin_left(int nMargin) override - { - m_xWidget->set_margin_left(nMargin); - } +void SalInstanceWidget::set_margin_top(int nMargin) +{ + m_xWidget->set_margin_top(nMargin); +} - virtual void set_margin_right(int nMargin) override - { - m_xWidget->set_margin_bottom(nMargin); - } +void SalInstanceWidget::set_margin_bottom(int nMargin) +{ + m_xWidget->set_margin_bottom(nMargin); +} - virtual int get_margin_top() const override - { - return m_xWidget->get_margin_top(); - } +void SalInstanceWidget::set_margin_left(int nMargin) +{ + m_xWidget->set_margin_left(nMargin); +} - virtual int get_margin_bottom() const override ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
