23#include <svx/svxids.hrc>
40 svl::Items<SDRATTR_MEASURE_FIRST, SDRATTR_MEASURE_LAST>);
51 auto xPage = std::make_unique<SvxMeasurePage>(
get_content_area(),
this, rInAttrs);
53 xPage->SetView(pSdrView);
67 :
SvxTabPage(pPage, pController,
"cui/ui/dimensionlinestabpage.ui",
"DimensionLinesTabPage", rInAttrs)
69 , aAttrSet(*rInAttrs.GetPool())
72 , bPositionModified(false)
73 , m_aCtlPosition(this)
74 , m_xMtrFldLineDist(m_xBuilder->weld_metric_spin_button(
"MTR_LINE_DIST",
FieldUnit::
MM))
75 , m_xMtrFldHelplineOverhang(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_HELPLINE_OVERHANG",
FieldUnit::
MM))
76 , m_xMtrFldHelplineDist(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_HELPLINE_DIST",
FieldUnit::
MM))
77 , m_xMtrFldHelpline1Len(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_HELPLINE1_LEN",
FieldUnit::
MM))
78 , m_xMtrFldHelpline2Len(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_HELPLINE2_LEN",
FieldUnit::
MM))
79 , m_xTsbBelowRefEdge(m_xBuilder->weld_check_button(
"TSB_BELOW_REF_EDGE"))
80 , m_xMtrFldDecimalPlaces(m_xBuilder->weld_spin_button(
"MTR_FLD_DECIMALPLACES"))
81 , m_xTsbAutoPosV(m_xBuilder->weld_check_button(
"TSB_AUTOPOSV"))
82 , m_xTsbAutoPosH(m_xBuilder->weld_check_button(
"TSB_AUTOPOSH"))
83 , m_xTsbShowUnit(m_xBuilder->weld_check_button(
"TSB_SHOW_UNIT"))
84 , m_xLbUnit(m_xBuilder->weld_combo_box(
"LB_UNIT"))
85 , m_xTsbParallel(m_xBuilder->weld_check_button(
"TSB_PARALLEL"))
86 , m_xFtAutomatic(m_xBuilder->weld_label(
"STR_MEASURE_AUTOMATIC"))
87 , m_xCtlPosition(new
weld::CustomWeld(*m_xBuilder,
"CTL_POSITION", m_aCtlPosition))
88 , m_xCtlPreview(new
weld::CustomWeld(*m_xBuilder,
"CTL_PREVIEW", m_aCtlPreview))
100 if( eFUnit == FieldUnit::MM )
151 if( pItem ==
nullptr )
158 if( pItem ==
nullptr )
166 if( pItem ==
nullptr )
174 if( pItem ==
nullptr )
182 if( pItem ==
nullptr )
202 if( pItem ==
nullptr )
240 if (
m_xLbUnit->get_id(
i).toInt32() == nFieldUnit)
256 css::drawing::MeasureTextVertPos eVPos =
261 css::drawing::MeasureTextHorzPos eHPos =
266 case css::drawing::MeasureTextVertPos_EAST:
269 case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: eRP = RectPoint::LT;
break;
270 case css::drawing::MeasureTextHorzPos_INSIDE: eRP = RectPoint::MT;
break;
271 case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: eRP = RectPoint::RT;
break;
272 case css::drawing::MeasureTextHorzPos_AUTO: eRP = RectPoint::MT;
break;
276 case css::drawing::MeasureTextVertPos_CENTERED:
279 case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: eRP = RectPoint::LM;
break;
280 case css::drawing::MeasureTextHorzPos_INSIDE: eRP = RectPoint::MM;
break;
281 case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: eRP = RectPoint::RM;
break;
282 case css::drawing::MeasureTextHorzPos_AUTO: eRP = RectPoint::MM;
break;
286 case css::drawing::MeasureTextVertPos_WEST:
289 case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: eRP = RectPoint::LB;
break;
290 case css::drawing::MeasureTextHorzPos_INSIDE: eRP = RectPoint::MB;
break;
291 case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: eRP = RectPoint::RB;
break;
292 case css::drawing::MeasureTextHorzPos_AUTO: eRP = RectPoint::MB;
break;
296 case css::drawing::MeasureTextVertPos_AUTO:
299 case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: eRP = RectPoint::LM;
break;
300 case css::drawing::MeasureTextHorzPos_INSIDE: eRP = RectPoint::MM;
break;
301 case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: eRP = RectPoint::RM;
break;
302 case css::drawing::MeasureTextHorzPos_AUTO: eRP = RectPoint::MM;
break;
311 if (eHPos == css::drawing::MeasureTextHorzPos_AUTO)
314 nState = CTL_STATE::NOHORZ;
317 if (eVPos == css::drawing::MeasureTextVertPos_AUTO)
320 nState |= CTL_STATE::NOVERT;
352 bool bModified =
false;
403 sal::static_int_cast< sal_Int16 >(
nValue ) ) );
422 if(
m_xLbUnit->get_value_changed_from_saved() )
436 css::drawing::MeasureTextVertPos eVPos;
437 css::drawing::MeasureTextHorzPos eHPos;
443 case RectPoint::LT: eVPos = css::drawing::MeasureTextVertPos_EAST;
444 eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE;
break;
445 case RectPoint::LM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
446 eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE;
break;
447 case RectPoint::LB: eVPos = css::drawing::MeasureTextVertPos_WEST;
448 eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE;
break;
449 case RectPoint::MT: eVPos = css::drawing::MeasureTextVertPos_EAST;
450 eHPos = css::drawing::MeasureTextHorzPos_INSIDE;
break;
451 case RectPoint::MM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
452 eHPos = css::drawing::MeasureTextHorzPos_INSIDE;
break;
453 case RectPoint::MB: eVPos = css::drawing::MeasureTextVertPos_WEST;
454 eHPos = css::drawing::MeasureTextHorzPos_INSIDE;
break;
455 case RectPoint::RT: eVPos = css::drawing::MeasureTextVertPos_EAST;
456 eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE;
break;
457 case RectPoint::RM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
458 eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE;
break;
459 case RectPoint::RB: eVPos = css::drawing::MeasureTextVertPos_WEST;
460 eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE;
break;
463 eHPos = css::drawing::MeasureTextHorzPos_AUTO;
466 eVPos = css::drawing::MeasureTextVertPos_AUTO;
471 if( eOldVPos != eVPos )
486 if( eOldHPos != eHPos )
526 return std::make_unique<SvxMeasurePage>(pPage, pController, *rAttrs);
538 switch( m_aCtlPosition.GetActualRP() )
542 m_aCtlPosition.SetActualRP( RectPoint::MT );
547 m_aCtlPosition.SetActualRP( RectPoint::MM );
552 m_aCtlPosition.SetActualRP( RectPoint::MB );
559 switch( m_aCtlPosition.GetActualRP() )
563 m_aCtlPosition.SetActualRP( RectPoint::LM );
568 m_aCtlPosition.SetActualRP( RectPoint::MM );
573 m_aCtlPosition.SetActualRP( RectPoint::RM );
578 ChangeAttrHdl_Impl(&rBox);
583 ChangeAttrHdl_Impl(&r);
588 ChangeAttrHdl_Impl(&rBox);
593 ChangeAttrHdl_Impl(&rBox);
598 ChangeAttrHdl_Impl(&rBox);
642 sal_Int16
nValue = sal::static_int_cast< sal_Int16 >(
678 css::drawing::MeasureTextVertPos eVPos;
679 css::drawing::MeasureTextHorzPos eHPos;
684 case RectPoint::LT: eVPos = css::drawing::MeasureTextVertPos_EAST;
685 eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE;
break;
686 case RectPoint::LM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
687 eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE;
break;
688 case RectPoint::LB: eVPos = css::drawing::MeasureTextVertPos_WEST;
689 eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE;
break;
690 case RectPoint::MT: eVPos = css::drawing::MeasureTextVertPos_EAST;
691 eHPos = css::drawing::MeasureTextHorzPos_INSIDE;
break;
692 case RectPoint::MM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
693 eHPos = css::drawing::MeasureTextHorzPos_INSIDE;
break;
694 case RectPoint::MB: eVPos = css::drawing::MeasureTextVertPos_WEST;
695 eHPos = css::drawing::MeasureTextHorzPos_INSIDE;
break;
696 case RectPoint::RT: eVPos = css::drawing::MeasureTextVertPos_EAST;
697 eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE;
break;
698 case RectPoint::RM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
699 eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE;
break;
700 case RectPoint::RB: eVPos = css::drawing::MeasureTextVertPos_WEST;
701 eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE;
break;
708 eHPos = css::drawing::MeasureTextHorzPos_AUTO;
709 nState = CTL_STATE::NOHORZ;
714 eVPos = css::drawing::MeasureTextVertPos_AUTO;
715 nState |= CTL_STATE::NOVERT;
735 m_xLbUnit->append(OUString::number(sal_uInt32(nUnit)), aStrMetric);
741 m_xLbUnit->append(OUString::number(sal_uInt32(nUnit)), aStrMetric);
Reference< XExecutableDialog > m_xDialog
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void SetTabPage(std::unique_ptr< SfxTabPage > xTabPage)
weld::Container * get_content_area()
static FieldUnit GetValue(sal_uInt32 i)
static sal_uInt32 Count()
static OUString GetString(sal_uInt32 i)
SvxMeasureDialog(weld::Window *pParent, const SfxItemSet &rAttr, const SdrView *pView)
Dialog for changing TextAttributes.
std::unique_ptr< weld::Label > m_xFtAutomatic
std::unique_ptr< weld::CheckButton > m_xTsbShowUnit
void ChangeAttrHdl_Impl(void const *)
static const WhichRangesContainer pRanges
std::unique_ptr< weld::ComboBox > m_xLbUnit
std::unique_ptr< weld::CheckButton > m_xTsbAutoPosV
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
virtual bool FillItemSet(SfxItemSet *) override
SvxRectCtl m_aCtlPosition
const SfxItemSet & rOutAttrs
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
virtual void Reset(const SfxItemSet *) override
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldHelplineOverhang
std::unique_ptr< weld::CustomWeld > m_xCtlPosition
std::unique_ptr< weld::SpinButton > m_xMtrFldDecimalPlaces
virtual ~SvxMeasurePage() override
std::unique_ptr< weld::CheckButton > m_xTsbParallel
SvxXMeasurePreview m_aCtlPreview
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldHelplineDist
void SetView(const SdrView *pSdrView)
std::unique_ptr< weld::CheckButton > m_xTsbAutoPosH
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldHelpline1Len
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldHelpline2Len
virtual void PageCreated(const SfxAllItemSet &aSet) override
std::unique_ptr< weld::CustomWeld > m_xCtlPreview
std::unique_ptr< weld::CheckButton > m_xTsbBelowRefEdge
SvxMeasurePage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldLineDist
void SetState(CTL_STATE nState)
void SetActualRP(RectPoint eNewRP)
RectPoint GetActualRP() const
void SetAttributes(const SfxItemSet &rInAttrs)
OUString CuiResId(TranslateId aKey)
#define DBG_ASSERT(sCon, aError)
virtual tools::Long GetValue() const override
SVXCORE_DLLPUBLIC FieldUnit GetModuleFieldUnit(const SfxItemSet &)
#define LINK(Instance, Class, Member)
IMPL_LINK(SvxMeasurePage, ClickAutoPosHdl_Impl, weld::Toggleable &, rBox, void)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_MEASUREHELPLINE1LEN(SDRATTR_MEASURE_FIRST+6)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_MEASUREHELPLINE2LEN(SDRATTR_MEASURE_FIRST+7)
constexpr TypedWhichId< SdrYesNoItem > SDRATTR_MEASURESHOWUNIT(SDRATTR_MEASURE_FIRST+14)
constexpr TypedWhichId< SdrMeasureTextRota90Item > SDRATTR_MEASURETEXTROTA90(SDRATTR_MEASURE_FIRST+9)
constexpr TypedWhichId< SdrMeasureTextVPosItem > SDRATTR_MEASURETEXTVPOS(SDRATTR_MEASURE_FIRST+2)
constexpr TypedWhichId< SdrMeasureBelowRefEdgeItem > SDRATTR_MEASUREBELOWREFEDGE(SDRATTR_MEASURE_FIRST+8)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_MEASUREHELPLINEOVERHANG(SDRATTR_MEASURE_FIRST+4)
constexpr TypedWhichId< SdrMeasureUnitItem > SDRATTR_MEASUREUNIT(SDRATTR_MEASURE_FIRST+12)
constexpr TypedWhichId< SdrMeasureTextHPosItem > SDRATTR_MEASURETEXTHPOS(SDRATTR_MEASURE_FIRST+1)
constexpr TypedWhichId< SdrMeasureDecimalPlacesItem > SDRATTR_MEASUREDECIMALPLACES(SDRATTR_MEASURE_FIRST+20)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_MEASURELINEDIST(SDRATTR_MEASURE_FIRST+3)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_MEASUREHELPLINEDIST(SDRATTR_MEASURE_FIRST+5)
SdrMetricItem makeSdrMeasureLineDistItem(tools::Long nVal)
SdrMetricItem makeSdrMeasureHelpline1LenItem(tools::Long nVal)
SdrMetricItem makeSdrMeasureHelplineOverhangItem(tools::Long nVal)
SdrMetricItem makeSdrMeasureHelplineDistItem(tools::Long nVal)
SdrMetricItem makeSdrMeasureHelpline2LenItem(tools::Long nVal)
SVT_DLLPUBLIC sal_Int64 GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
SVT_DLLPUBLIC void SetMetricValue(weld::MetricSpinButton &rField, sal_Int64 nCoreValue, MapUnit eUnit)
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)