Update ooo320-m1
[ooovba.git] / svx / source / dialog / fontwork.cxx
blobc361d97426662611b7cbd00a520d4730c2153fc4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: fontwork.cxx,v $
10 * $Revision: 1.18 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
34 // include ---------------------------------------------------------------
35 #include <sfx2/module.hxx>
36 #include <sfx2/dispatch.hxx>
37 #include <tools/shl.hxx>
39 #define _SVX_FONTWORK_CXX
40 #include <svx/svdobj.hxx>
41 #include <svx/svdopath.hxx>
42 #include <svx/svdview.hxx>
43 #include <svx/svdocirc.hxx>
44 #include <svx/xtextit.hxx>
46 #include <svx/dialmgr.hxx>
47 #include "dlgutil.hxx"
49 #include <svx/dialogs.hrc>
50 #include "fontwork.hrc"
51 #include <svx/fontwork.hxx>
52 #include <svx/outlobj.hxx>
53 #include <basegfx/polygon/b2dpolygon.hxx>
54 #include <basegfx/point/b2dpoint.hxx>
56 SFX_IMPL_DOCKINGWINDOW( SvxFontWorkChildWindow, SID_FONTWORK );
58 /*************************************************************************
60 |* ControllerItem fuer Fontwork
62 \************************************************************************/
64 SvxFontWorkControllerItem::SvxFontWorkControllerItem
66 USHORT _nId,
67 SvxFontWorkDialog& rDlg,
68 SfxBindings& rBindings
69 ) :
71 SfxControllerItem( _nId, rBindings ),
73 rFontWorkDlg( rDlg )
77 /*************************************************************************
79 |* StateChanged-Methode fuer FontWork-Items
81 \************************************************************************/
83 void SvxFontWorkControllerItem::StateChanged( USHORT /*nSID*/, SfxItemState /*eState*/,
84 const SfxPoolItem* pItem )
86 switch ( GetId() )
88 case SID_FORMTEXT_STYLE:
90 const XFormTextStyleItem* pStateItem =
91 PTR_CAST(XFormTextStyleItem, pItem);
92 DBG_ASSERT(pStateItem || pItem == 0, "XFormTextStyleItem erwartet");
93 rFontWorkDlg.SetStyle_Impl(pStateItem);
94 break;
96 case SID_FORMTEXT_ADJUST:
98 const XFormTextAdjustItem* pStateItem =
99 PTR_CAST(XFormTextAdjustItem, pItem);
100 DBG_ASSERT(pStateItem || pItem == 0, "XFormTextAdjustItem erwartet");
101 rFontWorkDlg.SetAdjust_Impl(pStateItem);
102 break;
104 case SID_FORMTEXT_DISTANCE:
106 const XFormTextDistanceItem* pStateItem =
107 PTR_CAST(XFormTextDistanceItem, pItem);
108 DBG_ASSERT(pStateItem || pItem == 0, "XFormTextDistanceItem erwartet");
109 rFontWorkDlg.SetDistance_Impl(pStateItem);
110 break;
112 case SID_FORMTEXT_START:
114 const XFormTextStartItem* pStateItem =
115 PTR_CAST(XFormTextStartItem, pItem);
116 DBG_ASSERT(pStateItem || pItem == 0, "XFormTextStartItem erwartet");
117 rFontWorkDlg.SetStart_Impl(pStateItem);
118 break;
120 case SID_FORMTEXT_MIRROR:
122 const XFormTextMirrorItem* pStateItem =
123 PTR_CAST(XFormTextMirrorItem, pItem);
124 DBG_ASSERT(pStateItem || pItem == 0, "XFormTextMirrorItem erwartet");
125 rFontWorkDlg.SetMirror_Impl(pStateItem);
126 break;
128 case SID_FORMTEXT_STDFORM:
130 const XFormTextStdFormItem* pStateItem =
131 PTR_CAST(XFormTextStdFormItem, pItem);
132 DBG_ASSERT(pStateItem || pItem == 0, "XFormTextStdFormItem erwartet");
133 rFontWorkDlg.SetStdForm_Impl(pStateItem);
134 break;
136 case SID_FORMTEXT_HIDEFORM:
138 const XFormTextHideFormItem* pStateItem =
139 PTR_CAST(XFormTextHideFormItem, pItem);
140 DBG_ASSERT(pStateItem || pItem == 0, "XFormTextHideFormItem erwartet");
141 rFontWorkDlg.SetShowForm_Impl(pStateItem);
142 break;
144 case SID_FORMTEXT_OUTLINE:
146 const XFormTextOutlineItem* pStateItem =
147 PTR_CAST(XFormTextOutlineItem, pItem);
148 DBG_ASSERT(pStateItem || pItem == 0, "XFormTextOutlineItem erwartet");
149 rFontWorkDlg.SetOutline_Impl(pStateItem);
150 break;
152 case SID_FORMTEXT_SHADOW:
154 const XFormTextShadowItem* pStateItem =
155 PTR_CAST(XFormTextShadowItem, pItem);
156 DBG_ASSERT(pStateItem || pItem == 0, "XFormTextShadowItem erwartet");
157 rFontWorkDlg.SetShadow_Impl(pStateItem);
158 break;
160 case SID_FORMTEXT_SHDWCOLOR:
162 const XFormTextShadowColorItem* pStateItem =
163 PTR_CAST(XFormTextShadowColorItem, pItem);
164 DBG_ASSERT(pStateItem || pItem == 0, "XFormTextShadowColorItem erwartet");
165 rFontWorkDlg.SetShadowColor_Impl(pStateItem);
166 break;
168 case SID_FORMTEXT_SHDWXVAL:
170 const XFormTextShadowXValItem* pStateItem =
171 PTR_CAST(XFormTextShadowXValItem, pItem);
172 DBG_ASSERT(pStateItem || pItem == 0, "XFormTextShadowXValItem erwartet");
173 rFontWorkDlg.SetShadowXVal_Impl(pStateItem);
174 break;
176 case SID_FORMTEXT_SHDWYVAL:
178 const XFormTextShadowYValItem* pStateItem =
179 PTR_CAST(XFormTextShadowYValItem, pItem);
180 DBG_ASSERT(pStateItem || pItem == 0, "XFormTextShadowYValItem erwartet");
181 rFontWorkDlg.SetShadowYVal_Impl(pStateItem);
182 break;
187 /*************************************************************************
189 |* Ableitung vom SfxChildWindow als "Behaelter" fuer Fontwork-Dialog
191 \************************************************************************/
193 SvxFontWorkChildWindow::SvxFontWorkChildWindow
195 Window* _pParent,
196 USHORT nId,
197 SfxBindings* pBindings,
198 SfxChildWinInfo* pInfo
201 SfxChildWindow( _pParent, nId )
204 pWindow = new SvxFontWorkDialog( pBindings, this, _pParent,
205 SVX_RES( RID_SVXDLG_FONTWORK ) );
206 SvxFontWorkDialog* pDlg = (SvxFontWorkDialog*) pWindow;
208 eChildAlignment = SFX_ALIGN_NOALIGNMENT;
210 pDlg->Initialize( pInfo );
213 /*************************************************************************
215 |* Floating Window zur Attributierung von Texteffekten
217 \************************************************************************/
219 SvxFontWorkDialog::SvxFontWorkDialog( SfxBindings *pBindinx,
220 SfxChildWindow *pCW,
221 Window* _pParent,
222 const ResId& rResId ) :
223 SfxDockingWindow( pBindinx, pCW, _pParent, rResId ),
225 aFormSet (this, ResId(VS_FORMS,*rResId.GetResMgr())),
227 aTbxStyle (this, ResId(TBX_STYLE,*rResId.GetResMgr())),
228 aTbxAdjust (this, ResId(TBX_ADJUST,*rResId.GetResMgr())),
230 aFbDistance (this, ResId(FB_DISTANCE,*rResId.GetResMgr())),
231 aMtrFldDistance (this, ResId(MTR_FLD_DISTANCE,*rResId.GetResMgr())),
232 aFbTextStart (this, ResId(FB_TEXTSTART,*rResId.GetResMgr())),
233 aMtrFldTextStart(this, ResId(MTR_FLD_TEXTSTART,*rResId.GetResMgr())),
235 aTbxShadow (this, ResId(TBX_SHADOW,*rResId.GetResMgr())),
237 aFbShadowX (this, ResId(FB_SHADOW_X,*rResId.GetResMgr())),
238 aMtrFldShadowX (this, ResId(MTR_FLD_SHADOW_X,*rResId.GetResMgr())),
239 aFbShadowY (this, ResId(FB_SHADOW_Y,*rResId.GetResMgr())),
240 aMtrFldShadowY (this, ResId(MTR_FLD_SHADOW_Y,*rResId.GetResMgr())),
242 aShadowColorLB (this, ResId(CLB_SHADOW_COLOR,*rResId.GetResMgr())),
243 rBindings (*pBindinx),
245 nLastStyleTbxId(0),
246 nLastAdjustTbxId(0),
247 nLastShadowTbxId(0),
248 nSaveShadowX (0),
249 nSaveShadowY (0),
250 nSaveShadowAngle(450),
251 nSaveShadowSize (100),
253 maImageList (ResId(IL_FONTWORK,*rResId.GetResMgr())),
254 maImageListH (ResId(ILH_FONTWORK,*rResId.GetResMgr())),
256 pColorTable (NULL)
258 FreeResource();
260 ApplyImageList();
262 pCtrlItems[0] = new SvxFontWorkControllerItem(SID_FORMTEXT_STYLE, *this, rBindings);
263 pCtrlItems[1] = new SvxFontWorkControllerItem(SID_FORMTEXT_ADJUST, *this, rBindings);
264 pCtrlItems[2] = new SvxFontWorkControllerItem(SID_FORMTEXT_DISTANCE, *this, rBindings);
265 pCtrlItems[3] = new SvxFontWorkControllerItem(SID_FORMTEXT_START, *this, rBindings);
266 pCtrlItems[4] = new SvxFontWorkControllerItem(SID_FORMTEXT_MIRROR, *this, rBindings);
267 pCtrlItems[5] = new SvxFontWorkControllerItem(SID_FORMTEXT_STDFORM, *this, rBindings);
268 pCtrlItems[6] = new SvxFontWorkControllerItem(SID_FORMTEXT_HIDEFORM, *this, rBindings);
269 pCtrlItems[7] = new SvxFontWorkControllerItem(SID_FORMTEXT_OUTLINE, *this, rBindings);
270 pCtrlItems[8] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHADOW, *this, rBindings);
271 pCtrlItems[9] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHDWCOLOR, *this, rBindings);
272 pCtrlItems[10] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHDWXVAL, *this, rBindings);
273 pCtrlItems[11] = new SvxFontWorkControllerItem(SID_FORMTEXT_SHDWYVAL, *this, rBindings);
275 WinBits aNewStyle = ( aFormSet.GetStyle() | WB_VSCROLL | WB_ITEMBORDER | WB_DOUBLEBORDER );
276 aFormSet.SetStyle( aNewStyle );
278 Size aSize = aTbxStyle.CalcWindowSizePixel();
279 aTbxStyle.SetSizePixel(aSize);
280 aTbxStyle.SetSelectHdl( LINK(this, SvxFontWorkDialog, SelectStyleHdl_Impl) );
282 aTbxAdjust.SetSizePixel(aSize);
283 aTbxAdjust.SetSelectHdl( LINK(this, SvxFontWorkDialog, SelectAdjustHdl_Impl) );
285 aTbxShadow.SetSizePixel(aSize);
286 aTbxShadow.SetSelectHdl( LINK(this, SvxFontWorkDialog, SelectShadowHdl_Impl) );
288 // aFbShadowX.SetBitmap(Bitmap(FW_RESID(RID_SVXBMP_SHADOW_XDIST)));
289 // aFbShadowY.SetBitmap(Bitmap(FW_RESID(RID_SVXBMP_SHADOW_YDIST)));
291 Link aLink = LINK(this, SvxFontWorkDialog, ModifyInputHdl_Impl);
292 aMtrFldDistance.SetModifyHdl( aLink );
293 aMtrFldTextStart.SetModifyHdl( aLink );
294 aMtrFldShadowX.SetModifyHdl( aLink );
295 aMtrFldShadowY.SetModifyHdl( aLink );
297 // System-Metrik setzen
298 const FieldUnit eDlgUnit = GetModuleFieldUnit();
299 SetFieldUnit( aMtrFldDistance, eDlgUnit, TRUE );
300 SetFieldUnit( aMtrFldTextStart, eDlgUnit, TRUE );
301 SetFieldUnit( aMtrFldShadowX, eDlgUnit, TRUE );
302 SetFieldUnit( aMtrFldShadowY, eDlgUnit, TRUE );
303 if( eDlgUnit == FUNIT_MM )
305 aMtrFldDistance.SetSpinSize( 50 );
306 aMtrFldTextStart.SetSpinSize( 50 );
307 aMtrFldShadowX.SetSpinSize( 50 );
308 aMtrFldShadowY.SetSpinSize( 50 );
310 else
312 aMtrFldDistance.SetSpinSize( 10 );
313 aMtrFldTextStart.SetSpinSize( 10 );
314 aMtrFldShadowX.SetSpinSize( 10 );
315 aMtrFldShadowY.SetSpinSize( 10 );
318 aShadowColorLB.SetSelectHdl( LINK(this, SvxFontWorkDialog, ColorSelectHdl_Impl) );
320 aInputTimer.SetTimeout(500);
321 aInputTimer.SetTimeoutHdl(LINK(this, SvxFontWorkDialog, InputTimoutHdl_Impl));
323 aFormSet.SetSelectHdl( LINK(this, SvxFontWorkDialog, FormSelectHdl_Impl) );
324 aFormSet.SetColCount(4);
325 aFormSet.SetLineCount(2);
327 Bitmap aBmp(SVX_RES(RID_SVXBMP_FONTWORK_FORM1));
328 aSize.Height() = aFormSet.CalcWindowSizePixel(aBmp.GetSizePixel()).Height() + 2;
329 aFormSet.SetSizePixel(aSize);
332 /*************************************************************************
334 |* Destruktor
336 \************************************************************************/
338 SvxFontWorkDialog::~SvxFontWorkDialog()
340 for (USHORT i = 0; i < CONTROLLER_COUNT; i++)
341 DELETEZ(pCtrlItems[i]);
344 /*************************************************************************
346 \************************************************************************/
348 void SvxFontWorkDialog::Zoom()
350 SfxDockingWindow::Roll();
354 /*************************************************************************
358 \************************************************************************/
360 SfxChildAlignment SvxFontWorkDialog::CheckAlignment( SfxChildAlignment eActAlign,
361 SfxChildAlignment eAlign )
363 SfxChildAlignment eAlignment;
365 switch ( eAlign )
367 case SFX_ALIGN_TOP:
368 case SFX_ALIGN_HIGHESTTOP:
369 case SFX_ALIGN_LOWESTTOP:
370 case SFX_ALIGN_BOTTOM:
371 case SFX_ALIGN_LOWESTBOTTOM:
372 case SFX_ALIGN_HIGHESTBOTTOM:
374 eAlignment = eActAlign;
376 break;
378 case SFX_ALIGN_LEFT:
379 case SFX_ALIGN_RIGHT:
380 case SFX_ALIGN_FIRSTLEFT:
381 case SFX_ALIGN_LASTLEFT:
382 case SFX_ALIGN_FIRSTRIGHT:
383 case SFX_ALIGN_LASTRIGHT:
385 eAlignment = eAlign;
387 break;
389 default:
391 eAlignment = eAlign;
393 break;
396 return eAlignment;
400 /*************************************************************************
402 |* Style-Buttons setzen
404 \************************************************************************/
406 void SvxFontWorkDialog::SetStyle_Impl(const XFormTextStyleItem* pItem)
408 if ( pItem )
410 USHORT nId = TBI_STYLE_OFF;
412 switch ( pItem->GetValue() )
414 case XFT_ROTATE : nId = TBI_STYLE_ROTATE; break;
415 case XFT_UPRIGHT: nId = TBI_STYLE_UPRIGHT; break;
416 case XFT_SLANTX : nId = TBI_STYLE_SLANTX; break;
417 case XFT_SLANTY : nId = TBI_STYLE_SLANTY; break;
418 default: ;//prevent warning
420 aTbxStyle.Enable();
422 // Make sure that there is allways exactly one checked toolbox item.
423 if ( pItem->GetValue() == XFT_NONE )
425 aTbxStyle.CheckItem(TBI_STYLE_ROTATE, FALSE);
426 aTbxStyle.CheckItem(TBI_STYLE_UPRIGHT, FALSE);
427 aTbxStyle.CheckItem(TBI_STYLE_SLANTX, FALSE);
428 aTbxStyle.CheckItem(TBI_STYLE_SLANTY, FALSE);
430 aTbxStyle.CheckItem(TBI_STYLE_OFF, TRUE);
432 else
434 aTbxStyle.CheckItem(TBI_STYLE_OFF, FALSE);
435 aTbxStyle.CheckItem(nId);
438 nLastStyleTbxId = nId;
440 else
441 aTbxStyle.Disable();
444 /*************************************************************************
446 |* Adjust-Buttons setzen
448 \************************************************************************/
450 void SvxFontWorkDialog::SetAdjust_Impl(const XFormTextAdjustItem* pItem)
452 if ( pItem )
454 USHORT nId;
456 aTbxAdjust.Enable();
457 aMtrFldDistance.Enable();
459 if ( pItem->GetValue() == XFT_LEFT || pItem->GetValue() == XFT_RIGHT )
461 if ( pItem->GetValue() == XFT_LEFT ) nId = TBI_ADJUST_LEFT;
462 else nId = TBI_ADJUST_RIGHT;
463 aMtrFldTextStart.Enable();
465 else
467 if ( pItem->GetValue() == XFT_CENTER ) nId = TBI_ADJUST_CENTER;
468 else nId = TBI_ADJUST_AUTOSIZE;
469 aMtrFldTextStart.Disable();
472 if ( !aTbxAdjust.IsItemChecked(nId) )
474 aTbxAdjust.CheckItem(nId);
476 nLastAdjustTbxId = nId;
478 else
480 aTbxAdjust.Disable();
481 aMtrFldTextStart.Disable();
482 aMtrFldDistance.Disable();
486 /*************************************************************************
488 |* Abstand-Wert in Editfeld eintragen
490 \************************************************************************/
492 void SvxFontWorkDialog::SetDistance_Impl(const XFormTextDistanceItem* pItem)
494 // #104596# Use HasChildPathFocus() instead of HasFocus() at SpinFields
495 if ( pItem && !aMtrFldDistance.HasChildPathFocus() )
497 SetMetricValue( aMtrFldDistance, pItem->GetValue(), SFX_MAPUNIT_100TH_MM );
501 /*************************************************************************
503 |* Einzug-Wert in Editfeld eintragen
505 \************************************************************************/
507 void SvxFontWorkDialog::SetStart_Impl(const XFormTextStartItem* pItem)
509 // #104596# Use HasChildPathFocus() instead of HasFocus() at SpinFields
510 if ( pItem && !aMtrFldTextStart.HasChildPathFocus() )
512 SetMetricValue( aMtrFldTextStart, pItem->GetValue(), SFX_MAPUNIT_100TH_MM );
516 /*************************************************************************
518 |* Button fuer Umkehrung der Textrichtung setzen
520 \************************************************************************/
522 void SvxFontWorkDialog::SetMirror_Impl(const XFormTextMirrorItem* pItem)
524 if ( pItem )
525 aTbxAdjust.CheckItem(TBI_ADJUST_MIRROR, pItem->GetValue());
528 /*************************************************************************
530 |* Standardform im ValueSet anzeigen
532 \************************************************************************/
534 void SvxFontWorkDialog::SetStdForm_Impl(const XFormTextStdFormItem* pItem)
536 if ( pItem )
538 aFormSet.Enable();
539 aFormSet.SetNoSelection();
541 if ( pItem->GetValue() != XFTFORM_NONE )
542 aFormSet.SelectItem(
543 sal::static_int_cast< USHORT >(pItem->GetValue()));
545 else
546 aFormSet.Disable();
549 /*************************************************************************
551 |* Button fuer Konturanzeige setzen
553 \************************************************************************/
555 void SvxFontWorkDialog::SetShowForm_Impl(const XFormTextHideFormItem* pItem)
557 if ( pItem )
558 aTbxShadow.CheckItem(TBI_SHOWFORM, !pItem->GetValue());
561 /*************************************************************************
563 |* Button fuer Zeichenumrandung setzen
565 \************************************************************************/
567 void SvxFontWorkDialog::SetOutline_Impl(const XFormTextOutlineItem* pItem)
569 if ( pItem )
570 aTbxShadow.CheckItem(TBI_OUTLINE, pItem->GetValue());
573 /*************************************************************************
575 |* Shadow-Buttons setzen
577 \************************************************************************/
579 void SvxFontWorkDialog::SetShadow_Impl(const XFormTextShadowItem* pItem,
580 BOOL bRestoreValues)
582 if ( pItem )
584 USHORT nId;
586 aTbxShadow.Enable();
588 if ( pItem->GetValue() == XFTSHADOW_NONE )
590 nId = TBI_SHADOW_OFF;
591 aFbShadowX.Hide();
592 aFbShadowY.Hide();
593 aMtrFldShadowX.Disable();
594 aMtrFldShadowY.Disable();
595 aShadowColorLB.Disable();
597 else
599 aFbShadowX.Show();
600 aFbShadowY.Show();
601 aMtrFldShadowX.Enable();
602 aMtrFldShadowY.Enable();
603 aShadowColorLB.Enable();
605 if ( pItem->GetValue() == XFTSHADOW_NORMAL )
607 nId = TBI_SHADOW_NORMAL;
608 const FieldUnit eDlgUnit = GetModuleFieldUnit();
610 // aFbShadowX.SetBitmap( Bitmap( ResId(RID_SVXBMP_SHADOW_XDIST, _pMgr ) ) );
611 //aMtrFldShadowX.SetUnit(FUNIT_MM);
612 aMtrFldShadowX.SetUnit( eDlgUnit );
613 aMtrFldShadowX.SetDecimalDigits(2);
614 aMtrFldShadowX.SetMin(LONG_MIN);
615 aMtrFldShadowX.SetMax(LONG_MAX);
616 if( eDlgUnit == FUNIT_MM )
617 aMtrFldShadowX.SetSpinSize( 50 );
618 else
619 aMtrFldShadowX.SetSpinSize( 10 );
621 // aFbShadowY.SetBitmap( Bitmap( ResId( RID_SVXBMP_SHADOW_YDIST, _pMgr ) ) );
622 //aMtrFldShadowY.SetUnit(FUNIT_MM);
623 aMtrFldShadowY.SetUnit( eDlgUnit );
624 aMtrFldShadowY.SetDecimalDigits(2);
625 aMtrFldShadowY.SetMin(LONG_MIN);
626 aMtrFldShadowY.SetMax(LONG_MAX);
627 if( eDlgUnit == FUNIT_MM )
628 aMtrFldShadowY.SetSpinSize( 50 );
629 else
630 aMtrFldShadowY.SetSpinSize( 10 );
632 if ( bRestoreValues )
634 SetMetricValue( aMtrFldShadowX, nSaveShadowX, SFX_MAPUNIT_100TH_MM );
635 SetMetricValue( aMtrFldShadowY, nSaveShadowY, SFX_MAPUNIT_100TH_MM );
637 XFormTextShadowXValItem aXItem( nSaveShadowX );
638 XFormTextShadowYValItem aYItem( nSaveShadowY );
640 GetBindings().GetDispatcher()->Execute(
641 SID_FORMTEXT_SHDWXVAL, SFX_CALLMODE_RECORD, &aXItem, &aYItem, 0L );
644 else
646 nId = TBI_SHADOW_SLANT;
648 // aFbShadowX.SetBitmap( Bitmap( ResId( RID_SVXBMP_SHADOW_ANGLE, _pMgr ) ) );
649 aMtrFldShadowX.SetUnit(FUNIT_CUSTOM);
650 aMtrFldShadowX.SetDecimalDigits(1);
651 aMtrFldShadowX.SetMin(-1800);
652 aMtrFldShadowX.SetMax( 1800);
653 aMtrFldShadowX.SetSpinSize(10);
655 // aFbShadowY.SetBitmap( Bitmap( ResId( RID_SVXBMP_SHADOW_SIZE, _pMgr ) ) );
656 aMtrFldShadowY.SetUnit(FUNIT_CUSTOM);
657 aMtrFldShadowY.SetDecimalDigits(0);
658 aMtrFldShadowY.SetMin(-999);
659 aMtrFldShadowY.SetMax( 999);
660 aMtrFldShadowY.SetSpinSize(10);
662 if ( bRestoreValues )
664 aMtrFldShadowX.SetValue(nSaveShadowAngle);
665 aMtrFldShadowY.SetValue(nSaveShadowSize);
666 XFormTextShadowXValItem aXItem(nSaveShadowAngle);
667 XFormTextShadowYValItem aYItem(nSaveShadowSize);
668 GetBindings().GetDispatcher()->Execute(
669 SID_FORMTEXT_SHDWXVAL, SFX_CALLMODE_RECORD, &aXItem, &aYItem, 0L );
674 if ( !aTbxShadow.IsItemChecked(nId) )
676 aTbxShadow.CheckItem(nId);
678 nLastShadowTbxId = nId;
680 ApplyImageList();
682 else
684 aTbxShadow.Disable();
685 aMtrFldShadowX.Disable();
686 aMtrFldShadowY.Disable();
687 aShadowColorLB.Disable();
691 /*************************************************************************
693 |* Schattenfarbe in Listbox eintragen
695 \************************************************************************/
697 void SvxFontWorkDialog::SetShadowColor_Impl(const XFormTextShadowColorItem* pItem)
699 if ( pItem )
700 aShadowColorLB.SelectEntry(pItem->GetColorValue());
703 /*************************************************************************
705 |* X-Wert fuer Schatten in Editfeld eintragen
707 \************************************************************************/
709 void SvxFontWorkDialog::SetShadowXVal_Impl(const XFormTextShadowXValItem* pItem)
711 // #104596# Use HasChildPathFocus() instead of HasFocus() at SpinFields
712 if ( pItem && !aMtrFldShadowX.HasChildPathFocus() )
714 // #i19251#
715 // INT32 nValue = pItem->GetValue();
717 // #i19251#
718 // The two involved fields/items are used double and contain/give different
719 // values regarding to the access method. Thus, here we need to separate the access
720 // methos regarding to the kind of value accessed.
721 if(aTbxShadow.IsItemChecked(TBI_SHADOW_SLANT))
723 // #i19251#
724 // There is no value correction necessary at all, i think this
725 // was only tried to be done without understanding that the two
726 // involved fields/items are used double and contain/give different
727 // values regarding to the access method.
728 // nValue = nValue - ( int( float( nValue ) / 360.0 ) * 360 );
729 aMtrFldShadowX.SetValue(pItem->GetValue());
731 else
733 SetMetricValue( aMtrFldShadowX, pItem->GetValue(), SFX_MAPUNIT_100TH_MM );
738 /*************************************************************************
740 |* Y-Wert fuer Schatten in Editfeld eintragen
742 \************************************************************************/
744 void SvxFontWorkDialog::SetShadowYVal_Impl(const XFormTextShadowYValItem* pItem)
746 // #104596# Use HasChildPathFocus() instead of HasFocus() at SpinFields
747 if ( pItem && !aMtrFldShadowY.HasChildPathFocus() )
749 // #i19251#
750 // The two involved fields/items are used double and contain/give different
751 // values regarding to the access method. Thus, here we need to separate the access
752 // methos regarding to the kind of value accessed.
753 if(aTbxShadow.IsItemChecked(TBI_SHADOW_SLANT))
755 aMtrFldShadowY.SetValue(pItem->GetValue());
757 else
759 SetMetricValue( aMtrFldShadowY, pItem->GetValue(), SFX_MAPUNIT_100TH_MM );
764 /*************************************************************************
766 \************************************************************************/
768 IMPL_LINK( SvxFontWorkDialog, SelectStyleHdl_Impl, void *, EMPTYARG )
770 USHORT nId = aTbxStyle.GetCurItemId();
772 // Execute this block when a different toolbox item has been clicked or
773 // when the off item has been clicked. The later is necessary to
774 // override the toolbox behaviour of unchecking the item after second
775 // click on it: One of the items has to be checked at all times (when
776 // enabled that is.)
777 if (nId == TBI_STYLE_OFF || nId != nLastStyleTbxId )
779 XFormTextStyle eStyle = XFT_NONE;
781 switch ( nId )
783 case TBI_STYLE_ROTATE : eStyle = XFT_ROTATE; break;
784 case TBI_STYLE_UPRIGHT : eStyle = XFT_UPRIGHT; break;
785 case TBI_STYLE_SLANTX : eStyle = XFT_SLANTX; break;
786 case TBI_STYLE_SLANTY : eStyle = XFT_SLANTY; break;
788 XFormTextStyleItem aItem( eStyle );
789 GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_STYLE, SFX_CALLMODE_RECORD, &aItem, 0L );
790 SetStyle_Impl( &aItem );
791 nLastStyleTbxId = nId;
793 return 0;
796 /*************************************************************************
798 \************************************************************************/
800 IMPL_LINK( SvxFontWorkDialog, SelectAdjustHdl_Impl, void *, EMPTYARG )
802 USHORT nId = aTbxAdjust.GetCurItemId();
804 if ( nId == TBI_ADJUST_MIRROR )
806 XFormTextMirrorItem aItem(aTbxAdjust.IsItemChecked(nId));
807 GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_MIRROR, SFX_CALLMODE_SLOT, &aItem, 0L );
809 else if ( nId != nLastAdjustTbxId )
811 XFormTextAdjust eAdjust = XFT_AUTOSIZE;
813 switch ( nId )
815 case TBI_ADJUST_LEFT : eAdjust = XFT_LEFT; break;
816 case TBI_ADJUST_CENTER : eAdjust = XFT_CENTER; break;
817 case TBI_ADJUST_RIGHT : eAdjust = XFT_RIGHT; break;
819 XFormTextAdjustItem aItem(eAdjust);
820 GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_ADJUST, SFX_CALLMODE_RECORD, &aItem, 0L );
821 SetAdjust_Impl(&aItem);
822 nLastAdjustTbxId = nId;
824 return 0;
827 /*************************************************************************
829 \************************************************************************/
831 IMPL_LINK( SvxFontWorkDialog, SelectShadowHdl_Impl, void *, EMPTYARG )
833 USHORT nId = aTbxShadow.GetCurItemId();
835 if ( nId == TBI_SHOWFORM )
837 XFormTextHideFormItem aItem(!aTbxShadow.IsItemChecked(nId));
838 GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_HIDEFORM, SFX_CALLMODE_RECORD, &aItem, 0L );
840 else if ( nId == TBI_OUTLINE )
842 XFormTextOutlineItem aItem(aTbxShadow.IsItemChecked(nId));
843 GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_OUTLINE, SFX_CALLMODE_RECORD, &aItem, 0L );
845 else if ( nId != nLastShadowTbxId )
847 XFormTextShadow eShadow = XFTSHADOW_NONE;
849 if ( nLastShadowTbxId == TBI_SHADOW_NORMAL )
851 nSaveShadowX = GetCoreValue( aMtrFldShadowX, SFX_MAPUNIT_100TH_MM );
852 nSaveShadowY = GetCoreValue( aMtrFldShadowY, SFX_MAPUNIT_100TH_MM );
854 else if ( nLastShadowTbxId == TBI_SHADOW_SLANT )
856 nSaveShadowAngle = static_cast<long>(aMtrFldShadowX.GetValue());
857 nSaveShadowSize = static_cast<long>(aMtrFldShadowY.GetValue());
859 nLastShadowTbxId = nId;
861 if ( nId == TBI_SHADOW_NORMAL ) eShadow = XFTSHADOW_NORMAL;
862 else if ( nId == TBI_SHADOW_SLANT ) eShadow = XFTSHADOW_SLANT;
864 XFormTextShadowItem aItem(eShadow);
865 GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_SHADOW, SFX_CALLMODE_RECORD, &aItem, 0L );
866 SetShadow_Impl(&aItem, TRUE);
868 return 0;
871 /*************************************************************************
873 \************************************************************************/
875 IMPL_LINK_INLINE_START( SvxFontWorkDialog, ModifyInputHdl_Impl, void *, EMPTYARG )
877 aInputTimer.Start();
878 return 0;
880 IMPL_LINK_INLINE_END( SvxFontWorkDialog, ModifyInputHdl_Impl, void *, EMPTYARG )
882 /*************************************************************************
884 \************************************************************************/
886 IMPL_LINK( SvxFontWorkDialog, InputTimoutHdl_Impl, void *, EMPTYARG )
888 // System-Metrik evtl. neu setzen
889 // Dieses sollte mal als Listener passieren, ist aber aus
890 // inkompatibilitaetsgruenden z.Z. nicht moeglich
891 const FieldUnit eDlgUnit = GetModuleFieldUnit();
892 if( eDlgUnit != aMtrFldDistance.GetUnit() )
894 SetFieldUnit( aMtrFldDistance, eDlgUnit, TRUE );
895 SetFieldUnit( aMtrFldTextStart, eDlgUnit, TRUE );
896 aMtrFldDistance.SetSpinSize( eDlgUnit == FUNIT_MM ? 50 : 10 );
897 aMtrFldTextStart.SetSpinSize( eDlgUnit == FUNIT_MM ? 50 : 10 );
899 if( eDlgUnit != aMtrFldShadowX.GetUnit() &&
900 aTbxShadow.IsItemChecked( TBI_SHADOW_NORMAL ) )
902 SetFieldUnit( aMtrFldShadowX, eDlgUnit, TRUE );
903 SetFieldUnit( aMtrFldShadowY, eDlgUnit, TRUE );
904 aMtrFldShadowX.SetSpinSize( eDlgUnit == FUNIT_MM ? 50 : 10 );
905 aMtrFldShadowY.SetSpinSize( eDlgUnit == FUNIT_MM ? 50 : 10 );
908 long nValue = GetCoreValue( aMtrFldDistance, SFX_MAPUNIT_100TH_MM );
909 XFormTextDistanceItem aDistItem( nValue );
910 nValue = GetCoreValue( aMtrFldTextStart, SFX_MAPUNIT_100TH_MM );
911 XFormTextStartItem aStartItem( nValue );
913 sal_Int32 nValueX(0L);
914 sal_Int32 nValueY(0L);
916 // #i19251#
917 // The two involved fields/items are used double and contain/give different
918 // values regarding to the access method. Thus, here we need to separate the access
919 // methos regarding to the kind of value accessed.
920 if(nLastShadowTbxId == TBI_SHADOW_NORMAL)
922 nValueX = GetCoreValue( aMtrFldShadowX, SFX_MAPUNIT_100TH_MM );
923 nValueY = GetCoreValue( aMtrFldShadowY, SFX_MAPUNIT_100TH_MM );
925 else if(nLastShadowTbxId == TBI_SHADOW_SLANT)
927 nValueX = static_cast<long>(aMtrFldShadowX.GetValue());
928 nValueY = static_cast<long>(aMtrFldShadowY.GetValue());
931 XFormTextShadowXValItem aShadowXItem( nValueX );
932 XFormTextShadowYValItem aShadowYItem( nValueY );
934 // Slot-ID ist egal, die Exec-Methode wertet das gesamte ItemSet aus
935 GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_DISTANCE, SFX_CALLMODE_RECORD, &aDistItem,
936 &aStartItem, &aShadowXItem, &aShadowYItem, 0L );
937 return 0;
940 /*************************************************************************
942 \************************************************************************/
944 IMPL_LINK( SvxFontWorkDialog, FormSelectHdl_Impl, void *, EMPTYARG )
946 XFormTextStdFormItem aItem;
948 if ( aFormSet.IsNoSelection() )
949 aItem.SetValue(XFTFORM_NONE);
950 else
951 aItem.SetValue(aFormSet.GetSelectItemId());
952 GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_STDFORM, SFX_CALLMODE_RECORD, &aItem, 0L );
953 aFormSet.SetNoSelection();
954 return 0;
957 /*************************************************************************
959 \************************************************************************/
961 IMPL_LINK( SvxFontWorkDialog, ColorSelectHdl_Impl, void *, EMPTYARG )
963 // Changed by obo. Linux-Compiler can't parse commented lines
964 XFormTextShadowColorItem aItem( (const String &) String(),
965 (const Color &) aShadowColorLB.GetSelectEntryColor() );
966 // XFormTextShadowColorItem aItem( String(),
967 // aShadowColorLB.GetSelectEntryColor() );
968 GetBindings().GetDispatcher()->Execute( SID_FORMTEXT_SHDWCOLOR, SFX_CALLMODE_RECORD, &aItem, 0L );
969 return 0;
972 /*************************************************************************
974 \************************************************************************/
976 void SvxFontWorkDialog::SetColorTable(const XColorTable* pTable)
978 if ( pTable && pTable != pColorTable )
980 pColorTable = pTable;
981 aShadowColorLB.Clear();
982 aShadowColorLB.Fill(pColorTable);
986 /*************************************************************************
988 \************************************************************************/
990 void SvxFontWorkDialog::SetActive(BOOL /*bActivate*/)
994 /*************************************************************************
996 |* Standard-FontWork-Objekt erzeugen
998 \************************************************************************/
1000 void SvxFontWorkDialog::CreateStdFormObj(SdrView& rView, SdrPageView& rPV,
1001 const SfxItemSet& rAttr,
1002 SdrObject& rOldObj,
1003 XFormTextStdForm eForm)
1005 SfxItemSet aAttr(*rAttr.GetPool(), XATTR_FORMTXTSTYLE,
1006 XATTR_FORMTXTHIDEFORM);
1007 SdrObject* pNewObj = NULL;
1008 Rectangle aRect;
1009 XFormTextAdjust eAdjust = XFT_AUTOSIZE;
1011 //-/ rOldObj.TakeAttributes(aAttr, TRUE, FALSE);
1012 aAttr.Put(rOldObj.GetMergedItemSet());
1014 const XFormTextStdFormItem& rOldForm = (const XFormTextStdFormItem&)
1015 aAttr.Get(XATTR_FORMTXTSTDFORM);
1017 aRect = rOldObj.GetSnapRect();
1019 if ( !rOldObj.ISA(SdrPathObj) )
1021 Point aPos = aRect.TopLeft();
1022 aRect = rOldObj.GetLogicRect();
1023 aRect.SetPos(aPos);
1026 aAttr.Put(rAttr);
1028 if ( rOldForm.GetValue() == XFTFORM_NONE )
1030 long nW = aRect.GetWidth();
1031 aRect.SetSize(Size(nW, nW));
1032 aAttr.Put(XFormTextStyleItem(XFT_ROTATE));
1035 Point aCenter = aRect.Center();
1037 switch ( eForm )
1039 case XFTFORM_TOPCIRC:
1040 case XFTFORM_BOTCIRC:
1041 case XFTFORM_LFTCIRC:
1042 case XFTFORM_RGTCIRC:
1043 case XFTFORM_TOPARC:
1044 case XFTFORM_BOTARC:
1045 case XFTFORM_LFTARC:
1046 case XFTFORM_RGTARC:
1048 long nBeg, nEnd;
1050 switch ( eForm )
1052 default: ; //prevent warning
1053 case XFTFORM_TOPCIRC:
1054 nBeg = 0;
1055 nEnd = 18000;
1056 break;
1057 case XFTFORM_BOTCIRC:
1058 nBeg = 18000;
1059 nEnd = 36000;
1060 break;
1061 case XFTFORM_LFTCIRC:
1062 nBeg = 9000;
1063 nEnd = 27000;
1064 break;
1065 case XFTFORM_RGTCIRC:
1066 nBeg = 27000;
1067 nEnd = 9000;
1068 break;
1069 case XFTFORM_TOPARC:
1070 nBeg = 4500;
1071 nEnd = 13500;
1072 break;
1073 case XFTFORM_BOTARC:
1074 nBeg = 22500;
1075 nEnd = 31500;
1076 break;
1077 case XFTFORM_LFTARC:
1078 nBeg = 13500;
1079 nEnd = 22500;
1080 break;
1081 case XFTFORM_RGTARC:
1082 nBeg = 31500;
1083 nEnd = 4500;
1084 break;
1086 pNewObj = new SdrCircObj(OBJ_CARC, aRect, nBeg, nEnd);
1087 break;
1089 case XFTFORM_BUTTON1:
1091 basegfx::B2DPolyPolygon aPolyPolygon;
1092 basegfx::B2DPolygon aLine;
1093 long nR = aRect.GetWidth() / 2;
1094 basegfx::B2DPolygon aTopArc(XPolygon(aCenter, -nR, nR, 50, 1750, FALSE).getB2DPolygon());
1095 basegfx::B2DPolygon aBottomArc(XPolygon(aCenter, -nR, nR, 1850, 3550, FALSE).getB2DPolygon());
1097 // Polygone schliessen
1098 aTopArc.setClosed(true);
1099 aBottomArc.setClosed(true);
1100 aPolyPolygon.append(aTopArc);
1102 aLine.append(aBottomArc.getB2DPoint(aBottomArc.count() - 1L));
1103 aLine.append(aBottomArc.getB2DPoint(0L));
1104 aLine.setClosed(true);
1106 aPolyPolygon.append(aLine);
1107 aPolyPolygon.append(aBottomArc);
1109 pNewObj = new SdrPathObj(OBJ_PATHFILL, aPolyPolygon);
1110 eAdjust = XFT_CENTER;
1111 break;
1113 case XFTFORM_BUTTON2:
1114 case XFTFORM_BUTTON3:
1115 case XFTFORM_BUTTON4:
1117 basegfx::B2DPolyPolygon aPolyPolygon;
1118 basegfx::B2DPolygon aLine;
1119 long nR = aRect.GetWidth() / 2;
1120 long nWDiff = nR / 5;
1121 long nHDiff;
1123 if ( eForm == XFTFORM_BUTTON4 )
1125 basegfx::B2DPolygon aNewArc(XPolygon(aCenter, -nR, nR, 950, 2650, FALSE).getB2DPolygon());
1126 aNewArc.setClosed(true);
1127 aPolyPolygon.append(aNewArc);
1128 eAdjust = XFT_CENTER;
1130 else
1132 basegfx::B2DPolygon aNewArc(XPolygon(aCenter, -nR, nR, 2700, 2700).getB2DPolygon());
1133 aPolyPolygon.append(aNewArc);
1136 if ( eForm == XFTFORM_BUTTON3 )
1137 nHDiff = -aRect.GetHeight() / 10;
1138 else
1139 nHDiff = aRect.GetHeight() / 20;
1141 aLine.append(basegfx::B2DPoint(aRect.Left() + nWDiff, aRect.Center().Y() + nHDiff));
1142 aLine.append(basegfx::B2DPoint(aRect.Right() - nWDiff, aRect.Center().Y() + nHDiff));
1143 aLine.setClosed(true);
1144 aPolyPolygon.append(aLine);
1146 if ( eForm == XFTFORM_BUTTON4 )
1148 basegfx::B2DPolygon aNewArc(XPolygon(aCenter, -nR, nR, 2750, 850, FALSE).getB2DPolygon());
1149 aNewArc.setClosed(true);
1150 aPolyPolygon.append(aNewArc);
1153 if ( eForm == XFTFORM_BUTTON3 )
1155 nHDiff += nHDiff;
1156 aLine.setB2DPoint(0L, basegfx::B2DPoint(aLine.getB2DPoint(0L).getX(), aLine.getB2DPoint(0L).getY() - nHDiff));
1157 aLine.setB2DPoint(1L, basegfx::B2DPoint(aLine.getB2DPoint(1L).getX(), aLine.getB2DPoint(1L).getY() - nHDiff));
1158 aPolyPolygon.append(aLine);
1161 pNewObj = new SdrPathObj(OBJ_PATHFILL, aPolyPolygon);
1162 break;
1164 default: ; //prevent warning
1166 if ( pNewObj )
1168 // #78478# due to DLs changes in Outliner the object needs
1169 // a model to get an outliner for later calls to
1170 // pNewObj->SetOutlinerParaObject(pPara) (see below).
1171 pNewObj->SetModel(rOldObj.GetModel());
1173 Size aSize;
1174 Rectangle aSnap = pNewObj->GetSnapRect();
1176 aSize.Width() = aRect.Left() - aSnap.Left();
1177 aSize.Height() = aRect.Top() - aSnap.Top();
1178 pNewObj->NbcMove(aSize);
1180 rView.BegUndo( SVX_RESSTR( RID_SVXSTR_FONTWORK_UNDOCREATE ) );
1181 OutlinerParaObject* pPara = rOldObj.GetOutlinerParaObject();
1182 BOOL bHide = TRUE;
1184 if ( pPara != NULL )
1186 pPara = new OutlinerParaObject(*pPara);
1187 pNewObj->SetOutlinerParaObject(pPara);
1189 else
1190 bHide = FALSE;
1192 rView.ReplaceObjectAtView(&rOldObj, rPV, pNewObj, TRUE);
1193 pNewObj->SetLayer(rOldObj.GetLayer());
1194 aAttr.Put(XFormTextHideFormItem(bHide));
1195 aAttr.Put(XFormTextAdjustItem(eAdjust));
1197 XFormTextShadow eShadow = XFTSHADOW_NONE;
1199 if ( nLastShadowTbxId == TBI_SHADOW_NORMAL )
1201 eShadow = XFTSHADOW_NORMAL;
1202 aAttr.Put(XFormTextShadowXValItem(nSaveShadowX));
1203 aAttr.Put(XFormTextShadowYValItem(nSaveShadowY));
1205 else if ( nLastShadowTbxId == TBI_SHADOW_SLANT )
1207 eShadow = XFTSHADOW_SLANT;
1208 aAttr.Put(XFormTextShadowXValItem(nSaveShadowAngle));
1209 aAttr.Put(XFormTextShadowYValItem(nSaveShadowSize));
1212 aAttr.Put(XFormTextShadowItem(eShadow));
1214 rView.SetAttributes(aAttr);
1215 rView.EndUndo();
1219 void SvxFontWorkDialog::DataChanged( const DataChangedEvent& rDCEvt )
1221 if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
1222 ApplyImageList();
1224 SfxDockingWindow::DataChanged( rDCEvt );
1226 /* -----------------------------08.05.2002 14:28------------------------------
1228 ---------------------------------------------------------------------------*/
1229 void SvxFontWorkDialog::ApplyImageList()
1231 bool bHighContrast =
1232 (GetSettings().GetStyleSettings().GetHighContrastMode() != 0) &&
1233 (GetDisplayBackground().GetColor().IsDark() != 0);
1235 ResMgr* _pMgr = &DIALOG_MGR();
1237 USHORT nBitmapResId = bHighContrast ? RID_SVXBMP_FONTWORK_FORM1_H : RID_SVXBMP_FONTWORK_FORM1;
1238 USHORT nTextResId = RID_SVXSTR_FONTWORK_FORM1;
1240 bool bInit = aFormSet.GetItemCount() == 0;
1242 if( bInit )
1245 Size aSize( aTbxStyle.CalcWindowSizePixel() );
1246 Bitmap aBmp(ResId(RID_SVXBMP_FONTWORK_FORM1,_pMgr));
1247 aSize.Height() = aFormSet.CalcWindowSizePixel(aBmp.GetSizePixel()).Height() + 2;
1248 aFormSet.SetSizePixel(aSize);
1252 USHORT i;
1253 for( i = 1; i < 13; i++, nTextResId++, nBitmapResId++ )
1255 if( bInit )
1257 aFormSet.InsertItem( i, Bitmap(ResId(nBitmapResId,*_pMgr)),
1258 String(ResId(nTextResId,*_pMgr)));
1260 else
1262 aFormSet.SetItemImage( i, Bitmap(ResId(nBitmapResId,*_pMgr)) );
1266 ImageList& rImgLst = bHighContrast ? maImageListH : maImageList;
1268 aTbxStyle.SetImageList( rImgLst );
1269 aTbxAdjust.SetImageList( rImgLst );
1270 aTbxShadow.SetImageList( rImgLst );
1272 switch( nLastShadowTbxId )
1274 case TBI_SHADOW_SLANT:
1275 aFbShadowX.SetImage( rImgLst.GetImage( TBI_SHADOW_ANGLE ) );
1276 aFbShadowY.SetImage( rImgLst.GetImage( TBI_SHADOW_SIZE ) );
1277 break;
1278 // case TBI_SHADOW_NORMAL:
1279 default:
1280 aFbShadowX.SetImage( rImgLst.GetImage( TBI_SHADOW_XDIST ) );
1281 aFbShadowY.SetImage( rImgLst.GetImage( TBI_SHADOW_YDIST ) );
1282 break;
1285 aFbDistance.SetImage( rImgLst.GetImage( TBI_DISTANCE ) );
1286 aFbTextStart.SetImage( rImgLst.GetImage( TBI_TEXTSTART ) );