1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22 #include <sfx2/sidebar/ResourceDefinitions.hrc>
23 #include <sfx2/sidebar/Theme.hxx>
24 #include <sfx2/sidebar/ControlFactory.hxx>
25 #include <sfx2/sidebar/Layouter.hxx>
26 #include <GraphicPropertyPanel.hxx>
27 #include <GraphicPropertyPanel.hrc>
28 #include <svx/dialogs.hrc>
29 #include <svx/dialmgr.hxx>
30 #include <vcl/field.hxx>
31 #include <vcl/lstbox.hxx>
32 #include <svl/intitem.hxx>
33 #include <sfx2/bindings.hxx>
34 #include <sfx2/dispatch.hxx>
35 #include "svx/dialogs.hrc"
36
37 using namespace css;
38 using namespace cssu;
39 using ::sfx2::sidebar::Layouter;
40 using ::sfx2::sidebar::Theme;
41
42 #define A2S(pString) (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(pString)))
43
44 //////////////////////////////////////////////////////////////////////////////
45
46
47 namespace svx { namespace sidebar {
48
49 //////////////////////////////////////////////////////////////////////////////
50
GraphicPropertyPanel(Window * pParent,const cssu::Reference<css::frame::XFrame> & rxFrame,SfxBindings * pBindings)51 GraphicPropertyPanel::GraphicPropertyPanel(
52 Window* pParent,
53 const cssu::Reference<css::frame::XFrame>& rxFrame,
54 SfxBindings* pBindings)
55 : Control(
56 pParent,
57 SVX_RES(RID_SIDEBAR_GRAPHIC_PANEL)),
58 mpFtBrightness(new FixedText(this, SVX_RES(FT_BRIGHTNESS))),
59 mpMtrBrightness(new MetricField(this, SVX_RES(MTR_BRIGHTNESS))),
60 mpFtContrast(new FixedText(this, SVX_RES(FT_CONTRAST))),
61 mpMtrContrast(new MetricField(this, SVX_RES(MTR_CONTRAST))),
62 mpFtColorMode(new FixedText(this, SVX_RES(FT_COLOR_MODE))),
63 mpLBColorMode(new ListBox(this, SVX_RES(LB_COLOR_MODE))),
64 mpFtTrans(new FixedText(this, SVX_RES(FT_TRANSPARENT))),
65 mpMtrTrans(new MetricField(this, SVX_RES(MTR_TRANSPARENT))),
66 mpMtrRed(new MetricField(this, SVX_RES(MF_RED))),
67 mpMtrGreen(new MetricField(this, SVX_RES(MF_GREEN))),
68 mpMtrBlue(new MetricField(this, SVX_RES(MF_BLUE))),
69 mpMtrGamma(new MetricField(this, SVX_RES(MF_GAMMA))),
70 maBrightControl(SID_ATTR_GRAF_LUMINANCE, *pBindings, *this),
71 maContrastControl(SID_ATTR_GRAF_CONTRAST, *pBindings, *this),
72 maTransparenceControl(SID_ATTR_GRAF_TRANSPARENCE, *pBindings, *this),
73 maRedControl(SID_ATTR_GRAF_RED, *pBindings, *this),
74 maGreenControl(SID_ATTR_GRAF_GREEN, *pBindings, *this),
75 maBlueControl(SID_ATTR_GRAF_BLUE, *pBindings, *this),
76 maGammaControl(SID_ATTR_GRAF_GAMMA, *pBindings, *this),
77 maModeControl(SID_ATTR_GRAF_MODE, *pBindings, *this),
78 maImgRed(this, SVX_RES(IMG_RED)),
79 maImgGreen(this, SVX_RES(IMG_GREEN)),
80 maImgBlue(this, SVX_RES(IMG_BLUE)),
81 maImgGamma(this, SVX_RES(IMG_GAMMA)),
82 mxFrame(rxFrame),
83 mpBindings(pBindings),
84 maLayouter(*this)
85 {
86 Initialize();
87 FreeResource();
88
89 // Setup the grid layouter.
90 maLayouter.GetCell(0,0).SetControl(*mpFtBrightness).SetGridWidth(2);
91 maLayouter.GetCell(1,0).SetControl(*mpMtrBrightness).SetGridWidth(2);
92
93 maLayouter.GetCell(0,3).SetControl(*mpFtContrast).SetGridWidth(2);
94 maLayouter.GetCell(1,3).SetControl(*mpMtrContrast).SetGridWidth(2);
95
96 maLayouter.GetCell(2,0).SetControl(*mpFtColorMode).SetGridWidth(2);
97 maLayouter.GetCell(3,0).SetControl(*mpLBColorMode).SetGridWidth(2);
98
99 maLayouter.GetCell(2,3).SetControl(*mpFtTrans).SetGridWidth(2);
100 maLayouter.GetCell(3,3).SetControl(*mpMtrTrans).SetGridWidth(2);
101
102 maLayouter.GetCell(4,0).SetControl(maImgRed).SetFixedWidth();
103 maLayouter.GetCell(4,1).SetControl(*mpMtrRed);
104
105 maLayouter.GetCell(5,0).SetControl(maImgBlue).SetFixedWidth();
106 maLayouter.GetCell(5,1).SetControl(*mpMtrBlue);
107
108 maLayouter.GetCell(4,3).SetControl(maImgGreen).SetFixedWidth();
109 maLayouter.GetCell(4,4).SetControl(*mpMtrGreen);
110 maLayouter.GetCell(5,3).SetControl(maImgGamma).SetFixedWidth();
111 maLayouter.GetCell(5,4).SetControl(*mpMtrGamma);
112
113 maLayouter.GetColumn(0)
114 .SetWeight(0)
115 .SetLeftPadding(Layouter::MapWidth(*this,SECTIONPAGE_MARGIN_HORIZONTAL));
116 maLayouter.GetColumn(1)
117 .SetWeight(1)
118 .SetMinimumWidth(Layouter::MapWidth(*this, MBOX_WIDTH - 10));
119 maLayouter.GetColumn(2)
120 .SetWeight(0)
121 .SetMinimumWidth(Layouter::MapWidth(*this, CONTROL_SPACING_HORIZONTAL));
122 maLayouter.GetColumn(3)
123 .SetWeight(0);
124 maLayouter.GetColumn(4)
125 .SetWeight(1)
126 .SetMinimumWidth(Layouter::MapWidth(*this, MBOX_WIDTH - 10))
127 .SetRightPadding(Layouter::MapWidth(*this,SECTIONPAGE_MARGIN_HORIZONTAL));
128
129 // Make controls that display text handle short widths more
130 // graceful.
131 Layouter::PrepareForLayouting(*mpFtBrightness);
132 Layouter::PrepareForLayouting(*mpFtContrast);
133 Layouter::PrepareForLayouting(*mpFtColorMode);
134 Layouter::PrepareForLayouting(*mpFtTrans);
135 }
136
137 //////////////////////////////////////////////////////////////////////////////
138
~GraphicPropertyPanel()139 GraphicPropertyPanel::~GraphicPropertyPanel()
140 {
141 }
142
143 //////////////////////////////////////////////////////////////////////////////
144
Initialize()145 void GraphicPropertyPanel::Initialize()
146 {
147 mpFtBrightness->SetBackground(Wallpaper());
148 mpFtContrast->SetBackground(Wallpaper());
149 mpFtColorMode->SetBackground(Wallpaper());
150 mpFtTrans->SetBackground(Wallpaper());
151
152 mpMtrBrightness->SetModifyHdl( LINK( this, GraphicPropertyPanel, ModifyBrightnessHdl ) );
153 mpMtrBrightness->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Brightness")));
154 mpMtrContrast->SetModifyHdl( LINK( this, GraphicPropertyPanel, ModifyContrastHdl ) );
155 mpMtrContrast->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Contrast")));
156 mpMtrTrans->SetModifyHdl( LINK( this, GraphicPropertyPanel, ModifyTransHdl ) );
157 mpMtrTrans->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Transparency")));
158
159 mpLBColorMode->InsertEntry(String(SVX_RES(RID_SVXSTR_GRAFMODE_STANDARD)));
160 mpLBColorMode->InsertEntry(String(SVX_RES(RID_SVXSTR_GRAFMODE_GREYS)));
161 mpLBColorMode->InsertEntry(String(SVX_RES(RID_SVXSTR_GRAFMODE_MONO)));
162 mpLBColorMode->InsertEntry(String(SVX_RES(RID_SVXSTR_GRAFMODE_WATERMARK)));
163 mpLBColorMode->SetSelectHdl( LINK( this, GraphicPropertyPanel, ClickColorModeHdl ));
164 mpLBColorMode->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Color mode")));
165
166 mpMtrRed->SetModifyHdl( LINK( this, GraphicPropertyPanel, RedHdl ) );
167 mpMtrGreen->SetModifyHdl( LINK( this, GraphicPropertyPanel, GreenHdl ) );
168 mpMtrBlue->SetModifyHdl( LINK( this, GraphicPropertyPanel, BlueHdl ) );
169 mpMtrGamma->SetModifyHdl( LINK( this, GraphicPropertyPanel, GammaHdl ) );
170 mpMtrRed->SetAccessibleName(mpMtrRed->GetQuickHelpText());
171 mpMtrGreen->SetAccessibleName(mpMtrGreen->GetQuickHelpText());
172 mpMtrBlue->SetAccessibleName(mpMtrBlue->GetQuickHelpText());
173 mpMtrGamma->SetAccessibleName(::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("Gamma value")));
174
175 mpMtrRed->SetAccessibleRelationLabeledBy(mpMtrRed.get());
176 mpMtrGreen->SetAccessibleRelationLabeledBy(mpMtrGreen.get());
177 mpMtrBlue->SetAccessibleRelationLabeledBy(mpMtrBlue.get());
178 mpMtrGamma->SetAccessibleRelationLabeledBy(mpMtrGamma.get());
179 mpMtrBrightness->SetAccessibleRelationLabeledBy(mpFtBrightness.get());
180 mpMtrContrast->SetAccessibleRelationLabeledBy(mpFtContrast.get());
181 mpMtrTrans->SetAccessibleRelationLabeledBy(mpFtTrans.get());
182 mpLBColorMode->SetAccessibleRelationLabeledBy(mpFtColorMode.get());
183
184 // Fix left position of some controls that may be wrong due to
185 // rounding errors.
186 const sal_Int32 nRight0 (mpLBColorMode->GetPosPixel().X() + mpLBColorMode->GetSizePixel().Width());
187 const sal_Int32 nRight1 (mpMtrTrans->GetPosPixel().X() + mpMtrTrans->GetSizePixel().Width());
188 mpMtrRed->SetPosPixel(Point(
189 nRight0 - mpMtrRed->GetSizePixel().Width(),
190 mpMtrRed->GetPosPixel().Y()));
191 mpMtrBlue->SetPosPixel(Point(
192 nRight0 - mpMtrBlue->GetSizePixel().Width(),
193 mpMtrBlue->GetPosPixel().Y()));
194 mpMtrGreen->SetPosPixel(Point(
195 nRight1 - mpMtrGreen->GetSizePixel().Width(),
196 mpMtrGreen->GetPosPixel().Y()));
197 mpMtrGamma->SetPosPixel(Point(
198 nRight1 - mpMtrGamma->GetSizePixel().Width(),
199 mpMtrGamma->GetPosPixel().Y()));
200 }
201
202
203
204
205 //////////////////////////////////////////////////////////////////////////////
206
IMPL_LINK(GraphicPropertyPanel,ModifyBrightnessHdl,void *,EMPTYARG)207 IMPL_LINK( GraphicPropertyPanel, ModifyBrightnessHdl, void *, EMPTYARG )
208 {
209 const sal_Int16 nBright = mpMtrBrightness->GetValue();
210 const SfxInt16Item aBrightItem( SID_ATTR_GRAF_LUMINANCE, nBright );
211 GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_LUMINANCE, SFX_CALLMODE_RECORD, &aBrightItem, 0L);
212 return 0L;
213 }
214
215 //////////////////////////////////////////////////////////////////////////////
216
IMPL_LINK(GraphicPropertyPanel,ModifyContrastHdl,void *,EMPTYARG)217 IMPL_LINK( GraphicPropertyPanel, ModifyContrastHdl, void *, EMPTYARG )
218 {
219 const sal_Int16 nContrast = mpMtrContrast->GetValue();
220 const SfxInt16Item aContrastItem( SID_ATTR_GRAF_CONTRAST, nContrast );
221 GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_CONTRAST, SFX_CALLMODE_RECORD, &aContrastItem, 0L);
222 return 0L;
223 }
224
225 //////////////////////////////////////////////////////////////////////////////
226
IMPL_LINK(GraphicPropertyPanel,ModifyTransHdl,void *,EMPTYARG)227 IMPL_LINK( GraphicPropertyPanel, ModifyTransHdl, void *, EMPTYARG )
228 {
229 const sal_Int16 nTrans = mpMtrTrans->GetValue();
230 const SfxInt16Item aTransItem( SID_ATTR_GRAF_TRANSPARENCE, nTrans );
231 GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_TRANSPARENCE, SFX_CALLMODE_RECORD, &aTransItem, 0L);
232 return 0L;
233 }
234
235 //////////////////////////////////////////////////////////////////////////////
236
237 IMPL_LINK( GraphicPropertyPanel, ClickColorModeHdl, ToolBox *, /* pBox */)
238 {
239 const sal_Int16 nTrans = mpLBColorMode->GetSelectEntryPos();
240 const SfxInt16Item aTransItem( SID_ATTR_GRAF_MODE, nTrans );
241 GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_MODE, SFX_CALLMODE_RECORD, &aTransItem, 0L);
242 return 0L;
243 }
244
245 //////////////////////////////////////////////////////////////////////////////
246
IMPL_LINK(GraphicPropertyPanel,RedHdl,void *,EMPTYARG)247 IMPL_LINK( GraphicPropertyPanel, RedHdl, void*, EMPTYARG )
248 {
249 const sal_Int16 nRed = mpMtrRed->GetValue();
250 const SfxInt16Item aRedItem( SID_ATTR_GRAF_RED, nRed );
251 GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_RED, SFX_CALLMODE_RECORD, &aRedItem, 0L);
252 return 0L;
253 }
254
255 //////////////////////////////////////////////////////////////////////////////
256
IMPL_LINK(GraphicPropertyPanel,GreenHdl,void *,EMPTYARG)257 IMPL_LINK( GraphicPropertyPanel, GreenHdl, void*, EMPTYARG )
258 {
259 const sal_Int16 nGreen = mpMtrGreen->GetValue();
260 const SfxInt16Item aGreenItem( SID_ATTR_GRAF_GREEN, nGreen );
261 GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_GREEN, SFX_CALLMODE_RECORD, &aGreenItem, 0L);
262 return 0L;
263 }
264
265 //////////////////////////////////////////////////////////////////////////////
266
IMPL_LINK(GraphicPropertyPanel,BlueHdl,void *,EMPTYARG)267 IMPL_LINK(GraphicPropertyPanel, BlueHdl, void *, EMPTYARG)
268 {
269 const sal_Int16 nBlue = mpMtrBlue->GetValue();
270 const SfxInt16Item aBlueItem( SID_ATTR_GRAF_BLUE, nBlue );
271 GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_BLUE, SFX_CALLMODE_RECORD, &aBlueItem, 0L);
272 return 0L;
273 }
274
275 //////////////////////////////////////////////////////////////////////////////
276
IMPL_LINK(GraphicPropertyPanel,GammaHdl,void *,EMPTYARG)277 IMPL_LINK(GraphicPropertyPanel, GammaHdl, void *, EMPTYARG)
278 {
279 const sal_Int32 nGamma = mpMtrGamma->GetValue();
280 const SfxInt32Item nGammaItem( SID_ATTR_GRAF_GAMMA, nGamma );
281 GetBindings()->GetDispatcher()->Execute(SID_ATTR_GRAF_GAMMA, SFX_CALLMODE_RECORD, &nGammaItem, 0L);
282 return 0L;
283 }
284
285 //////////////////////////////////////////////////////////////////////////////
286
SetupIcons(void)287 void GraphicPropertyPanel::SetupIcons(void)
288 {
289 if(Theme::GetBoolean(Theme::Bool_UseSymphonyIcons))
290 {
291 // todo
292 }
293 else
294 {
295 // todo
296 }
297 }
298
299 //////////////////////////////////////////////////////////////////////////////
300
Create(Window * pParent,const cssu::Reference<css::frame::XFrame> & rxFrame,SfxBindings * pBindings)301 GraphicPropertyPanel* GraphicPropertyPanel::Create (
302 Window* pParent,
303 const cssu::Reference<css::frame::XFrame>& rxFrame,
304 SfxBindings* pBindings)
305 {
306 if (pParent == NULL)
307 throw lang::IllegalArgumentException(A2S("no parent Window given to GraphicPropertyPanel::Create"), NULL, 0);
308 if ( ! rxFrame.is())
309 throw lang::IllegalArgumentException(A2S("no XFrame given to GraphicPropertyPanel::Create"), NULL, 1);
310 if (pBindings == NULL)
311 throw lang::IllegalArgumentException(A2S("no SfxBindings given to GraphicPropertyPanel::Create"), NULL, 2);
312
313 return new GraphicPropertyPanel(
314 pParent,
315 rxFrame,
316 pBindings);
317 }
318
319 //////////////////////////////////////////////////////////////////////////////
320
DataChanged(const DataChangedEvent & rEvent)321 void GraphicPropertyPanel::DataChanged(
322 const DataChangedEvent& rEvent)
323 {
324 (void)rEvent;
325
326 SetupIcons();
327 }
328
329 //////////////////////////////////////////////////////////////////////////////
330
NotifyItemUpdate(sal_uInt16 nSID,SfxItemState eState,const SfxPoolItem * pState,const bool bIsEnabled)331 void GraphicPropertyPanel::NotifyItemUpdate(
332 sal_uInt16 nSID,
333 SfxItemState eState,
334 const SfxPoolItem* pState,
335 const bool bIsEnabled)
336 {
337 (void)bIsEnabled;
338
339 switch( nSID )
340 {
341 case SID_ATTR_GRAF_LUMINANCE:
342 {
343 if(eState >= SFX_ITEM_AVAILABLE)
344 {
345 mpMtrBrightness->Enable();
346 const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
347
348 if(pItem)
349 {
350 const sal_Int64 nBright = pItem->GetValue();
351 mpMtrBrightness->SetValue(nBright);
352 }
353 }
354 else if(SFX_ITEM_DISABLED == eState)
355 {
356 mpMtrBrightness->Disable();
357 }
358 else
359 {
360 mpMtrBrightness->Enable();
361 mpMtrBrightness->SetText(String());
362 }
363 break;
364 }
365 case SID_ATTR_GRAF_CONTRAST:
366 {
367 if(eState >= SFX_ITEM_AVAILABLE)
368 {
369 mpMtrContrast->Enable();
370 const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
371
372 if(pItem)
373 {
374 const sal_Int64 nContrast = pItem->GetValue();
375 mpMtrContrast->SetValue(nContrast);
376 }
377 }
378 else if(SFX_ITEM_DISABLED == eState)
379 {
380 mpMtrContrast->Disable();
381 }
382 else
383 {
384 mpMtrContrast->Enable();
385 mpMtrContrast->SetText(String());
386 }
387 break;
388 }
389 case SID_ATTR_GRAF_TRANSPARENCE:
390 {
391 if(eState >= SFX_ITEM_AVAILABLE)
392 {
393 mpMtrTrans->Enable();
394 const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState);
395
396 if(pItem)
397 {
398 const sal_Int64 nTrans = pItem->GetValue();
399 mpMtrTrans->SetValue(nTrans);
400 }
401 }
402 else if(SFX_ITEM_DISABLED == eState)
403 {
404 mpMtrTrans->Disable();
405 }
406 else
407 {
408 mpMtrTrans->Enable();
409 mpMtrTrans->SetText(String());
410 }
411 break;
412 }
413 case SID_ATTR_GRAF_MODE:
414 {
415 if(eState >= SFX_ITEM_AVAILABLE)
416 {
417 mpLBColorMode->Enable();
418 const SfxUInt16Item* pItem = dynamic_cast< const SfxUInt16Item* >(pState);
419
420 if(pItem)
421 {
422 const sal_Int64 nTrans = pItem->GetValue();
423 mpLBColorMode->SelectEntryPos(nTrans);
424 }
425 }
426 else if(SFX_ITEM_DISABLED == eState)
427 {
428 mpLBColorMode->Disable();
429 }
430 else
431 {
432 mpLBColorMode->Enable();
433 mpLBColorMode->SetNoSelection();
434 }
435 break;
436 }
437 case SID_ATTR_GRAF_RED:
438 {
439 if(eState >= SFX_ITEM_AVAILABLE)
440 {
441 mpMtrRed->Enable();
442 const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
443
444 if(pItem)
445 {
446 const sal_Int64 nRed = pItem->GetValue();
447 mpMtrRed->SetValue( nRed );
448 }
449 }
450 else if(SFX_ITEM_DISABLED == eState)
451 {
452 mpMtrRed->Disable();
453 }
454 else
455 {
456 mpMtrRed->Enable();
457 mpMtrRed->SetText(String());
458 }
459 break;
460 }
461 case SID_ATTR_GRAF_GREEN:
462 {
463 if(eState >= SFX_ITEM_AVAILABLE)
464 {
465 mpMtrGreen->Enable();
466 const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
467
468 if(pItem)
469 {
470 const sal_Int64 nGreen = pItem->GetValue();
471 mpMtrGreen->SetValue( nGreen );
472 }
473 }
474 else if(SFX_ITEM_DISABLED == eState)
475 {
476 mpMtrGreen->Disable();
477 }
478 else
479 {
480 mpMtrGreen->Enable();
481 mpMtrGreen->SetText(String());
482 }
483 break;
484 }
485 case SID_ATTR_GRAF_BLUE:
486 {
487 if(eState >= SFX_ITEM_AVAILABLE)
488 {
489 mpMtrBlue->Enable();
490 const SfxInt16Item* pItem = dynamic_cast< const SfxInt16Item* >(pState);
491
492 if(pItem)
493 {
494 const sal_Int64 nBlue = pItem->GetValue();
495 mpMtrBlue->SetValue( nBlue );
496 }
497 }
498 else if(SFX_ITEM_DISABLED == eState)
499 {
500 mpMtrBlue->Disable();
501 }
502 else
503 {
504 mpMtrBlue->Enable();
505 mpMtrBlue->SetText(String());
506 }
507 break;
508 }
509 case SID_ATTR_GRAF_GAMMA:
510 {
511 if(eState >= SFX_ITEM_AVAILABLE)
512 {
513 mpMtrGamma->Enable();
514 const SfxUInt32Item* pItem = dynamic_cast< const SfxUInt32Item* >(pState);
515
516 if(pItem)
517 {
518 const sal_Int64 nGamma = pItem->GetValue();
519 mpMtrGamma->SetValue( nGamma );
520 }
521 }
522 else if(SFX_ITEM_DISABLED == eState)
523 {
524 mpMtrGamma->Disable();
525 }
526 else
527 {
528 mpMtrGamma->Enable();
529 mpMtrGamma->SetText(String());
530 }
531 break;
532 }
533 }
534 }
535
536
537
538
GetBindings()539 SfxBindings* GraphicPropertyPanel::GetBindings()
540 {
541 return mpBindings;
542 }
543
544
545
546
Resize(void)547 void GraphicPropertyPanel::Resize (void)
548 {
549 maLayouter.Layout();
550 }
551
552
553
554 }} // end of namespace ::svx::sidebar
555