summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-06 16:06:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-09-09 15:01:06 +0200
commit854d8c418904bbb9370ca6ee0aad6bde5deb426e (patch)
tree5031d234c155d3b8d67056b30d1b1af994a3c75b /include
parentf2ea65c92330ef0e36725a351f7b39027023f4bf (diff)
weld SfxNewStyleDlg
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 <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/sfx2/newstyle.hxx27
-rw-r--r--include/vcl/weld.hxx31
2 files changed, 42 insertions, 16 deletions
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 <comphelper/string.hxx>
#include <sal/config.h>
#include <sfx2/dllapi.h>
-#include <vcl/button.hxx>
-#include <vcl/layout.hxx>
-#include <vcl/combobox.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/fixed.hxx>
#include <vcl/weld.hxx>
class SfxStyleSheetBasePool;
-class SFX2_DLLPUBLIC SfxNewStyleDlg : public ModalDialog
+class SFX2_DLLPUBLIC SfxNewStyleDlg : public weld::GenericDialogController
{
private:
- VclPtr<ComboBox> m_pColBox;
- VclPtr<OKButton> m_pOKBtn;
+ SfxStyleSheetBasePool& m_rPool;
- std::unique_ptr<weld::MessageDialog> xQueryOverwriteBox;
- SfxStyleSheetBasePool& rPool;
+ std::unique_ptr<weld::EntryTreeView> m_xColBox;
+ std::unique_ptr<weld::Button> m_xOKBtn;
- DECL_DLLPRIVATE_LINK( OKHdl, ComboBox&, void );
- DECL_DLLPRIVATE_LINK( OKClickHdl, Button *, void );
- DECL_DLLPRIVATE_LINK( ModifyHdl, Edit&, void );
+ std::unique_ptr<weld::MessageDialog> 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<Entry&, void> m_aChangeHdl;
+ std::unique_ptr<Entry> m_xEntry;
+ std::unique_ptr<TreeView> m_xTreeView;
+
+public:
+ EntryTreeView(std::unique_ptr<Entry> xEntry, std::unique_ptr<TreeView> 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<TreeView&, void>& rLink)
+ {
+ m_xTreeView->connect_row_activated(rLink);
+ }
+ void connect_changed(const Link<Entry&, void>& 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<EntryTreeView> weld_entry_tree_view(const OString& entryid,
+ const OString& treeviewid,
+ bool bTakeOwnership = false)
+ = 0;
virtual std::unique_ptr<Menu> weld_menu(const OString& id, bool bTakeOwnership = true) = 0;
virtual std::unique_ptr<SizeGroup> create_size_group() = 0;
virtual ~Builder() {}