22#include <svx/svxids.hrc>
36 svl::Items<SID_ATTR_TABSTOP, SID_ATTR_TABSTOP_OFFSET>);
43 SvxTabStop aSwTabStop( nDefDist, SvxTabAdjust::Default );
44 rTabs.
Insert( aSwTabStop );
53 aPoint.setX( aSize.
Width() / 2 );
54 aPoint.setY( aSize.
Height() / 2 );
59 :
SfxTabPage(pPage, pController,
"cui/ui/paratabspage.ui",
"ParagraphTabsPage", &rAttr)
63 , m_xTabSpin(m_xBuilder->weld_metric_spin_button(
"SP_TABPOS",
FieldUnit::
CM))
64 , m_xTabBox(m_xBuilder->weld_entry_tree_view(
"tabgrid",
"ED_TABPOS",
"LB_TABPOS"))
65 , m_xCenterTab(m_xBuilder->weld_radio_button(
"radiobuttonBTN_TABTYPE_CENTER"))
66 , m_xDezTab(m_xBuilder->weld_radio_button(
"radiobuttonBTN_TABTYPE_DECIMAL"))
67 , m_xDezChar(m_xBuilder->weld_entry(
"entryED_TABTYPE_DECCHAR"))
68 , m_xDezCharLabel(m_xBuilder->weld_label(
"labelFT_TABTYPE_DECCHAR"))
70 , m_xNoFillChar(m_xBuilder->weld_radio_button(
"radiobuttonBTN_FILLCHAR_NO"))
71 , m_xFillPoints(m_xBuilder->weld_radio_button(
"radiobuttonBTN_FILLCHAR_POINTS"))
72 , m_xFillDashLine(m_xBuilder->weld_radio_button(
"radiobuttonBTN_FILLCHAR_DASHLINE"))
73 , m_xFillSolidLine(m_xBuilder->weld_radio_button(
"radiobuttonBTN_FILLCHAR_UNDERSCORE"))
74 , m_xFillSpecial(m_xBuilder->weld_radio_button(
"radiobuttonBTN_FILLCHAR_OTHER"))
75 , m_xFillChar(m_xBuilder->weld_entry(
"entryED_FILLCHAR_OTHER"))
77 , m_xNewBtn(m_xBuilder->weld_button(
"buttonBTN_NEW"))
78 , m_xDelAllBtn(m_xBuilder->weld_button(
"buttonBTN_DELALL"))
79 , m_xDelBtn(m_xBuilder->weld_button(
"buttonBTN_DEL"))
80 , m_xTypeFrame(m_xBuilder->weld_container(
"frameFL_TABTYPE"))
81 , m_xFillFrame(m_xBuilder->weld_container(
"frameFL_FILLCHAR"))
83 , m_xLeftWin(new
weld::CustomWeld(*m_xBuilder,
"drawingareaWIN_TABLEFT", m_aLeftWin))
84 , m_xRightWin(new
weld::CustomWeld(*m_xBuilder,
"drawingareaWIN_TABRIGHT", m_aRightWin))
85 , m_xCenterWin(new
weld::CustomWeld(*m_xBuilder,
"drawingareaWIN_TABCENTER", m_aCenterWin))
86 , m_xDezWin(new
weld::CustomWeld(*m_xBuilder,
"drawingareaWIN_TABDECIMAL", m_aDezWin))
151 bool bModified =
false;
166 if (MapUnit::Map100thMM != eUnit)
175 if (pLRSpace &&
static_cast<const SvxLRSpaceItem*
>(pLRSpace)->GetTextFirstLineOffset() < 0)
181 std::unique_ptr<SvxTabStopItem> aTmp(
aNewTabs->Clone());
182 aTmp->Remove(0, aTmp->Count());
188 aTmp->Insert(aTmpStop);
208 return std::make_unique<SvxTabulatorTabPage>(pPage, pController, *
rSet);
221 if (MapUnit::Map100thMM != eUnit)
226 for (sal_uInt16
i = 0;
i < aTmp->Count(); ++
i)
251 sal_uInt16 nTabPos = 0;
262 if (TabulatorDisableFlags::TypeLeft & nFlag)
267 if (TabulatorDisableFlags::TypeRight & nFlag)
272 if (TabulatorDisableFlags::TypeCenter & nFlag)
277 if (TabulatorDisableFlags::TypeDecimal & nFlag)
284 if (TabulatorDisableFlags::TypeMask & nFlag)
286 if (TabulatorDisableFlags::FillNone & nFlag)
288 if (TabulatorDisableFlags::FillPoint & nFlag)
290 if (TabulatorDisableFlags::FillDashLine & nFlag)
292 if (TabulatorDisableFlags::FillSolidLine & nFlag)
294 if (TabulatorDisableFlags::FillSpecial & nFlag)
299 if (TabulatorDisableFlags::FillMask & nFlag)
307 return DeactivateRC::LeavePage;
317 nOffset = pOffSetItem->GetValue();
323 for ( sal_uInt16
i = 0;
i <
aNewTabs->Count();
i++ )
325 if ( (*
aNewTabs)[
i].GetAdjustment() != SvxTabAdjust::Default )
337 const sal_uInt16 nSize =
aNewTabs->Count();
339 if ( nTabPos >= nSize )
424 if (nVal == 0 && pBtn ==
nullptr)
431 nOffset = pOffsetItem->GetValue();
436 sal_Int32 nSize =
m_xTabBox->get_count();
439 for(
i = 0;
i < nSize;
i++ )
441 if ( nReal < (*
aNewTabs)[
i].GetTabPos() )
453 eAdj = SvxTabAdjust::Right;
455 eAdj = SvxTabAdjust::Center;
457 eAdj = SvxTabAdjust::Decimal;
477 int nPos = FindCurrentTab();
481 if (m_xTabBox->get_count() == 1)
483 DelAllHdl_Impl(*m_xDelAllBtn);
488 m_xTabBox->remove(
nPos);
489 aNewTabs->Remove(
nPos );
492 const sal_uInt16 nSize = aNewTabs->Count();
498 m_xTabBox->set_active(
nPos);
499 aCurrentTab = (*aNewTabs)[
nPos];
503 if (m_xTabBox->get_count() == 0)
505 m_xDelBtn->set_sensitive(
false);
506 m_xNewBtn->set_sensitive(
true);
507 m_xTabBox->grab_focus();
513 if ( aNewTabs->Count() )
515 aNewTabs = std::make_unique<SvxTabStopItem>(
GetWhich(SID_ATTR_TABSTOP));
522 if (!rBox.get_active())
526 m_xDezChar->set_sensitive(
false);
527 m_xDezCharLabel->set_sensitive(
false);
528 m_xDezChar->set_text(
"");
530 if (&rBox == m_xLeftTab.get())
531 eAdj = SvxTabAdjust::Left;
532 else if (&rBox == m_xRightTab.get())
533 eAdj = SvxTabAdjust::Right;
534 else if (&rBox == m_xCenterTab.get())
535 eAdj = SvxTabAdjust::Center;
538 eAdj = SvxTabAdjust::Decimal;
539 m_xDezChar->set_sensitive(
true);
540 m_xDezCharLabel->set_sensitive(
true);
541 m_xDezChar->set_text(OUString(aCurrentTab.GetDecimal()));
544 aCurrentTab.GetAdjustment() = eAdj;
545 int nPos = FindCurrentTab();
548 aNewTabs->Remove(
nPos );
549 aNewTabs->Insert( aCurrentTab );
555 if (!rBox.get_active())
559 m_xFillChar->set_text(
"" );
560 m_xFillChar->set_sensitive(
false);
562 if (&rBox == m_xFillSpecial.get())
563 m_xFillChar->set_sensitive(
true);
564 else if (&rBox == m_xNoFillChar.get())
566 else if (&rBox == m_xFillSolidLine.get())
568 else if (&rBox == m_xFillPoints.get())
570 else if (&rBox == m_xFillDashLine.get())
573 aCurrentTab.GetFill() = cFill;
574 int nPos = FindCurrentTab();
577 aNewTabs->Remove(
nPos );
578 aNewTabs->Insert( aCurrentTab );
584 OUString aChar(m_xFillChar->get_text());
585 if ( !aChar.isEmpty() )
586 aCurrentTab.GetFill() = aChar[0];
588 const int nPos = FindCurrentTab();
591 aNewTabs->Remove(
nPos );
592 aNewTabs->Insert( aCurrentTab );
598 OUString aChar(m_xDezChar->get_text());
599 if ( !aChar.isEmpty() && ( aChar[0] >=
' '))
600 aCurrentTab.GetDecimal() = aChar[0];
602 const int nPos = FindCurrentTab();
605 aNewTabs->Remove(
nPos );
606 aNewTabs->Insert( aCurrentTab );
612 const int nPos = FindCurrentTab();
615 aCurrentTab = (*aNewTabs)[
nPos];
616 m_xNewBtn->set_sensitive(
false);
617 SetFillAndTabType_Impl();
631 m_xTabBox->set_entry_text(FormatTab());
636 const int nPos = FindCurrentTab();
639 aCurrentTab = (*aNewTabs)[
nPos];
640 SetFillAndTabType_Impl();
642 m_xTabSpin->set_text(m_xTabBox->get_active_text());
643 aCurrentTab.GetTabPos() = m_xTabSpin->denormalize(m_xTabSpin->get_value(
eDefUnit));
644 m_xNewBtn->set_sensitive(
false);
645 m_xDelBtn->set_sensitive(
true);
648 m_xNewBtn->set_sensitive(
true);
649 m_xDelBtn->set_sensitive(
false);
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
sal_uInt16 GetValue() const
const OUString & getNumDecimalSep() const
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
const AllSettings & GetSettings() const
static void DrawTab(vcl::RenderContext &rRenderContext, const Color &rFillColor, const Point &rPos, sal_uInt16 nStyle)
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)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
const SfxItemSet & GetItemSet() const
void SetExchangeSupport()
static const SfxPoolItem * GetItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
const SfxPoolItem * GetOldItem(const SfxItemSet &rSet, sal_uInt16 nSlot, bool bDeep=true)
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetFontColor() const
bool Insert(const SvxTabStop &rTab)
sal_Unicode & GetDecimal()
SvxTabAdjust & GetAdjustment()
std::unique_ptr< weld::RadioButton > m_xLeftTab
void DisableControls(const TabulatorDisableFlags nFlag)
SvxTabulatorTabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::RadioButton > m_xNoFillChar
std::unique_ptr< SvxTabStopItem > aNewTabs
std::unique_ptr< weld::RadioButton > m_xRightTab
std::unique_ptr< weld::Entry > m_xFillChar
std::unique_ptr< weld::CustomWeld > m_xCenterWin
std::unique_ptr< weld::Button > m_xDelBtn
std::unique_ptr< weld::Button > m_xDelAllBtn
virtual bool FillItemSet(SfxItemSet *rSet) override
void InitTabPos_Impl(sal_uInt16 nPos=0)
std::unique_ptr< weld::RadioButton > m_xFillSolidLine
std::unique_ptr< weld::Label > m_xDezCharLabel
std::unique_ptr< weld::CustomWeld > m_xRightWin
virtual ~SvxTabulatorTabPage() override
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
static const WhichRangesContainer pRanges
void NewHdl_Impl(const weld::Button *)
std::unique_ptr< weld::CustomWeld > m_xLeftWin
virtual void PageCreated(const SfxAllItemSet &aSet) override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
std::unique_ptr< weld::MetricSpinButton > m_xTabSpin
std::unique_ptr< weld::EntryTreeView > m_xTabBox
std::unique_ptr< weld::RadioButton > m_xFillDashLine
std::unique_ptr< weld::CustomWeld > m_xDezWin
virtual void Reset(const SfxItemSet *rSet) override
std::unique_ptr< weld::RadioButton > m_xCenterTab
std::unique_ptr< weld::Container > m_xFillFrame
std::unique_ptr< weld::Entry > m_xDezChar
std::unique_ptr< weld::Button > m_xNewBtn
std::unique_ptr< weld::RadioButton > m_xFillSpecial
void SetFillAndTabType_Impl()
std::unique_ptr< weld::RadioButton > m_xFillPoints
std::unique_ptr< weld::Container > m_xTypeFrame
std::unique_ptr< weld::RadioButton > m_xDezTab
virtual void Paint(vcl::RenderContext &rRenderContext, const ::tools::Rectangle &rRect) override
void SetTabStyle(sal_uInt16 nStyle)
virtual void set_active(bool active)=0
virtual tools::Long GetValue() const override
SVXCORE_DLLPUBLIC FieldUnit GetModuleFieldUnit(const SfxItemSet &)
#define LINK(Instance, Class, Member)
bool IsAsianTypographyEnabled()
const LocaleDataWrapper & GetLocaleDataWrapper(LanguageType nLang)
constexpr sal_uInt16 RULER_TAB_CENTER
constexpr sal_uInt16 RULER_TAB_RIGHT
constexpr sal_uInt16 RULER_TAB_LEFT
constexpr sal_uInt16 RULER_TAB_DECIMAL
IMPL_LINK(SvxTabulatorTabPage, NewHdl_Impl, weld::Button &, rBtn, void)
IMPL_LINK_NOARG(SvxTabulatorTabPage, DelHdl_Impl, weld::Button &, void)
constexpr FieldUnit eDefUnit
static void FillUpWithDefTabs_Impl(tools::Long nDefDist, SvxTabStopItem &rTabs)
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)