From 558faa307d87510c2d9d12b23c12f261c424f835 Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Wed, 28 Sep 2016 16:08:53 +0200 Subject: Page margin popup converted to use outside sidebar Change-Id: I3c4cc20fc8f2818677a77f848a1566bb56ceb7c6 Reviewed-on: https://gerrit.libreoffice.org/29363 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- sw/source/uibase/sidebar/PageMarginControl.hxx | 97 +++++++++++++------------- 1 file changed, 47 insertions(+), 50 deletions(-) (limited to 'sw/source/uibase/sidebar/PageMarginControl.hxx') diff --git a/sw/source/uibase/sidebar/PageMarginControl.hxx b/sw/source/uibase/sidebar/PageMarginControl.hxx index 1956d5d6d801..5336b14bf26f 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.hxx +++ b/sw/source/uibase/sidebar/PageMarginControl.hxx @@ -29,6 +29,9 @@ #include #include #include +#include + +#include #define SWPAGE_NARROW_VALUE 720 #define SWPAGE_NORMAL_VALUE 1136 @@ -36,84 +39,78 @@ #define SWPAGE_WIDE_VALUE2 2880 #define SWPAGE_WIDE_VALUE3 1800 -namespace svx { namespace sidebar { - class ValueSetWithTextControl; -} } -class ValueSet; - static const long MINBODY = 284; //0.5 cm in twips namespace sw { namespace sidebar { class PagePropertyPanel; -class PageMarginControl - : public svx::sidebar::PopupControl +class PageMarginControl : public SfxPopupWindow { public: - PageMarginControl( - vcl::Window* pParent, - PagePropertyPanel& rPanel, - const SvxLongLRSpaceItem& aPageLRMargin, - const SvxLongULSpaceItem& aPageULMargin, - const bool bMirrored, - const Size& rPageSize, - const bool bLandscape, - const FieldUnit eFUnit, - const MapUnit eUnit ); + PageMarginControl( sal_uInt16 nId ); virtual ~PageMarginControl() override; virtual void dispose() override; private: - VclPtr< svx::sidebar::ValueSetWithTextControl> mpMarginValueSet; - - VclPtr maCustom; - VclPtr maLeft; - VclPtr maInner; - VclPtr maLeftMarginEdit; - VclPtr maRight; - VclPtr maOuter; - VclPtr maRightMarginEdit; - VclPtr maTop; - VclPtr maTopMarginEdit; - VclPtr maBottom; - VclPtr maBottomMarginEdit; + VclPtr m_pNarrow; + VclPtr m_pNormal; + VclPtr m_pWide; + VclPtr m_pMirrored; + VclPtr m_pLast; + + VclPtr m_pLeft; + VclPtr m_pRight; + VclPtr m_pInner; + VclPtr m_pOuter; + + VclPtr m_pContainer; + + VclPtr m_pLeftMarginEdit; + VclPtr m_pRightMarginEdit; + VclPtr m_pTopMarginEdit; + VclPtr m_pBottomMarginEdit; // hidden metric field - VclPtr maWidthHeightField; + VclPtr m_pWidthHeightField; - long mnPageLeftMargin; - long mnPageRightMargin; - long mnPageTopMargin; - long mnPageBottomMargin; - bool mbMirrored; + long m_nPageLeftMargin; + long m_nPageRightMargin; + long m_nPageTopMargin; + long m_nPageBottomMargin; + bool m_bMirrored; - const MapUnit meUnit; + const MapUnit m_eUnit; - bool mbUserCustomValuesAvailable; - long mnUserCustomPageLeftMargin; - long mnUserCustomPageRightMargin; - long mnUserCustomPageTopMargin; - long mnUserCustomPageBottomMargin; - bool mbUserCustomMirrored; + Size m_aPageSize; - bool mbCustomValuesUsed; + bool m_bUserCustomValuesAvailable; + long m_nUserCustomPageLeftMargin; + long m_nUserCustomPageRightMargin; + long m_nUserCustomPageTopMargin; + long m_nUserCustomPageBottomMargin; + bool m_bUserCustomMirrored; - PagePropertyPanel& mrPagePropPanel; + bool m_bCustomValuesUsed; - DECL_LINK_TYPED( ImplMarginHdl, ValueSet*, void ); + DECL_LINK_TYPED( SelectMarginHdl, Button*, void ); DECL_LINK_TYPED( ModifyLRMarginHdl, Edit&, void ); DECL_LINK_TYPED( ModifyULMarginHdl, Edit&, void ); + static void ExecuteMarginLRChange( + const long nPageLeftMargin, + const long nPageRightMargin ); + static void ExecuteMarginULChange( + const long nPageTopMargin, + const long nPageBottomMargin ); + static void ExecutePageLayoutChange( const bool bMirrored ); + void SetMetricFieldMaxValues(const Size& rPageSize); bool GetUserCustomValues(); void StoreUserCustomValues(); - void FillValueSet( - const bool bLandscape, - const bool bUserCustomValuesAvailable ); - void SelectValueSetItem(); + void FillHelpText( const bool bUserCustomValuesAvailable ); }; } } // end of namespace sw::sidebar -- cgit