From 854d8c418904bbb9370ca6ee0aad6bde5deb426e Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 6 Apr 2018 16:06:49 +0100 Subject: weld SfxNewStyleDlg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit set some parents and replace VclComboBoxText with an entry and a treeview Change-Id: Ied75176355f23c986eac4d5de8654472a15dbbbf Reviewed-on: https://gerrit.libreoffice.org/52517 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- include/sfx2/newstyle.hxx | 27 +++++++++++---------------- include/vcl/weld.hxx | 31 +++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 16 deletions(-) (limited to 'include') diff --git a/include/sfx2/newstyle.hxx b/include/sfx2/newstyle.hxx index dceeeec2e7ec..6fecb3378f4d 100644 --- a/include/sfx2/newstyle.hxx +++ b/include/sfx2/newstyle.hxx @@ -22,34 +22,29 @@ #include #include #include -#include -#include -#include -#include -#include #include class SfxStyleSheetBasePool; -class SFX2_DLLPUBLIC SfxNewStyleDlg : public ModalDialog +class SFX2_DLLPUBLIC SfxNewStyleDlg : public weld::GenericDialogController { private: - VclPtr m_pColBox; - VclPtr m_pOKBtn; + SfxStyleSheetBasePool& m_rPool; - std::unique_ptr xQueryOverwriteBox; - SfxStyleSheetBasePool& rPool; + std::unique_ptr m_xColBox; + std::unique_ptr m_xOKBtn; - DECL_DLLPRIVATE_LINK( OKHdl, ComboBox&, void ); - DECL_DLLPRIVATE_LINK( OKClickHdl, Button *, void ); - DECL_DLLPRIVATE_LINK( ModifyHdl, Edit&, void ); + std::unique_ptr m_xQueryOverwriteBox; + + DECL_DLLPRIVATE_LINK(OKHdl, weld::TreeView&, void); + DECL_DLLPRIVATE_LINK(OKClickHdl, weld::Button&, void); + DECL_DLLPRIVATE_LINK(ModifyHdl, weld::Entry&, void); public: - SfxNewStyleDlg( vcl::Window* pParent, SfxStyleSheetBasePool& ); + SfxNewStyleDlg(weld::Window* pParent, SfxStyleSheetBasePool&); virtual ~SfxNewStyleDlg() override; - virtual void dispose() override; - OUString GetName() const { return comphelper::string::stripStart(m_pColBox->GetText(), ' '); } + OUString GetName() const { return comphelper::string::stripStart(m_xColBox->get_text(), ' '); } }; #endif diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 9c0fa76468b8..6f6776f38b57 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -901,6 +901,33 @@ public: virtual Point get_accessible_location() = 0; }; +// an entry + treeview pair, where the entry autocompletes from the +// treeview list, and selecting something in the list sets the +// entry to that text +class VCL_DLLPUBLIC EntryTreeView +{ +private: + DECL_DLLPRIVATE_LINK(ClickHdl, weld::TreeView&, void); + DECL_DLLPRIVATE_LINK(ModifyHdl, weld::Entry&, void); + void EntryModifyHdl(weld::Entry& rEntry); + +protected: + Link m_aChangeHdl; + std::unique_ptr m_xEntry; + std::unique_ptr m_xTreeView; + +public: + EntryTreeView(std::unique_ptr xEntry, std::unique_ptr xTreeView); + OUString get_text() const { return m_xEntry->get_text(); } + void append_text(const OUString& rText) { m_xTreeView->append_text(rText); } + void connect_row_activated(const Link& rLink) + { + m_xTreeView->connect_row_activated(rLink); + } + void connect_changed(const Link& rLink) { m_aChangeHdl = rLink; } + void set_size_request_by_digits_rows(int nDigits, int nRows); +}; + class VCL_DLLPUBLIC Menu { public: @@ -992,6 +1019,10 @@ public: FactoryFunction pUITestFactoryFunction = nullptr, void* pUserData = nullptr, bool bTakeOwnership = false) = 0; + virtual std::unique_ptr weld_entry_tree_view(const OString& entryid, + const OString& treeviewid, + bool bTakeOwnership = false) + = 0; virtual std::unique_ptr weld_menu(const OString& id, bool bTakeOwnership = true) = 0; virtual std::unique_ptr create_size_group() = 0; virtual ~Builder() {} -- cgit