bump product version to 6.4.0.3
[LibreOffice.git] / cui / source / tabpages / tptrans.cxx
blobac950ceb3a2ef27ca0e3e7fefb49943b5dff0391
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <svx/svxids.hrc>
22 #include <svx/xfillit0.hxx>
23 #include <svx/xflclit.hxx>
24 #include <svx/xflftrit.hxx>
25 #include <svx/xflgrit.hxx>
26 #include <svx/xflhtit.hxx>
27 #include <svx/xbtmpit.hxx>
28 #include <svx/xflbckit.hxx>
29 #include <svx/sdshtitm.hxx>
30 #include <svx/xfltrit.hxx>
31 #include <cuitabarea.hxx>
32 #include <svl/intitem.hxx>
34 using namespace com::sun::star;
36 const sal_uInt16 SvxTransparenceTabPage::pTransparenceRanges[] =
38 XATTR_FILLTRANSPARENCE,
39 XATTR_FILLTRANSPARENCE,
40 SDRATTR_SHADOWTRANSPARENCE,
41 SDRATTR_SHADOWTRANSPARENCE,
42 XATTR_FILLFLOATTRANSPARENCE,
43 XATTR_FILLFLOATTRANSPARENCE,
47 /*************************************************************************
49 |* Dialog for transparence
51 \************************************************************************/
53 IMPL_LINK_NOARG(SvxTransparenceTabPage, ClickTransOffHdl_Impl, weld::ToggleButton&, void)
55 // disable all other controls
56 ActivateLinear(false);
57 ActivateGradient(false);
59 // Preview
60 rXFSet.ClearItem(XATTR_FILLTRANSPARENCE);
61 rXFSet.ClearItem(XATTR_FILLFLOATTRANSPARENCE);
62 m_aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
63 m_aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() );
65 InvalidatePreview(false);
68 IMPL_LINK_NOARG(SvxTransparenceTabPage, ClickTransLinearHdl_Impl, weld::ToggleButton&, void)
70 // enable linear, disable other
71 ActivateLinear(true);
72 ActivateGradient(false);
74 // preview
75 rXFSet.ClearItem (XATTR_FILLFLOATTRANSPARENCE);
76 ModifyTransparentHdl_Impl(*m_xMtrTransparent);
79 IMPL_LINK_NOARG(SvxTransparenceTabPage, ClickTransGradientHdl_Impl, weld::ToggleButton&, void)
81 // enable gradient, disable other
82 ActivateLinear(false);
83 ActivateGradient(true);
85 // preview
86 rXFSet.ClearItem (XATTR_FILLTRANSPARENCE);
87 ModifiedTrgrHdl_Impl(nullptr);
90 SvxTransparenceTabPage::~SvxTransparenceTabPage()
94 void SvxTransparenceTabPage::ActivateLinear(bool bActivate)
96 m_xMtrTransparent->set_sensitive(bActivate);
99 IMPL_LINK_NOARG(SvxTransparenceTabPage, ModifyTransparentHdl_Impl, weld::MetricSpinButton&, void)
101 sal_uInt16 nPos = m_xMtrTransparent->get_value(FieldUnit::PERCENT);
102 rXFSet.Put(XFillTransparenceItem(nPos));
104 // preview
105 InvalidatePreview();
108 IMPL_LINK(SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl, weld::ComboBox&, rListBox, void)
110 ModifiedTrgrHdl_Impl(&rListBox);
113 IMPL_LINK_NOARG(SvxTransparenceTabPage, ModifiedTrgrEditHdl_Impl, weld::MetricSpinButton&, void)
115 ModifiedTrgrHdl_Impl(nullptr);
118 void SvxTransparenceTabPage::ModifiedTrgrHdl_Impl(const weld::ComboBox* pControl)
120 if (pControl == m_xLbTrgrGradientType.get())
122 css::awt::GradientStyle eXGS = static_cast<css::awt::GradientStyle>(m_xLbTrgrGradientType->get_active());
123 SetControlState_Impl( eXGS );
126 // preview
127 sal_uInt8 nStartCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrStartValue->get_value(FieldUnit::PERCENT)) * 255) / 100);
128 sal_uInt8 nEndCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrEndValue->get_value(FieldUnit::PERCENT)) * 255) / 100);
129 XGradient aTmpGradient(
130 Color(nStartCol, nStartCol, nStartCol),
131 Color(nEndCol, nEndCol, nEndCol),
132 static_cast<css::awt::GradientStyle>(m_xLbTrgrGradientType->get_active()),
133 static_cast<sal_uInt16>(m_xMtrTrgrAngle->get_value(FieldUnit::DEGREE)) * 10,
134 static_cast<sal_uInt16>(m_xMtrTrgrCenterX->get_value(FieldUnit::PERCENT)),
135 static_cast<sal_uInt16>(m_xMtrTrgrCenterY->get_value(FieldUnit::PERCENT)),
136 static_cast<sal_uInt16>(m_xMtrTrgrBorder->get_value(FieldUnit::PERCENT)),
137 100, 100);
139 XFillFloatTransparenceItem aItem( aTmpGradient);
140 rXFSet.Put ( aItem );
142 InvalidatePreview();
145 void SvxTransparenceTabPage::ActivateGradient(bool bActivate)
147 m_xGridGradient->set_sensitive(bActivate);
149 if (bActivate)
151 css::awt::GradientStyle eXGS = static_cast<css::awt::GradientStyle>(m_xLbTrgrGradientType->get_active());
152 SetControlState_Impl( eXGS );
156 void SvxTransparenceTabPage::SetControlState_Impl(css::awt::GradientStyle eXGS)
158 switch(eXGS)
160 case css::awt::GradientStyle_LINEAR:
161 case css::awt::GradientStyle_AXIAL:
162 m_xFtTrgrCenterX->set_sensitive(false);
163 m_xMtrTrgrCenterX->set_sensitive(false);
164 m_xFtTrgrCenterY->set_sensitive(false);
165 m_xMtrTrgrCenterY->set_sensitive(false);
166 m_xFtTrgrAngle->set_sensitive(true);
167 m_xMtrTrgrAngle->set_sensitive(true);
168 break;
170 case css::awt::GradientStyle_RADIAL:
171 m_xFtTrgrCenterX->set_sensitive(true);
172 m_xMtrTrgrCenterX->set_sensitive(true);
173 m_xFtTrgrCenterY->set_sensitive(true);
174 m_xMtrTrgrCenterY->set_sensitive(true);
175 m_xFtTrgrAngle->set_sensitive(false);
176 m_xMtrTrgrAngle->set_sensitive(false);
177 break;
179 case css::awt::GradientStyle_ELLIPTICAL:
180 case css::awt::GradientStyle_SQUARE:
181 case css::awt::GradientStyle_RECT:
182 m_xFtTrgrCenterX->set_sensitive(true);
183 m_xMtrTrgrCenterX->set_sensitive(true);
184 m_xFtTrgrCenterY->set_sensitive(true);
185 m_xMtrTrgrCenterY->set_sensitive(true);
186 m_xFtTrgrAngle->set_sensitive(true);
187 m_xMtrTrgrAngle->set_sensitive(true);
188 break;
189 default:
190 break;
194 SvxTransparenceTabPage::SvxTransparenceTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs)
195 : SfxTabPage(pPage, pController, "cui/ui/transparencytabpage.ui", "TransparencyTabPage", &rInAttrs)
196 , rOutAttrs(rInAttrs)
197 , nPageType(PageType::Area)
198 , nDlgType(0)
199 , bBitmap(false)
200 , aXFillAttr(rInAttrs.GetPool())
201 , rXFSet(aXFillAttr.GetItemSet())
202 , m_xRbtTransOff(m_xBuilder->weld_radio_button("RBT_TRANS_OFF"))
203 , m_xRbtTransLinear(m_xBuilder->weld_radio_button("RBT_TRANS_LINEAR"))
204 , m_xRbtTransGradient(m_xBuilder->weld_radio_button("RBT_TRANS_GRADIENT"))
205 , m_xMtrTransparent(m_xBuilder->weld_metric_spin_button("MTR_TRANSPARENT", FieldUnit::PERCENT))
206 , m_xGridGradient(m_xBuilder->weld_widget("gridGradient"))
207 , m_xLbTrgrGradientType(m_xBuilder->weld_combo_box("LB_TRGR_GRADIENT_TYPES"))
208 , m_xFtTrgrCenterX(m_xBuilder->weld_label("FT_TRGR_CENTER_X"))
209 , m_xMtrTrgrCenterX(m_xBuilder->weld_metric_spin_button("MTR_TRGR_CENTER_X", FieldUnit::PERCENT))
210 , m_xFtTrgrCenterY(m_xBuilder->weld_label("FT_TRGR_CENTER_Y"))
211 , m_xMtrTrgrCenterY(m_xBuilder->weld_metric_spin_button("MTR_TRGR_CENTER_Y", FieldUnit::PERCENT))
212 , m_xFtTrgrAngle(m_xBuilder->weld_label("FT_TRGR_ANGLE"))
213 , m_xMtrTrgrAngle(m_xBuilder->weld_metric_spin_button("MTR_TRGR_ANGLE", FieldUnit::DEGREE))
214 , m_xMtrTrgrBorder(m_xBuilder->weld_metric_spin_button("MTR_TRGR_BORDER", FieldUnit::PERCENT))
215 , m_xMtrTrgrStartValue(m_xBuilder->weld_metric_spin_button("MTR_TRGR_START_VALUE", FieldUnit::PERCENT))
216 , m_xMtrTrgrEndValue(m_xBuilder->weld_metric_spin_button("MTR_TRGR_END_VALUE", FieldUnit::PERCENT))
217 , m_xCtlBitmapBorder(m_xBuilder->weld_widget("bitmap_border"))
218 , m_xCtlXRectBorder(m_xBuilder->weld_widget("trans_border"))
219 , m_xCtlBitmapPreview(new weld::CustomWeld(*m_xBuilder, "CTL_BITMAP_PREVIEW", m_aCtlBitmapPreview))
220 , m_xCtlXRectPreview(new weld::CustomWeld(*m_xBuilder, "CTL_TRANS_PREVIEW", m_aCtlXRectPreview))
222 // main selection
223 m_xRbtTransOff->connect_toggled(LINK(this, SvxTransparenceTabPage, ClickTransOffHdl_Impl));
224 m_xRbtTransLinear->connect_toggled(LINK(this, SvxTransparenceTabPage, ClickTransLinearHdl_Impl));
225 m_xRbtTransGradient->connect_toggled(LINK(this, SvxTransparenceTabPage, ClickTransGradientHdl_Impl));
227 // linear transparency
228 m_xMtrTransparent->set_value(50, FieldUnit::PERCENT);
229 m_xMtrTransparent->connect_value_changed(LINK(this, SvxTransparenceTabPage, ModifyTransparentHdl_Impl));
231 // gradient transparency
232 m_xMtrTrgrEndValue->set_value(100, FieldUnit::PERCENT);
233 m_xMtrTrgrStartValue->set_value(0, FieldUnit::PERCENT);
234 Link<weld::MetricSpinButton&,void> aLink = LINK( this, SvxTransparenceTabPage, ModifiedTrgrEditHdl_Impl);
235 m_xLbTrgrGradientType->connect_changed(LINK(this, SvxTransparenceTabPage, ModifiedTrgrListBoxHdl_Impl));
236 m_xMtrTrgrCenterX->connect_value_changed( aLink );
237 m_xMtrTrgrCenterY->connect_value_changed( aLink );
238 m_xMtrTrgrAngle->connect_value_changed( aLink );
239 m_xMtrTrgrBorder->connect_value_changed( aLink );
240 m_xMtrTrgrStartValue->connect_value_changed( aLink );
241 m_xMtrTrgrEndValue->connect_value_changed( aLink );
243 // this page needs ExchangeSupport
244 SetExchangeSupport();
247 std::unique_ptr<SfxTabPage> SvxTransparenceTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rAttrs)
249 return std::make_unique<SvxTransparenceTabPage>(pPage, pController, *rAttrs);
252 bool SvxTransparenceTabPage::FillItemSet(SfxItemSet* rAttrs)
254 const SfxPoolItem* pGradientItem = nullptr;
255 const SfxPoolItem* pLinearItem = nullptr;
256 SfxItemState eStateGradient(rOutAttrs.GetItemState(XATTR_FILLFLOATTRANSPARENCE, true, &pGradientItem));
257 SfxItemState eStateLinear(rOutAttrs.GetItemState(XATTR_FILLTRANSPARENCE, true, &pLinearItem));
258 bool bGradActive = (eStateGradient == SfxItemState::SET && static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->IsEnabled());
259 bool bLinearActive = (eStateLinear == SfxItemState::SET && static_cast<const XFillTransparenceItem*>(pLinearItem)->GetValue() != 0);
261 bool bGradUsed = (eStateGradient == SfxItemState::DONTCARE);
262 bool bLinearUsed = (eStateLinear == SfxItemState::DONTCARE);
264 bool bModified(false);
265 bool bSwitchOffLinear(false);
266 bool bSwitchOffGradient(false);
268 if (m_xMtrTransparent->get_sensitive())
270 // linear transparence
271 sal_uInt16 nPos = m_xMtrTransparent->get_value(FieldUnit::PERCENT);
272 if (m_xMtrTransparent->get_value_changed_from_saved() || !bLinearActive)
274 XFillTransparenceItem aItem(nPos);
275 SdrPercentItem aShadowItem(makeSdrShadowTransparenceItem(nPos));
276 const SfxPoolItem* pOld = GetOldItem(*rAttrs, XATTR_FILLTRANSPARENCE);
277 if(!pOld || !(*static_cast<const XFillTransparenceItem*>(pOld) == aItem) || !bLinearActive)
279 rAttrs->Put(aItem);
280 rAttrs->Put(aShadowItem);
281 bModified = true;
282 bSwitchOffGradient = true;
286 else if (m_xGridGradient->get_sensitive())
288 // transparence gradient, fill ItemSet from values
289 if (!bGradActive
290 || m_xLbTrgrGradientType->get_value_changed_from_saved()
291 || m_xMtrTrgrAngle->get_value_changed_from_saved()
292 || m_xMtrTrgrCenterX->get_value_changed_from_saved()
293 || m_xMtrTrgrCenterY->get_value_changed_from_saved()
294 || m_xMtrTrgrBorder->get_value_changed_from_saved()
295 || m_xMtrTrgrStartValue->get_value_changed_from_saved()
296 || m_xMtrTrgrEndValue->get_value_changed_from_saved())
298 sal_uInt8 nStartCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrStartValue->get_value(FieldUnit::PERCENT)) * 255) / 100);
299 sal_uInt8 nEndCol = static_cast<sal_uInt8>((static_cast<sal_uInt16>(m_xMtrTrgrEndValue->get_value(FieldUnit::PERCENT)) * 255) / 100);
300 XGradient aTmpGradient(
301 Color(nStartCol, nStartCol, nStartCol),
302 Color(nEndCol, nEndCol, nEndCol),
303 static_cast<css::awt::GradientStyle>(m_xLbTrgrGradientType->get_active()),
304 static_cast<sal_uInt16>(m_xMtrTrgrAngle->get_value(FieldUnit::DEGREE)) * 10,
305 static_cast<sal_uInt16>(m_xMtrTrgrCenterX->get_value(FieldUnit::PERCENT)),
306 static_cast<sal_uInt16>(m_xMtrTrgrCenterY->get_value(FieldUnit::PERCENT)),
307 static_cast<sal_uInt16>(m_xMtrTrgrBorder->get_value(FieldUnit::PERCENT)),
308 100, 100);
310 XFillFloatTransparenceItem aItem(aTmpGradient);
311 const SfxPoolItem* pOld = GetOldItem(*rAttrs, XATTR_FILLFLOATTRANSPARENCE);
313 if(!pOld || !(*static_cast<const XFillFloatTransparenceItem*>(pOld) == aItem) || !bGradActive)
315 rAttrs->Put(aItem);
316 bModified = true;
317 bSwitchOffLinear = true;
321 else
323 // no transparence
324 bSwitchOffGradient = true;
325 bSwitchOffLinear = true;
328 // disable unused XFillFloatTransparenceItem
329 if(bSwitchOffGradient && (bGradActive || bGradUsed))
331 XGradient aGrad(COL_BLACK, COL_WHITE);
332 aGrad.SetStartIntens(100);
333 aGrad.SetEndIntens(100);
334 XFillFloatTransparenceItem aItem(aGrad);
335 aItem.SetEnabled(false);
336 rAttrs->Put(aItem);
337 bModified = true;
340 // disable unused XFillFloatTransparenceItem
341 if(bSwitchOffLinear && (bLinearActive || bLinearUsed))
343 XFillTransparenceItem aItem(0);
344 SdrPercentItem aShadowItem(makeSdrShadowTransparenceItem(0));
345 rAttrs->Put(aItem);
346 rAttrs->Put(aShadowItem);
347 bModified = true;
349 rAttrs->Put(CntUInt16Item(SID_PAGE_TYPE, static_cast<sal_uInt16>(nPageType)));
350 return bModified;
353 void SvxTransparenceTabPage::Reset(const SfxItemSet* rAttrs)
355 const SfxPoolItem* pGradientItem = nullptr;
356 SfxItemState eStateGradient(rAttrs->GetItemState(XATTR_FILLFLOATTRANSPARENCE, true, &pGradientItem));
357 if(!pGradientItem)
358 pGradientItem = &rAttrs->Get(XATTR_FILLFLOATTRANSPARENCE);
359 bool bGradActive = (eStateGradient == SfxItemState::SET && static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->IsEnabled());
361 const SfxPoolItem* pLinearItem = nullptr;
362 SfxItemState eStateLinear(rAttrs->GetItemState(XATTR_FILLTRANSPARENCE, true, &pLinearItem));
363 if(!pLinearItem)
364 pLinearItem = &rAttrs->Get(XATTR_FILLTRANSPARENCE);
365 bool bLinearActive = (eStateLinear == SfxItemState::SET && static_cast<const XFillTransparenceItem*>(pLinearItem)->GetValue() != 0);
367 // transparence gradient
368 const XGradient& rGradient = static_cast<const XFillFloatTransparenceItem*>(pGradientItem)->GetGradientValue();
369 css::awt::GradientStyle eXGS(rGradient.GetGradientStyle());
370 m_xLbTrgrGradientType->set_active(sal::static_int_cast< sal_Int32 >(eXGS));
371 m_xMtrTrgrAngle->set_value(rGradient.GetAngle() / 10, FieldUnit::DEGREE);
372 m_xMtrTrgrBorder->set_value(rGradient.GetBorder(), FieldUnit::PERCENT);
373 m_xMtrTrgrCenterX->set_value(rGradient.GetXOffset(), FieldUnit::PERCENT);
374 m_xMtrTrgrCenterY->set_value(rGradient.GetYOffset(), FieldUnit::PERCENT);
375 m_xMtrTrgrStartValue->set_value(static_cast<sal_uInt16>(((static_cast<sal_uInt16>(rGradient.GetStartColor().GetRed()) + 1) * 100) / 255), FieldUnit::PERCENT);
376 m_xMtrTrgrEndValue->set_value(static_cast<sal_uInt16>(((static_cast<sal_uInt16>(rGradient.GetEndColor().GetRed()) + 1) * 100) / 255), FieldUnit::PERCENT);
378 // linear transparence
379 sal_uInt16 nTransp = static_cast<const XFillTransparenceItem*>(pLinearItem)->GetValue();
380 m_xMtrTransparent->set_value(bLinearActive ? nTransp : 50, FieldUnit::PERCENT);
381 ModifyTransparentHdl_Impl(*m_xMtrTransparent);
383 // select the correct radio button
384 if(bGradActive)
386 // transparence gradient, set controls appropriate to item
387 m_xRbtTransGradient->set_active(true);
388 ClickTransGradientHdl_Impl(*m_xRbtTransGradient);
390 else if(bLinearActive)
392 // linear transparence
393 m_xRbtTransLinear->set_active(true);
394 ClickTransLinearHdl_Impl(*m_xRbtTransLinear);
396 else
398 // no transparence
399 m_xRbtTransOff->set_active(true);
400 ClickTransOffHdl_Impl(*m_xRbtTransOff);
401 ModifiedTrgrHdl_Impl(nullptr);
404 // save values
405 ChangesApplied();
406 bool bActive = InitPreview ( *rAttrs );
407 InvalidatePreview ( bActive );
410 void SvxTransparenceTabPage::ChangesApplied()
412 m_xMtrTransparent->save_value();
413 m_xLbTrgrGradientType->save_value();
414 m_xMtrTrgrCenterX->save_value();
415 m_xMtrTrgrCenterY->save_value();
416 m_xMtrTrgrAngle->save_value();
417 m_xMtrTrgrBorder->save_value();
418 m_xMtrTrgrStartValue->save_value();
419 m_xMtrTrgrEndValue->save_value();
422 void SvxTransparenceTabPage::ActivatePage(const SfxItemSet& rSet)
424 const CntUInt16Item* pPageTypeItem = rSet.GetItem<CntUInt16Item>(SID_PAGE_TYPE, false);
425 if (pPageTypeItem)
426 SetPageType(static_cast<PageType>(pPageTypeItem->GetValue()));
428 if(nDlgType == 0) // area dialog
429 nPageType = PageType::Transparence;
431 InitPreview ( rSet );
434 DeactivateRC SvxTransparenceTabPage::DeactivatePage(SfxItemSet* _pSet)
436 if( _pSet )
437 FillItemSet( _pSet );
438 return DeactivateRC::LeavePage;
441 // Preview-Methods
443 bool SvxTransparenceTabPage::InitPreview(const SfxItemSet& rSet)
445 // set transparencetype for preview
446 if (m_xRbtTransOff->get_active())
448 ClickTransOffHdl_Impl(*m_xRbtTransOff);
450 else if (m_xRbtTransLinear->get_active())
452 ClickTransLinearHdl_Impl(*m_xRbtTransLinear);
454 else if (m_xRbtTransGradient->get_active())
456 ClickTransGradientHdl_Impl(*m_xRbtTransGradient);
459 // Get fillstyle for preview
460 rXFSet.Put ( rSet.Get(XATTR_FILLSTYLE) );
461 rXFSet.Put ( rSet.Get(XATTR_FILLCOLOR) );
462 rXFSet.Put ( rSet.Get(XATTR_FILLGRADIENT) );
463 rXFSet.Put ( rSet.Get(XATTR_FILLHATCH) );
464 rXFSet.Put ( rSet.Get(XATTR_FILLBACKGROUND) );
465 rXFSet.Put ( rSet.Get(XATTR_FILLBITMAP) );
467 m_aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
468 m_aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() );
470 bBitmap = rSet.Get(XATTR_FILLSTYLE).GetValue() == drawing::FillStyle_BITMAP;
472 // show the right preview window
473 if ( bBitmap )
475 m_xCtlBitmapBorder->show();
476 m_xCtlXRectBorder->hide();
478 else
480 m_xCtlBitmapBorder->hide();
481 m_xCtlXRectBorder->show();
484 return !m_xRbtTransOff->get_active();
487 void SvxTransparenceTabPage::InvalidatePreview (bool bEnable)
489 if ( bBitmap )
491 if ( bEnable )
493 m_xCtlBitmapPreview->set_sensitive(true);
494 m_aCtlBitmapPreview.SetAttributes( aXFillAttr.GetItemSet() );
496 else
497 m_xCtlBitmapPreview->set_sensitive(false);
498 m_xCtlBitmapPreview->queue_draw();
500 else
502 if ( bEnable )
504 m_xCtlXRectPreview->set_sensitive(true);
505 m_aCtlXRectPreview.SetAttributes( aXFillAttr.GetItemSet() );
507 else
508 m_xCtlXRectPreview->set_sensitive(false);
509 m_xCtlXRectPreview->queue_draw();
513 void SvxTransparenceTabPage::PageCreated(const SfxAllItemSet& aSet)
515 const SfxUInt16Item* pPageTypeItem = aSet.GetItem<SfxUInt16Item>(SID_PAGE_TYPE, false);
516 const SfxUInt16Item* pDlgTypeItem = aSet.GetItem<SfxUInt16Item>(SID_DLG_TYPE, false);
518 if (pPageTypeItem)
519 SetPageType(static_cast<PageType>(pPageTypeItem->GetValue()));
520 if (pDlgTypeItem)
521 SetDlgType(pDlgTypeItem->GetValue());
524 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */