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 );
63 :
SfxTabPage(pPage, pController,
"cui/ui/paratabspage.ui",
"ParagraphTabsPage", &rAttr)
67 , m_xTabSpin(m_xBuilder->weld_metric_spin_button(
"SP_TABPOS",
FieldUnit::
CM))
68 , m_xTabBox(m_xBuilder->weld_entry_tree_view(
"tabgrid",
"ED_TABPOS",
"LB_TABPOS"))
69 , m_xCenterTab(m_xBuilder->weld_radio_button(
"radiobuttonBTN_TABTYPE_CENTER"))
70 , m_xDezTab(m_xBuilder->weld_radio_button(
"radiobuttonBTN_TABTYPE_DECIMAL"))
71 , m_xDezChar(m_xBuilder->weld_entry(
"entryED_TABTYPE_DECCHAR"))
72 , m_xDezCharLabel(m_xBuilder->weld_label(
"labelFT_TABTYPE_DECCHAR"))
74 , m_xNoFillChar(m_xBuilder->weld_radio_button(
"radiobuttonBTN_FILLCHAR_NO"))
75 , m_xFillPoints(m_xBuilder->weld_radio_button(
"radiobuttonBTN_FILLCHAR_POINTS"))
76 , m_xFillDashLine(m_xBuilder->weld_radio_button(
"radiobuttonBTN_FILLCHAR_DASHLINE"))
77 , m_xFillSolidLine(m_xBuilder->weld_radio_button(
"radiobuttonBTN_FILLCHAR_UNDERSCORE"))
78 , m_xFillSpecial(m_xBuilder->weld_radio_button(
"radiobuttonBTN_FILLCHAR_OTHER"))
79 , m_xFillChar(m_xBuilder->weld_entry(
"entryED_FILLCHAR_OTHER"))
81 , m_xNewBtn(m_xBuilder->weld_button(
"buttonBTN_NEW"))
82 , m_xDelAllBtn(m_xBuilder->weld_button(
"buttonBTN_DELALL"))
83 , m_xDelBtn(m_xBuilder->weld_button(
"buttonBTN_DEL"))
84 , m_xTypeFrame(m_xBuilder->weld_container(
"frameFL_TABTYPE"))
85 , m_xFillFrame(m_xBuilder->weld_container(
"frameFL_FILLCHAR"))
87 , m_xLeftWin(new
weld::CustomWeld(*m_xBuilder,
"drawingareaWIN_TABLEFT", m_aLeftWin))
88 , m_xRightWin(new
weld::CustomWeld(*m_xBuilder,
"drawingareaWIN_TABRIGHT", m_aRightWin))
89 , m_xCenterWin(new
weld::CustomWeld(*m_xBuilder,
"drawingareaWIN_TABCENTER", m_aCenterWin))
90 , m_xDezWin(new
weld::CustomWeld(*m_xBuilder,
"drawingareaWIN_TABDECIMAL", m_aDezWin))
155 bool bModified =
false;
170 if (MapUnit::Map100thMM != eUnit)
179 if (pLRSpace &&
static_cast<const SvxLRSpaceItem*
>(pLRSpace)->GetTextFirstLineOffset() < 0)
185 std::unique_ptr<SvxTabStopItem> aTmp(
aNewTabs->Clone());
186 aTmp->Remove(0, aTmp->Count());
192 aTmp->Insert(aTmpStop);
212 return std::make_unique<SvxTabulatorTabPage>(pPage, pController, *
rSet);
225 if (MapUnit::Map100thMM != eUnit)
230 for (sal_uInt16
i = 0;
i < aTmp->Count(); ++
i)
255 sal_uInt16 nTabPos = 0;
266 if (TabulatorDisableFlags::TypeLeft & nFlag)
271 if (TabulatorDisableFlags::TypeRight & nFlag)
276 if (TabulatorDisableFlags::TypeCenter & nFlag)
281 if (TabulatorDisableFlags::TypeDecimal & nFlag)
288 if (TabulatorDisableFlags::TypeMask & nFlag)
290 if (TabulatorDisableFlags::FillNone & nFlag)
292 if (TabulatorDisableFlags::FillPoint & nFlag)
294 if (TabulatorDisableFlags::FillDashLine & nFlag)
296 if (TabulatorDisableFlags::FillSolidLine & nFlag)
298 if (TabulatorDisableFlags::FillSpecial & nFlag)
303 if (TabulatorDisableFlags::FillMask & nFlag)
311 return DeactivateRC::LeavePage;
321 nOffset = pOffSetItem->GetValue();
327 for ( sal_uInt16
i = 0;
i <
aNewTabs->Count();
i++ )
329 if ( (*
aNewTabs)[
i].GetAdjustment() != SvxTabAdjust::Default )
341 const sal_uInt16 nSize =
aNewTabs->Count();
343 if ( nTabPos >= nSize )
428 if (nVal == 0 && pBtn ==
nullptr)
435 nOffset = pOffsetItem->GetValue();
440 sal_Int32 nSize =
m_xTabBox->get_count();
443 for(
i = 0;
i < nSize;
i++ )
445 if ( nReal < (*
aNewTabs)[
i].GetTabPos() )
457 eAdj = SvxTabAdjust::Right;
459 eAdj = SvxTabAdjust::Center;
461 eAdj = SvxTabAdjust::Decimal;
481 int nPos = FindCurrentTab();
485 if (m_xTabBox->get_count() == 1)
487 DelAllHdl_Impl(*m_xDelAllBtn);
492 m_xTabBox->remove(
nPos);
493 aNewTabs->Remove(
nPos );
496 const sal_uInt16 nSize = aNewTabs->Count();
502 m_xTabBox->set_active(
nPos);
503 aCurrentTab = (*aNewTabs)[
nPos];
507 if (m_xTabBox->get_count() == 0)
509 m_xDelBtn->set_sensitive(
false);
510 m_xNewBtn->set_sensitive(
true);
511 m_xTabBox->grab_focus();
517 if ( aNewTabs->Count() )
519 aNewTabs = std::make_unique<SvxTabStopItem>(
GetWhich(SID_ATTR_TABSTOP));
526 if (!rBox.get_active())
530 m_xDezChar->set_sensitive(
false);
531 m_xDezCharLabel->set_sensitive(
false);
532 m_xDezChar->set_text(
"");
534 if (&rBox == m_xLeftTab.get())
535 eAdj = SvxTabAdjust::Left;
536 else if (&rBox == m_xRightTab.get())
537 eAdj = SvxTabAdjust::Right;
538 else if (&rBox == m_xCenterTab.get())
539 eAdj = SvxTabAdjust::Center;
542 eAdj = SvxTabAdjust::Decimal;
543 m_xDezChar->set_sensitive(
true);
544 m_xDezCharLabel->set_sensitive(
true);
545 m_xDezChar->set_text(OUString(aCurrentTab.GetDecimal()));
548 aCurrentTab.GetAdjustment() = eAdj;
549 int nPos = FindCurrentTab();
552 aNewTabs->Remove(
nPos );
553 aNewTabs->Insert( aCurrentTab );
559 if (!rBox.get_active())
563 m_xFillChar->set_text(
"" );
564 m_xFillChar->set_sensitive(
false);
566 if (&rBox == m_xFillSpecial.get())
567 m_xFillChar->set_sensitive(
true);
568 else if (&rBox == m_xNoFillChar.get())
570 else if (&rBox == m_xFillSolidLine.get())
572 else if (&rBox == m_xFillPoints.get())
574 else if (&rBox == m_xFillDashLine.get())
577 aCurrentTab.GetFill() = cFill;
578 int nPos = FindCurrentTab();
581 aNewTabs->Remove(
nPos );
582 aNewTabs->Insert( aCurrentTab );
588 OUString aChar(m_xFillChar->get_text());
589 if ( !aChar.isEmpty() )
590 aCurrentTab.GetFill() = aChar[0];
592 const int nPos = FindCurrentTab();
595 aNewTabs->Remove(
nPos );
596 aNewTabs->Insert( aCurrentTab );
602 OUString aChar(m_xDezChar->get_text());
603 if ( !aChar.isEmpty() && ( aChar[0] >=
' '))
604 aCurrentTab.GetDecimal() = aChar[0];
606 const int nPos = FindCurrentTab();
609 aNewTabs->Remove(
nPos );
610 aNewTabs->Insert( aCurrentTab );
616 const int nPos = FindCurrentTab();
619 aCurrentTab = (*aNewTabs)[
nPos];
620 m_xNewBtn->set_sensitive(
false);
621 SetFillAndTabType_Impl();
635 m_xTabBox->set_entry_text(FormatTab());
640 const int nPos = FindCurrentTab();
643 aCurrentTab = (*aNewTabs)[
nPos];
644 SetFillAndTabType_Impl();
646 m_xTabSpin->set_text(m_xTabBox->get_active_text());
647 aCurrentTab.GetTabPos() = m_xTabSpin->denormalize(m_xTabSpin->get_value(
eDefUnit));
648 m_xNewBtn->set_sensitive(
false);
649 m_xDelBtn->set_sensitive(
true);
652 m_xNewBtn->set_sensitive(
true);
653 m_xDelBtn->set_sensitive(
false);
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
sal_uInt16 GetValue() const
const OUString & getNumDecimalSep() const
Size GetOutputSize() const
void DrawRect(const tools::Rectangle &rRect)
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
void setX(tools::Long nX)
void setY(tools::Long nY)
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 & GetDialogTextColor() const
const Color & GetShadowColor() const
const Color & GetDialogColor() 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)