14#include <svx/svxids.hrc>
27using namespace css::uno;
34:
PanelLayout(pParent,
"ShadowPropertyPanel",
"svx/ui/sidebarshadow.ui"),
35 maShadowController(SID_ATTR_FILL_SHADOW, *pBindings, *this),
36 maShadowTransController(SID_ATTR_SHADOW_TRANSPARENCE, *pBindings, *this),
37 maShadowBlurController(SID_ATTR_SHADOW_BLUR, *pBindings, *this),
38 maShadowColorController(SID_ATTR_SHADOW_COLOR, *pBindings, *this),
39 maShadowXDistanceController(SID_ATTR_SHADOW_XDISTANCE, *pBindings, *this),
40 maShadowYDistanceController(SID_ATTR_SHADOW_YDISTANCE, *pBindings, *this),
41 mpBindings(pBindings),
45 mxShowShadow(m_xBuilder->weld_check_button(
"SHOW_SHADOW")),
46 mxShadowDistance(m_xBuilder->weld_metric_spin_button(
"LB_DISTANCE",
FieldUnit::
POINT)),
47 mxLBShadowColor(new
ColorListBox(m_xBuilder->weld_menu_button(
"LB_SHADOW_COLOR"), [this]{
return GetFrameWeld(); })),
48 mxShadowAngle(m_xBuilder->weld_combo_box(
"LB_ANGLE")),
49 mxFTAngle(m_xBuilder->weld_label(
"angle")),
50 mxFTDistance(m_xBuilder->weld_label(
"distance")),
51 mxFTTransparency(m_xBuilder->weld_label(
"transparency_label")),
52 mxFTBlur(m_xBuilder->weld_label(
"blur_label")),
53 mxFTColor(m_xBuilder->weld_label(
"shadowcolorlabel")),
54 mxShadowTransSlider(m_xBuilder->weld_scale(
"transparency_slider")),
55 mxShadowTransMetric(m_xBuilder->weld_metric_spin_button(
"FIELD_TRANSPARENCY", FieldUnit::PERCENT)),
56 mxShadowBlurMetric(m_xBuilder->weld_metric_spin_button(
"LB_SHADOW_BLUR", FieldUnit::POINT))
105 SfxCallMode::RECORD, { &aItem });
117 SfxCallMode::RECORD, { &aItem });
119 if (mxShadowDistance->get_value(FieldUnit::POINT) == 0)
120 mxShadowDistance->set_value( 8, FieldUnit::POINT );
134 SfxCallMode::RECORD, { &aItem });
139 sal_uInt16 nVal = mxShadowTransMetric->get_value(FieldUnit::PERCENT);
140 SetTransparencyValue(nVal);
143 SfxCallMode::RECORD, { &aItem });
150 mpBindings->GetDispatcher()->ExecuteList(SID_ATTR_SHADOW_BLUR, SfxCallMode::RECORD, { &aItem });
155 sal_uInt16 nVal = mxShadowTransSlider->get_value();
156 SetTransparencyValue(nVal);
159 SfxCallMode::RECORD, { &aItem });
164 ModifyShadowDistance();
169 ModifyShadowDistance();
178 case 0:
nX =
nXY;
nY = 0;
break;
180 case 90:
nX = 0;
nY = -
nXY;
break;
181 case 135:
nX =
nY = -
nXY;
break;
182 case 180:
nX = -
nXY;
nY = 0;
break;
184 case 270:
nX = 0;
nY =
nXY;
break;
185 case 315:
nX =
nY =
nXY;
break;
190 SfxCallMode::RECORD, { &aXItem });
192 SfxCallMode::RECORD, { &aYItem });
269 case SID_ATTR_FILL_SHADOW:
271 if(eState >= SfxItemState::DEFAULT)
282 case SID_ATTR_SHADOW_TRANSPARENCE:
284 if(eState >= SfxItemState::DEFAULT)
287 if(pTransparencyItem)
289 const sal_uInt16 nVal = pTransparencyItem->
GetValue();
297 case SID_ATTR_SHADOW_BLUR:
299 if (eState >= SfxItemState::DEFAULT)
309 case SID_ATTR_SHADOW_COLOR:
311 if(eState >= SfxItemState::DEFAULT)
321 case SID_ATTR_SHADOW_XDISTANCE:
323 if(eState >= SfxItemState::DEFAULT)
333 case SID_ATTR_SHADOW_YDISTANCE:
335 if(eState >= SfxItemState::DEFAULT)
353 if(pParent ==
nullptr)
354 throw lang::IllegalArgumentException(
"no parent Window given to ShadowPropertyPanel::Create",
nullptr, 0);
355 if(pBindings ==
nullptr)
356 throw lang::IllegalArgumentException(
"no SfxBindings given to ShadowPropertyPanel::Create",
nullptr, 2);
358 return std::make_unique<ShadowPropertyPanel>(pParent, pBindings);
const LocaleDataWrapper & GetLocaleDataWrapper() const
static const AllSettings & GetSettings()
sal_Int32 GetValue() const
sal_uInt16 GetValue() const
OUString getNum(sal_Int64 nNumber, sal_uInt16 nDecimals, bool bUseThousandSep=true, bool bTrailingZeros=true) const
virtual weld::Window * GetFrameWeld() const
SfxDispatcher * GetDispatcher() const
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 * >())
const Color & GetColorValue() const
virtual SfxBindings & GetBindings() override
#define LINK(Instance, Class, Member)
XColorItem makeSdrShadowColorItem(const Color &rTheColor)
SdrOnOffItem makeSdrShadowItem(bool bShadow)
SdrPercentItem makeSdrShadowTransparenceItem(sal_uInt16 nTransp)
SdrMetricItem makeSdrShadowXDistItem(tools::Long nDist)
SdrMetricItem makeSdrShadowYDistItem(tools::Long nDist)
constexpr TypedWhichId< SdrMetricItem > SDRATTR_SHADOWBLUR(SDRATTR_SHADOW_FIRST+9)