21#include <svx/svxids.hrc>
23#include <com/sun/star/lang/IllegalArgumentException.hpp>
44 :
PanelLayout(pParent,
"TextColumnsPropertyPanel",
"svx/ui/sidebartextcolumnspanel.ui")
45 , mpBindings(pBindings)
46 , m_xColumnsNumber(m_xBuilder->weld_spin_button(
"FLD_COL_NUMBER"))
47 , m_xColumnsSpacing(m_xBuilder->weld_metric_spin_button(
"MTR_FLD_COL_SPACING",
FieldUnit::
CM))
48 , maColumnsNumberController(SID_ATTR_TEXTCOLUMNS_NUMBER, *pBindings, *this)
49 , maColumnsSpacingController(SID_ATTR_TEXTCOLUMNS_SPACING, *pBindings, *this)
69 mpBindings->GetDispatcher()->ExecuteList(SID_ATTR_TEXTCOLUMNS_NUMBER, SfxCallMode::RECORD,
77 mpBindings->GetDispatcher()->ExecuteList(SID_ATTR_TEXTCOLUMNS_SPACING, SfxCallMode::RECORD,
86 case SID_ATTR_TEXTCOLUMNS_NUMBER:
87 if (eState >= SfxItemState::DEFAULT)
89 if (
const auto pItem =
dynamic_cast<const SfxInt16Item*
>(pState))
93 case SID_ATTR_TEXTCOLUMNS_SPACING:
94 if (eState >= SfxItemState::DEFAULT)
97 if (
const auto pItem =
dynamic_cast<const SdrMetricItem*
>(pState))
107 if (pParent ==
nullptr)
108 throw css::lang::IllegalArgumentException(
109 "no parent Window given to TextColumnsPropertyPanel::Create",
nullptr, 0);
110 if (pBindings ==
nullptr)
111 throw css::lang::IllegalArgumentException(
112 "no SfxBindings given to TextColumnsPropertyPanel::Create",
nullptr, 2);
114 return std::make_unique<TextColumnsPropertyPanel>(pParent, pBindings);
SfxApplication * SfxGetpApp()
SfxDispatcher * GetDispatcher() const
SfxShell * GetShell(sal_uInt16 nIdx) const
virtual MapUnit GetMetric(sal_uInt16 nWhich) const
virtual SfxObjectShell * GetObjectShell() override
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
SfxItemPool & GetPool() const
std::unique_ptr< weld::SpinButton > m_xColumnsNumber
std::unique_ptr< weld::MetricSpinButton > m_xColumnsSpacing
sfx2::sidebar::ControllerItem maColumnsNumberController
TextColumnsPropertyPanel(weld::Widget *pParent, SfxBindings *pBindings)
static std::unique_ptr< PanelLayout > Create(weld::Widget *pParent, SfxBindings *pBindings)
sfx2::sidebar::ControllerItem maColumnsSpacingController
virtual ~TextColumnsPropertyPanel() override
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem *pState) override
#define LINK(Instance, Class, Member)
constexpr TypedWhichId< SfxInt16Item > SDRATTR_TEXTCOLUMNS_NUMBER(SDRATTR_TEXTCOLUMNS_FIRST+0)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_TEXTCOLUMNS_SPACING(SDRATTR_TEXTCOLUMNS_FIRST+1)
SVT_DLLPUBLIC sal_Int64 GetCoreValue(const weld::MetricSpinButton &rField, MapUnit eUnit)
SVT_DLLPUBLIC void SetMetricValue(weld::MetricSpinButton &rField, sal_Int64 nCoreValue, MapUnit eUnit)