diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-01-21 11:39:19 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-01-21 13:55:46 +0100 |
commit | 08e633d777f1d2cf11a93ccb55f231d084f3220c (patch) | |
tree | 19fa8e7bc840d42614a330251ac48f17fedd63f9 /include | |
parent | b4b6daf8b70a5448d3e7aea440d56d95e19e7d2d (diff) |
Related: tdf#130035 let SvxLineEndWindow have a menubutton parent
Change-Id: Id658dc0ac88d98ade67bdeb233eca6c912a3b253
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87133
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/colorwindow.hxx | 29 | ||||
-rw-r--r-- | include/svx/dlgctrl.hxx | 61 |
2 files changed, 62 insertions, 28 deletions
diff --git a/include/svx/colorwindow.hxx b/include/svx/colorwindow.hxx index 8a2f42751dfd..e87b60141160 100644 --- a/include/svx/colorwindow.hxx +++ b/include/svx/colorwindow.hxx @@ -22,6 +22,7 @@ #include <svtools/toolbarmenu.hxx> #include <rtl/ustring.hxx> +#include <svx/dlgctrl.hxx> #include <svx/SvxColorValueSet.hxx> #include <svx/Palette.hxx> #include <vcl/lstbox.hxx> @@ -109,34 +110,6 @@ public: class SvxColorToolBoxControl; -class SVX_DLLPUBLIC MenuOrToolMenuButton -{ -private: - // either - weld::MenuButton* m_pMenuButton; - // or - weld::Toolbar* m_pToolbar; - OString m_aIdent; - // or - SvxColorToolBoxControl* m_pControl; - VclPtr<ToolBox> m_xToolBox; - sal_uInt16 m_nId; -public: - MenuOrToolMenuButton(weld::MenuButton* pMenuButton); - MenuOrToolMenuButton(weld::Toolbar* pToolbar, const OString& rIdent); - MenuOrToolMenuButton(SvxColorToolBoxControl* pControl, ToolBox* pToolbar, sal_uInt16 nId); - ~MenuOrToolMenuButton(); - - MenuOrToolMenuButton(MenuOrToolMenuButton const &) = default; - MenuOrToolMenuButton(MenuOrToolMenuButton &&) = default; - MenuOrToolMenuButton & operator =(MenuOrToolMenuButton const &) = default; - MenuOrToolMenuButton & operator =(MenuOrToolMenuButton &&) = default; - - bool get_active() const; - void set_inactive() const; - weld::Widget* get_widget() const; -}; - class SVX_DLLPUBLIC ColorWindow final : public WeldToolbarPopup { private: diff --git a/include/svx/dlgctrl.hxx b/include/svx/dlgctrl.hxx index eaa31a5d0e3f..88f6b0025740 100644 --- a/include/svx/dlgctrl.hxx +++ b/include/svx/dlgctrl.hxx @@ -20,6 +20,7 @@ #define INCLUDED_SVX_DLGCTRL_HXX #include <sfx2/tabdlg.hxx> +#include <svtools/toolbarmenu.hxx> #include <svx/svxdllapi.h> #include <svx/rectenum.hxx> #include <vcl/customweld.hxx> @@ -36,6 +37,13 @@ namespace com { namespace sun { namespace star { namespace awt { struct Point; } } } } +namespace svt { + class PopupWindowController; +} + +class SvtValueSet; +class ToolBox; + /************************************************************************* |* Derived from SfxTabPage for being able to get notified through the |* virtual method from the control. @@ -211,6 +219,34 @@ public: virtual void LoseFocus() override; }; +class SVX_DLLPUBLIC MenuOrToolMenuButton +{ +private: + // either + weld::MenuButton* m_pMenuButton; + // or + weld::Toolbar* m_pToolbar; + OString m_aIdent; + // or + svt::PopupWindowController* m_pControl; + VclPtr<ToolBox> m_xToolBox; + sal_uInt16 m_nId; +public: + MenuOrToolMenuButton(weld::MenuButton* pMenuButton); + MenuOrToolMenuButton(weld::Toolbar* pToolbar, const OString& rIdent); + MenuOrToolMenuButton(svt::PopupWindowController* pControl, ToolBox* pToolbar, sal_uInt16 nId); + ~MenuOrToolMenuButton(); + + MenuOrToolMenuButton(MenuOrToolMenuButton const &) = default; + MenuOrToolMenuButton(MenuOrToolMenuButton &&) = default; + MenuOrToolMenuButton & operator =(MenuOrToolMenuButton const &) = default; + MenuOrToolMenuButton & operator =(MenuOrToolMenuButton &&) = default; + + bool get_active() const; + void set_inactive() const; + weld::Widget* get_widget() const; +}; + /************************************************************************/ class SAL_WARN_UNUSED SVX_DLLPUBLIC FillTypeLB : public ListBox @@ -288,6 +324,31 @@ public: bool get_sensitive() const { return m_xControl->get_sensitive(); } }; +typedef std::function<void(const css::uno::Sequence<css::beans::PropertyValue>&)> LineEndSelectFunction; + +class SvxLineEndWindow final : public WeldToolbarPopup +{ +private: + XLineEndListRef mpLineEndList; + MenuOrToolMenuButton maMenuButton; + LineEndSelectFunction maLineEndSelectFunction; + std::unique_ptr<SvtValueSet> mxLineEndSet; + std::unique_ptr<weld::CustomWeld> mxLineEndSetWin; + sal_uInt16 mnLines; + Size maBmpSize; + + DECL_LINK(SelectHdl, SvtValueSet*, void); + void FillValueSet(); + void SetSize(); + + virtual void GrabFocus() override; + +public: + SvxLineEndWindow(const css::uno::Reference< css::frame::XFrame >& rFrame, weld::Window* pParent, + const MenuOrToolMenuButton &rMenuButton, const LineEndSelectFunction& rLineEndSelectFunction); + virtual void statusChanged( const css::frame::FeatureStateEvent& rEvent ) override; +}; + class SdrObject; class SdrPathObj; class SdrModel; |