30#include <com/sun/star/lang/IllegalArgumentException.hpp>
33using namespace css::uno;
41 const css::uno::Reference<css::frame::XFrame>& rxFrame,
43 :
PanelLayout(pParent,
"AlignmentPropertyPanel",
"modules/scalc/ui/sidebaralignment.ui")
44 , mxFTLeftIndent(m_xBuilder->weld_label(
"leftindentlabel"))
45 , mxMFLeftIndent(m_xBuilder->weld_metric_spin_button(
"leftindent",
FieldUnit::
POINT))
46 , mxCBXWrapText(m_xBuilder->weld_check_button(
"wraptext"))
47 , mxCBXMergeCell(m_xBuilder->weld_check_button(
"mergecells"))
48 , mxFtRotate(m_xBuilder->weld_label(
"orientationlabel"))
49 , mxMtrAngle(m_xBuilder->weld_metric_spin_button(
"orientationdegrees",
FieldUnit::
DEGREE))
50 , mxRefEdgeBottom(m_xBuilder->weld_toggle_button(
"bottom"))
51 , mxRefEdgeTop(m_xBuilder->weld_toggle_button(
"top"))
52 , mxRefEdgeStd(m_xBuilder->weld_toggle_button(
"standard"))
53 , mxCBStacked(m_xBuilder->weld_check_button(
"stacked"))
54 , mxTextOrientBox(m_xBuilder->weld_widget(
"textorientbox"))
55 , mxHorizontalAlign(m_xBuilder->weld_toolbar(
"horizontalalignment"))
57 , mxVertAlign(m_xBuilder->weld_toolbar(
"verticalalignment"))
59 , mxWriteDirection(m_xBuilder->weld_toolbar(
"writedirection"))
61 , mxIndentButtons(m_xBuilder->weld_toolbar(
"indentbuttons"))
63 , maAlignHorControl(SID_H_ALIGNCELL, *pBindings, *this)
64 , maLeftIndentControl(SID_ATTR_ALIGN_INDENT, *pBindings, *this)
65 , maMergeCellControl(FID_MERGE_TOGGLE, *pBindings, *this)
66 , maWrapTextControl(SID_ATTR_ALIGN_LINEBREAK, *pBindings, *this)
67 , maAngleControl(SID_ATTR_ALIGN_DEGREES, *pBindings, *this)
68 , maVrtStackControl(SID_ATTR_ALIGN_STACKED, *pBindings, *this)
69 , maRefEdgeControl(SID_ATTR_ALIGN_LOCKPOS, *pBindings, *this)
70 , mbMultiDisable(false)
71 , mpBindings(pBindings)
132 if (&rToggle == mxRefEdgeBottom.get())
134 else if (&rToggle == mxRefEdgeTop.get())
145 SfxCallMode::RECORD, { &aItem });
150 Degree100 nAngle(mxMtrAngle->get_value(FieldUnit::DEGREE) * 100);
154 SID_ATTR_ALIGN_DEGREES, SfxCallMode::RECORD, { &aAngleItem });
159 bool bVertical = mxCBStacked->get_active();
162 SID_ATTR_ALIGN_STACKED, SfxCallMode::RECORD, { &aStackItem });
167 sal_uInt16 nVal = mxMFLeftIndent->get_value(FieldUnit::NONE);
171 SfxCallMode::RECORD, { &aItem });
176 bool bState = mxCBXMergeCell->get_active();
187 bool bState = mxCBXWrapText->get_active();
190 SfxCallMode::RECORD, { &aItem });
195 const css::uno::Reference<css::frame::XFrame>& rxFrame,
198 if (pParent ==
nullptr)
199 throw lang::IllegalArgumentException(
"no parent Window given to AlignmentPropertyPanel::Create",
nullptr, 0);
201 throw lang::IllegalArgumentException(
"no XFrame given to AlignmentPropertyPanel::Create",
nullptr, 1);
202 if (pBindings ==
nullptr)
203 throw lang::IllegalArgumentException(
"no SfxBindings given to AlignmentPropertyPanel::Create",
nullptr, 2);
205 return std::make_unique<AlignmentPropertyPanel>(pParent, rxFrame, pBindings);
227 case SID_H_ALIGNCELL:
230 if(eState >= SfxItemState::DEFAULT)
232 meHorAlignState = pItem->GetValue();
234 if( meHorAlignState == SvxCellHorJustify::Repeat )
245 mxFTLeftIndent->set_sensitive( meHorAlignState == SvxCellHorJustify::Left );
246 mxMFLeftIndent->set_sensitive( meHorAlignState == SvxCellHorJustify::Left );
249 case SID_ATTR_ALIGN_INDENT:
250 if(eState >= SfxItemState::DEFAULT &&
dynamic_cast<const SfxUInt16Item*
>( pState) )
253 sal_uInt16 nVal = pItem->
GetValue();
262 case FID_MERGE_TOGGLE:
263 if(eState >= SfxItemState::DEFAULT &&
dynamic_cast<const SfxBoolItem*
>( pState) )
276 case SID_ATTR_ALIGN_LINEBREAK:
277 if(eState == SfxItemState::DISABLED)
285 if(eState >= SfxItemState::DEFAULT &&
dynamic_cast<const ScLineBreakCell*
>( pState) )
290 else if(eState == SfxItemState::DONTCARE)
296 case SID_ATTR_ALIGN_STACKED:
297 if (eState >= SfxItemState::DEFAULT)
311 case SID_ATTR_ALIGN_LOCKPOS:
312 if( eState >= SfxItemState::DEFAULT)
321 case SID_ATTR_ALIGN_DEGREES:
322 if (eState >= SfxItemState::DEFAULT)
sal_uInt16 GetValue() const
SfxDispatcher * GetDispatcher() const
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
virtual SfxBindings & GetBindings() override
#define LINK(Instance, Class, Member)
constexpr TypedWhichId< SvxRotateModeItem > ATTR_ROTATE_MODE(136)
SVT_DLLPUBLIC tools::Long CalcToPoint(tools::Long nIn, MapUnit eUnit, sal_uInt16 nFactor)
SVT_DLLPUBLIC tools::Long CalcToUnit(float nIn, MapUnit eUnit)