From 4f6d95ead1286748810e937c7672de08b8b39a38 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 6 Jan 2020 09:51:42 +0000 Subject: weld LinePropertyPanel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If4ff18c3d312d273e9d28aeef97db053f56007ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86309 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- include/svx/sidebar/LinePropertyPanelBase.hxx | 70 ++++++++++++--------------- include/svx/sidebar/LineWidthPopup.hxx | 33 +++++++------ 2 files changed, 50 insertions(+), 53 deletions(-) (limited to 'include') diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx index e114d7b8e9b3..c91c2dd136b6 100644 --- a/include/svx/sidebar/LinePropertyPanelBase.hxx +++ b/include/svx/sidebar/LinePropertyPanelBase.hxx @@ -19,17 +19,16 @@ #ifndef INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX #define INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEPROPERTYPANELBASE_HXX -#include -#include -#include +#include #include #include +#include #include #include #include #include - +class ToolbarUnoDispatcher; class XLineStyleItem; class XLineDashItem; class XLineStartItem; @@ -40,15 +39,6 @@ class XLineJointItem; class XLineCapItem; class XLineTransparenceItem; class XDashList; -class ListBox; -class ToolBox; -class FloatingWindow; - -namespace sfx2 { namespace sidebar { - -class SidebarToolBox; - -} } namespace svx { @@ -68,6 +58,8 @@ public: void SetWidthIcon(int n); void SetWidthIcon(); + void EndLineWidthPopup(); + // constructor/destructor LinePropertyPanelBase( vcl::Window* pParent, @@ -108,23 +100,26 @@ protected: protected: - VclPtr mpTBColor; + std::unique_ptr mxTBColor; + std::unique_ptr mxColorDispatch; private: //ui controls - VclPtr mpFTWidth; - VclPtr mpTBWidth; - VclPtr mpLBStyle; - VclPtr mpFTTransparency; - VclPtr mpMFTransparent; - VclPtr mpLBStart; - VclPtr mpLBEnd; - VclPtr mpFTEdgeStyle; - VclPtr mpLBEdgeStyle; - VclPtr mpFTCapStyle; - VclPtr mpLBCapStyle; - VclPtr mpGridLineProps; - VclPtr mpBoxArrowProps; + std::unique_ptr mxFTWidth; + std::unique_ptr mxTBWidth; + std::unique_ptr mxLBStyle; + std::unique_ptr mxFTTransparency; + std::unique_ptr mxMFTransparent; + std::unique_ptr mxLBStart; + std::unique_ptr mxLBEnd; + std::unique_ptr mxFTEdgeStyle; + std::unique_ptr mxLBEdgeStyle; + std::unique_ptr mxFTCapStyle; + std::unique_ptr mxLBCapStyle; + std::unique_ptr mxGridLineProps; + std::unique_ptr mxBoxArrowProps; + //popup windows + std::unique_ptr mxLineWidthPopup; std::unique_ptr mpStyleItem; std::unique_ptr mpDashItem; @@ -137,27 +132,24 @@ private: std::unique_ptr mpStartItem; std::unique_ptr mpEndItem; - //popup windows - VclPtr mxLineWidthPopup; - // images from resource - Image const maIMGNone; + OUString maIMGNone; // multi-images - std::unique_ptr mpIMGWidthIcon; + OUString maIMGWidthIcon[8]; bool mbWidthValuable : 1; bool mbArrowSupported; void Initialize(); - DECL_LINK(ChangeLineStyleHdl, ListBox&, void); - DECL_LINK(ToolboxWidthSelectHdl, ToolBox*, void); - DECL_LINK(ChangeTransparentHdl, Edit&, void ); - DECL_LINK(ChangeStartHdl, ListBox&, void); - DECL_LINK(ChangeEndHdl, ListBox&, void); - DECL_LINK(ChangeEdgeStyleHdl, ListBox&, void); - DECL_LINK(ChangeCapStyleHdl, ListBox&, void); + DECL_LINK(ChangeLineStyleHdl, weld::ComboBox&, void); + DECL_LINK(ToolboxWidthSelectHdl, const OString&, void); + DECL_LINK(ChangeTransparentHdl, weld::MetricSpinButton&, void ); + DECL_LINK(ChangeStartHdl, weld::ComboBox&, void); + DECL_LINK(ChangeEndHdl, weld::ComboBox&, void); + DECL_LINK(ChangeEdgeStyleHdl, weld::ComboBox&, void); + DECL_LINK(ChangeCapStyleHdl, weld::ComboBox&, void); }; } } // end of namespace svx::sidebar diff --git a/include/svx/sidebar/LineWidthPopup.hxx b/include/svx/sidebar/LineWidthPopup.hxx index fd36e5ea92a6..ce19baf92eb0 100644 --- a/include/svx/sidebar/LineWidthPopup.hxx +++ b/include/svx/sidebar/LineWidthPopup.hxx @@ -19,28 +19,29 @@ #ifndef INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEWIDTHPOPUP_HXX #define INCLUDED_SVX_SOURCE_SIDEBAR_LINE_LINEWIDTHPOPUP_HXX -#include -#include +#include +#include +#include +#include #include -class Edit; -class MetricField; -class ValueSet; +class SvtValueSet; namespace svx { namespace sidebar { class LinePropertyPanelBase; class LineWidthValueSet; -class LineWidthPopup final : public FloatingWindow +class LineWidthPopup final { public: - LineWidthPopup(LinePropertyPanelBase& rParent); - virtual void dispose() override; - virtual ~LineWidthPopup() override; + LineWidthPopup(weld::Widget* pParent, LinePropertyPanelBase& rParent); + ~LineWidthPopup(); void SetWidthSelect (long lValue, bool bValuable, MapUnit eMapUnit); + weld::Container* getTopLevel() const { return m_xTopLevel.get(); } + private: LinePropertyPanelBase& m_rParent; std::array maStrUnits; @@ -49,14 +50,18 @@ private: bool m_bVSFocus; bool m_bCustom; long m_nCustomWidth; - VclPtr m_xMFWidth; - VclPtr m_xBox; - VclPtr m_xVSWidth; Image const m_aIMGCus; Image const m_aIMGCusGray; - DECL_LINK(VSSelectHdl, ValueSet*, void); - DECL_LINK(MFModifyHdl, Edit&, void); + std::unique_ptr m_xBuilder; + std::unique_ptr m_xTopLevel; + std::unique_ptr m_xMFWidth; + std::unique_ptr m_xVSWidth; + std::unique_ptr m_xVSWidthWin; + + DECL_LINK(VSSelectHdl, SvtValueSet*, void); + DECL_LINK(MFModifyHdl, weld::MetricSpinButton&, void); + DECL_LINK(FocusHdl, weld::Widget&, void); }; } } // end of namespace svx::sidebar -- cgit