20 #include <strings.hrc>
21 #include <dialmgr.hxx>
23 #include <svx/svxids.hrc>
55 auto xPage = std::make_unique<SvxMeasurePage>(
get_content_area(),
this, rInAttrs);
57 xPage->SetView(pSdrView);
71 :
SvxTabPage(pPage, pController,
"cui/ui/dimensionlinestabpage.ui",
"DimensionLinesTabPage", rInAttrs)
73 , aAttrSet(*rInAttrs.GetPool())
76 , bPositionModified(false)
77 , m_aCtlPosition(this)
78 , m_xMtrFldLineDist(m_xBuilder->weld_metric_spin_button(
"MTR_LINE_DIST",
FieldUnit::
MM))
79 , m_xMtrFldHelplineOverhang(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_HELPLINE_OVERHANG",
FieldUnit::
MM))
80 , m_xMtrFldHelplineDist(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_HELPLINE_DIST",
FieldUnit::
MM))
81 , m_xMtrFldHelpline1Len(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_HELPLINE1_LEN",
FieldUnit::
MM))
82 , m_xMtrFldHelpline2Len(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_HELPLINE2_LEN",
FieldUnit::
MM))
83 , m_xTsbBelowRefEdge(m_xBuilder->weld_check_button(
"TSB_BELOW_REF_EDGE"))
84 , m_xMtrFldDecimalPlaces(m_xBuilder->weld_spin_button(
"MTR_FLD_DECIMALPLACES"))
85 , m_xTsbAutoPosV(m_xBuilder->weld_check_button(
"TSB_AUTOPOSV"))
86 , m_xTsbAutoPosH(m_xBuilder->weld_check_button(
"TSB_AUTOPOSH"))
87 , m_xTsbShowUnit(m_xBuilder->weld_check_button(
"TSB_SHOW_UNIT"))
88 , m_xLbUnit(m_xBuilder->weld_combo_box(
"LB_UNIT"))
89 , m_xTsbParallel(m_xBuilder->weld_check_button(
"TSB_PARALLEL"))
90 , m_xFtAutomatic(m_xBuilder->weld_label(
"STR_MEASURE_AUTOMATIC"))
91 , m_xCtlPosition(new
weld::CustomWeld(*m_xBuilder,
"CTL_POSITION", m_aCtlPosition))
92 , m_xCtlPreview(new
weld::CustomWeld(*m_xBuilder,
"CTL_PREVIEW", m_aCtlPreview))
104 if( eFUnit == FieldUnit::MM )
150 if( pItem ==
nullptr )
157 if( pItem ==
nullptr )
165 if( pItem ==
nullptr )
173 if( pItem ==
nullptr )
181 if( pItem ==
nullptr )
201 if( pItem ==
nullptr )
204 static_cast<const SdrMeasureDecimalPlacesItem*>(pItem)->
GetValue());
239 if (
m_xLbUnit->get_id(
i).toInt32() == nFieldUnit)
255 css::drawing::MeasureTextVertPos eVPos =
260 css::drawing::MeasureTextHorzPos eHPos =
265 case css::drawing::MeasureTextVertPos_EAST:
268 case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: eRP = RectPoint::LT;
break;
269 case css::drawing::MeasureTextHorzPos_INSIDE: eRP = RectPoint::MT;
break;
270 case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: eRP = RectPoint::RT;
break;
271 case css::drawing::MeasureTextHorzPos_AUTO: eRP = RectPoint::MT;
break;
275 case css::drawing::MeasureTextVertPos_CENTERED:
278 case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: eRP = RectPoint::LM;
break;
279 case css::drawing::MeasureTextHorzPos_INSIDE: eRP = RectPoint::MM;
break;
280 case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: eRP = RectPoint::RM;
break;
281 case css::drawing::MeasureTextHorzPos_AUTO: eRP = RectPoint::MM;
break;
285 case css::drawing::MeasureTextVertPos_WEST:
288 case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: eRP = RectPoint::LB;
break;
289 case css::drawing::MeasureTextHorzPos_INSIDE: eRP = RectPoint::MB;
break;
290 case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: eRP = RectPoint::RB;
break;
291 case css::drawing::MeasureTextHorzPos_AUTO: eRP = RectPoint::MB;
break;
295 case css::drawing::MeasureTextVertPos_AUTO:
298 case css::drawing::MeasureTextHorzPos_LEFTOUTSIDE: eRP = RectPoint::LM;
break;
299 case css::drawing::MeasureTextHorzPos_INSIDE: eRP = RectPoint::MM;
break;
300 case css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE: eRP = RectPoint::RM;
break;
301 case css::drawing::MeasureTextHorzPos_AUTO: eRP = RectPoint::MM;
break;
310 if (eHPos == css::drawing::MeasureTextHorzPos_AUTO)
313 nState = CTL_STATE::NOHORZ;
316 if (eVPos == css::drawing::MeasureTextVertPos_AUTO)
319 nState |= CTL_STATE::NOVERT;
351 bool bModified =
false;
402 sal::static_int_cast< sal_Int16 >( nValue ) ) );
421 if(
m_xLbUnit->get_value_changed_from_saved() )
425 sal_uInt16 nFieldUnit =
m_xLbUnit->get_id(nPos).toUInt32();
435 css::drawing::MeasureTextVertPos eVPos;
436 css::drawing::MeasureTextHorzPos eHPos;
442 case RectPoint::LT: eVPos = css::drawing::MeasureTextVertPos_EAST;
443 eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE;
break;
444 case RectPoint::LM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
445 eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE;
break;
446 case RectPoint::LB: eVPos = css::drawing::MeasureTextVertPos_WEST;
447 eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE;
break;
448 case RectPoint::MT: eVPos = css::drawing::MeasureTextVertPos_EAST;
449 eHPos = css::drawing::MeasureTextHorzPos_INSIDE;
break;
450 case RectPoint::MM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
451 eHPos = css::drawing::MeasureTextHorzPos_INSIDE;
break;
452 case RectPoint::MB: eVPos = css::drawing::MeasureTextVertPos_WEST;
453 eHPos = css::drawing::MeasureTextHorzPos_INSIDE;
break;
454 case RectPoint::RT: eVPos = css::drawing::MeasureTextVertPos_EAST;
455 eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE;
break;
456 case RectPoint::RM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
457 eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE;
break;
458 case RectPoint::RB: eVPos = css::drawing::MeasureTextVertPos_WEST;
459 eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE;
break;
462 eHPos = css::drawing::MeasureTextHorzPos_AUTO;
465 eVPos = css::drawing::MeasureTextVertPos_AUTO;
470 if( eOldVPos != eVPos )
485 if( eOldHPos != eHPos )
525 return std::make_unique<SvxMeasurePage>(pPage, pController, *rAttrs);
537 switch( m_aCtlPosition.GetActualRP() )
541 m_aCtlPosition.SetActualRP( RectPoint::MT );
546 m_aCtlPosition.SetActualRP( RectPoint::MM );
551 m_aCtlPosition.SetActualRP( RectPoint::MB );
558 switch( m_aCtlPosition.GetActualRP() )
562 m_aCtlPosition.SetActualRP( RectPoint::LM );
567 m_aCtlPosition.SetActualRP( RectPoint::MM );
572 m_aCtlPosition.SetActualRP( RectPoint::RM );
577 ChangeAttrHdl_Impl(&rBox);
582 ChangeAttrHdl_Impl(&r);
587 ChangeAttrHdl_Impl(&rBox);
592 ChangeAttrHdl_Impl(&rBox);
597 ChangeAttrHdl_Impl(&rBox);
641 sal_Int16
nValue = sal::static_int_cast< sal_Int16 >(
665 sal_uInt16 nFieldUnit =
m_xLbUnit->get_id(nPos).toUInt32();
677 css::drawing::MeasureTextVertPos eVPos;
678 css::drawing::MeasureTextHorzPos eHPos;
683 case RectPoint::LT: eVPos = css::drawing::MeasureTextVertPos_EAST;
684 eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE;
break;
685 case RectPoint::LM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
686 eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE;
break;
687 case RectPoint::LB: eVPos = css::drawing::MeasureTextVertPos_WEST;
688 eHPos = css::drawing::MeasureTextHorzPos_LEFTOUTSIDE;
break;
689 case RectPoint::MT: eVPos = css::drawing::MeasureTextVertPos_EAST;
690 eHPos = css::drawing::MeasureTextHorzPos_INSIDE;
break;
691 case RectPoint::MM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
692 eHPos = css::drawing::MeasureTextHorzPos_INSIDE;
break;
693 case RectPoint::MB: eVPos = css::drawing::MeasureTextVertPos_WEST;
694 eHPos = css::drawing::MeasureTextHorzPos_INSIDE;
break;
695 case RectPoint::RT: eVPos = css::drawing::MeasureTextVertPos_EAST;
696 eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE;
break;
697 case RectPoint::RM: eVPos = css::drawing::MeasureTextVertPos_CENTERED;
698 eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE;
break;
699 case RectPoint::RB: eVPos = css::drawing::MeasureTextVertPos_WEST;
700 eHPos = css::drawing::MeasureTextHorzPos_RIGHTOUTSIDE;
break;
707 eHPos = css::drawing::MeasureTextHorzPos_AUTO;
708 nState = CTL_STATE::NOHORZ;
713 eVPos = css::drawing::MeasureTextVertPos_AUTO;
714 nState |= CTL_STATE::NOVERT;
734 m_xLbUnit->append(OUString::number(sal_uInt32(nUnit)), aStrMetric);
740 m_xLbUnit->append(OUString::number(sal_uInt32(nUnit)), aStrMetric);
#define LINK(Instance, Class, Member)
void SetFieldUnit(weld::MetricSpinButton &rField, FieldUnit eUnit, bool bAll)
void SetActualRP(RectPoint eNewRP)
void ChangeAttrHdl_Impl(void const *)
std::unique_ptr< weld::CustomWeld > m_xCtlPreview
SdrMetricItem makeSdrMeasureHelpline1LenItem(tools::Long nVal)
std::unique_ptr< weld::SpinButton > m_xMtrFldDecimalPlaces
void SetView(const SdrView *pSdrView)
std::unique_ptr< weld::CheckButton > m_xTsbShowUnit
constexpr TypedWhichId< SdrMetricItem > SDRATTR_MEASUREHELPLINE1LEN(SDRATTR_MEASURE_FIRST+6)
RectPoint GetActualRP() const
weld::Container * get_content_area()
constexpr TypedWhichId< SdrMeasureUnitItem > SDRATTR_MEASUREUNIT(SDRATTR_MEASURE_FIRST+12)
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldLineDist
SvxMeasurePage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rInAttrs)
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldHelpline1Len
SdrMetricItem makeSdrMeasureHelpline2LenItem(tools::Long nVal)
static FieldUnit GetValue(sal_uInt32 i)
FieldUnit GetModuleFieldUnit(const SfxItemSet &rSet)
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
SvxXMeasurePreview m_aCtlPreview
virtual ~SvxMeasurePage() override
void SetState(CTL_STATE nState)
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldHelplineOverhang
constexpr TypedWhichId< SdrMeasureTextHPosItem > SDRATTR_MEASURETEXTHPOS(SDRATTR_MEASURE_FIRST+1)
constexpr TypedWhichId< SdrMeasureDecimalPlacesItem > SDRATTR_MEASUREDECIMALPLACES(SDRATTR_MEASURE_FIRST+20)
static const sal_uInt16 pRanges[]
virtual void PointChanged(weld::DrawingArea *pWindow, RectPoint eRP) override
virtual void PageCreated(const SfxAllItemSet &aSet) override
constexpr TypedWhichId< SdrMetricItem > SDRATTR_MEASUREHELPLINEDIST(SDRATTR_MEASURE_FIRST+5)
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldHelpline2Len
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
SvxMeasureDialog(weld::Window *pParent, const SfxItemSet &rAttr, const SdrView *pView)
static OUString GetString(sal_uInt32 i)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_MEASUREHELPLINE2LEN(SDRATTR_MEASURE_FIRST+7)
int GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
virtual bool FillItemSet(SfxItemSet *) override
std::unique_ptr< weld::CheckButton > m_xTsbBelowRefEdge
std::unique_ptr< weld::MetricSpinButton > m_xMtrFldHelplineDist
std::unique_ptr< weld::ComboBox > m_xLbUnit
void SetTabPage(std::unique_ptr< SfxTabPage > xTabPage)
static sal_uInt32 Count()
virtual void Reset(const SfxItemSet *) override
void SetMetricValue(weld::MetricSpinButton &rField, int nCoreValue, MapUnit eUnit)
const SfxPoolItem & GetDefaultItem(sal_uInt16 nWhich) const
SfxItemPool * GetPool() const
std::unique_ptr< weld::CheckButton > m_xTsbAutoPosV
OUString CuiResId(const char *pKey)
const SfxItemSet & rOutAttrs
std::unique_ptr< weld::CustomWeld > m_xCtlPosition
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
std::unique_ptr< weld::CheckButton > m_xTsbAutoPosH
SvxRectCtl m_aCtlPosition
constexpr TypedWhichId< SdrYesNoItem > SDRATTR_MEASURESHOWUNIT(SDRATTR_MEASURE_FIRST+14)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
IMPL_LINK(SvxMeasurePage, ClickAutoPosHdl_Impl, weld::ToggleButton &, rBox, void)
constexpr TypedWhichId< SdrMeasureTextVPosItem > SDRATTR_MEASURETEXTVPOS(SDRATTR_MEASURE_FIRST+2)
constexpr sal_uInt16 SDRATTR_MEASURE_FIRST(SDRATTR_EDGE_LAST+1)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Dialog for changing TextAttributes.
Reference< XExecutableDialog > m_xDialog
constexpr TypedWhichId< SdrMeasureBelowRefEdgeItem > SDRATTR_MEASUREBELOWREFEDGE(SDRATTR_MEASURE_FIRST+8)
SdrMetricItem makeSdrMeasureHelplineOverhangItem(tools::Long nVal)
constexpr TypedWhichId< SdrMeasureTextRota90Item > SDRATTR_MEASURETEXTROTA90(SDRATTR_MEASURE_FIRST+9)
constexpr sal_uInt16 SDRATTR_MEASURE_LAST(SDRATTR_MEASUREDECIMALPLACES)
std::unique_ptr< weld::CheckButton > m_xTsbParallel
void SetAttributes(const SfxItemSet &rInAttrs)
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
constexpr TypedWhichId< SdrMetricItem > SDRATTR_MEASUREHELPLINEOVERHANG(SDRATTR_MEASURE_FIRST+4)
SdrMetricItem makeSdrMeasureLineDistItem(tools::Long nVal)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_MEASURELINEDIST(SDRATTR_MEASURE_FIRST+3)
std::unique_ptr< weld::Label > m_xFtAutomatic
SdrMetricItem makeSdrMeasureHelplineDistItem(tools::Long nVal)