masterfix DEV300: #i10000# build fix
[LibreOffice.git] / cui / source / tabpages / textanim.cxx
blobe9a27adc2cd4b9d8889b2ca0131b99647629d5e0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_cui.hxx"
31 // include ---------------------------------------------------------------
32 #include <sfx2/app.hxx>
33 #include <sfx2/module.hxx>
34 #include <tools/shl.hxx>
36 #include <cuires.hrc>
37 #include <svx/dialogs.hrc>
39 #ifndef _SVX_TEXTANIM_CXX
40 #define _SVX_TEXTANIM_CXX
41 #endif
42 #include "textanim.hxx"
43 #include "textanim.hrc"
44 #include "textattr.hxx"
45 #include <dialmgr.hxx>
46 #include "svx/dlgutil.hxx"
48 static sal_uInt16 pRanges[] =
50 SDRATTR_TEXT_ANIKIND,
51 SDRATTR_TEXT_ANIAMOUNT,
55 /*************************************************************************
57 |* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
59 \************************************************************************/
61 __EXPORT SvxTextTabDialog::SvxTextTabDialog( Window* pParent,
62 const SfxItemSet* pAttr,
63 const SdrView* pSdrView ) :
64 SfxTabDialog ( pParent, CUI_RES( RID_SVXDLG_TEXT ), pAttr ),
65 rOutAttrs ( *pAttr ),
66 pView ( pSdrView )
68 FreeResource();
70 AddTabPage( RID_SVXPAGE_TEXTATTR, SvxTextAttrPage::Create, 0);
71 AddTabPage( RID_SVXPAGE_TEXTANIMATION, SvxTextAnimationPage::Create, 0);
74 /*************************************************************************
76 |* PageCreated()
78 \************************************************************************/
80 void __EXPORT SvxTextTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
82 switch( nId )
84 case RID_SVXPAGE_TEXTATTR:
86 ( (SvxTextAttrPage&) rPage ).SetView( pView );
87 ( (SvxTextAttrPage&) rPage ).Construct();
89 break;
91 case RID_SVXPAGE_TEXTANIMATION:
92 break;
94 default:
95 break;
100 /*************************************************************************
102 |* Page
104 \************************************************************************/
106 SvxTextAnimationPage::SvxTextAnimationPage( Window* pWindow, const SfxItemSet& rInAttrs ) :
107 SfxTabPage ( pWindow, CUI_RES( RID_SVXPAGE_TEXTANIMATION ),
108 rInAttrs ),
109 aFlEffect ( this, CUI_RES(FL_EFFECT)),
110 aFtEffects ( this, CUI_RES(FT_EFFECTS)),
111 aLbEffect ( this, CUI_RES( LB_EFFECT ) ),
112 //aCtlEffect ( this, CUI_RES( CTL_EFFECT ) ),
113 aFtDirection ( this, CUI_RES(FT_DIRECTION) ),
114 aBtnUp ( this, CUI_RES( BTN_UP ) ),
115 aBtnLeft ( this, CUI_RES( BTN_LEFT ) ),
116 aBtnRight ( this, CUI_RES( BTN_RIGHT ) ),
117 aBtnDown ( this, CUI_RES( BTN_DOWN ) ),
119 aFlProperties ( this, CUI_RES(FL_PROPERTIES)),
120 aTsbStartInside ( this, CUI_RES( TSB_START_INSIDE ) ),
121 aTsbStopInside ( this, CUI_RES( TSB_STOP_INSIDE ) ),
123 aFtCount ( this, CUI_RES(FT_COUNT)),
124 aTsbEndless ( this, CUI_RES( TSB_ENDLESS ) ),
125 aNumFldCount ( this, CUI_RES( NUM_FLD_COUNT ) ),
127 aFtAmount ( this, CUI_RES(FT_AMOUNT)),
128 aTsbPixel ( this, CUI_RES( TSB_PIXEL ) ),
129 aMtrFldAmount ( this, CUI_RES( MTR_FLD_AMOUNT ) ),
131 aFtDelay ( this, CUI_RES(FT_DELAY)),
132 aTsbAuto ( this, CUI_RES( TSB_AUTO ) ),
133 aMtrFldDelay ( this, CUI_RES( MTR_FLD_DELAY ) ),
135 rOutAttrs ( rInAttrs ),
136 eAniKind ( SDRTEXTANI_NONE )
138 FreeResource();
140 eFUnit = GetModuleFieldUnit( rInAttrs );
141 SfxItemPool* pPool = rOutAttrs.GetPool();
142 DBG_ASSERT( pPool, "Wo ist der Pool" );
143 eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST );
145 Construct();
147 aLbEffect.SetSelectHdl(
148 LINK( this, SvxTextAnimationPage, SelectEffectHdl_Impl ) );
149 aTsbEndless.SetClickHdl(
150 LINK( this, SvxTextAnimationPage, ClickEndlessHdl_Impl ) );
151 aTsbAuto.SetClickHdl(
152 LINK( this, SvxTextAnimationPage, ClickAutoHdl_Impl ) );
153 aTsbPixel.SetClickHdl(
154 LINK( this, SvxTextAnimationPage, ClickPixelHdl_Impl ) );
156 Link aLink( LINK( this, SvxTextAnimationPage, ClickDirectionHdl_Impl ) );
157 aBtnUp.SetClickHdl( aLink );
158 aBtnLeft.SetClickHdl( aLink );
159 aBtnRight.SetClickHdl( aLink );
160 aBtnDown.SetClickHdl( aLink );
162 aNumFldCount.SetAccessibleRelationLabeledBy( &aTsbEndless );
163 aMtrFldAmount.SetAccessibleRelationLabeledBy( &aTsbPixel );
164 aMtrFldDelay.SetAccessibleRelationLabeledBy( &aTsbAuto );
166 aBtnUp.SetAccessibleRelationLabeledBy( &aFtDirection );
167 aBtnLeft.SetAccessibleRelationLabeledBy( &aFtDirection );
168 aBtnRight.SetAccessibleRelationLabeledBy( &aFtDirection );
169 aBtnDown.SetAccessibleRelationLabeledBy( &aFtDirection );
171 aBtnUp.SetAccessibleRelationMemberOf( &aFlEffect );
172 aBtnLeft.SetAccessibleRelationMemberOf( &aFlEffect );
173 aBtnRight.SetAccessibleRelationMemberOf( &aFlEffect );
174 aBtnDown.SetAccessibleRelationMemberOf( &aFlEffect );
176 aTsbEndless.SetAccessibleRelationLabeledBy( &aFtCount );
177 aTsbPixel.SetAccessibleRelationLabeledBy( &aFtAmount );
178 aTsbAuto.SetAccessibleRelationLabeledBy( &aFtDelay );
181 /*************************************************************************
183 |* Dtor
185 \************************************************************************/
187 SvxTextAnimationPage::~SvxTextAnimationPage()
191 /*************************************************************************
193 |* Liest uebergebenen Item-Set
195 \************************************************************************/
197 void __EXPORT SvxTextAnimationPage::Reset( const SfxItemSet& rAttrs )
199 const SfxItemPool* pPool = rAttrs.GetPool();
201 // Animationstyp
202 const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIKIND );
204 if( !pItem )
205 pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIKIND );
206 if( pItem )
208 eAniKind = ( ( const SdrTextAniKindItem* )pItem )->GetValue();
209 aLbEffect.SelectEntryPos( sal::static_int_cast< sal_uInt16 >(eAniKind) );
211 else
212 aLbEffect.SetNoSelection();
213 aLbEffect.SaveValue();
215 // Animationsrichtung
216 pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIDIRECTION );
217 if( !pItem )
218 pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDIRECTION );
219 if( pItem )
221 SdrTextAniDirection eValue = ( ( const SdrTextAniDirectionItem* )pItem )->GetValue();
222 SelectDirection( eValue );
224 else
226 aBtnUp.Check( sal_False );
227 aBtnLeft.Check( sal_False );
228 aBtnRight.Check( sal_False );
229 aBtnDown.Check( sal_False );
231 aBtnUp.SaveValue();
232 aBtnLeft.SaveValue();
233 aBtnRight.SaveValue();
234 aBtnDown.SaveValue();
236 // Start inside
237 pItem = GetItem( rAttrs, SDRATTR_TEXT_ANISTARTINSIDE );
238 if( !pItem )
239 pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANISTARTINSIDE );
240 if( pItem )
242 aTsbStartInside.EnableTriState( sal_False );
243 sal_Bool bValue = ( ( const SdrTextAniStartInsideItem* )pItem )->GetValue();
244 if( bValue )
245 aTsbStartInside.SetState( STATE_CHECK );
246 else
247 aTsbStartInside.SetState( STATE_NOCHECK );
249 else
250 aTsbStartInside.SetState( STATE_DONTKNOW );
251 aTsbStartInside.SaveValue();
253 // Stop inside
254 pItem = GetItem( rAttrs, SDRATTR_TEXT_ANISTOPINSIDE );
255 if( !pItem )
256 pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANISTOPINSIDE );
257 if( pItem )
259 aTsbStopInside.EnableTriState( sal_False );
260 sal_Bool bValue = ( ( const SdrTextAniStopInsideItem* )pItem )->GetValue();
261 if( bValue )
262 aTsbStopInside.SetState( STATE_CHECK );
263 else
264 aTsbStopInside.SetState( STATE_NOCHECK );
266 else
267 aTsbStopInside.SetState( STATE_DONTKNOW );
268 aTsbStopInside.SaveValue();
270 // Anzahl
271 pItem = GetItem( rAttrs, SDRATTR_TEXT_ANICOUNT );
272 if( !pItem )
273 pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANICOUNT );
274 if( pItem )
276 aTsbEndless.EnableTriState( sal_False );
277 long nValue = (long) ( ( const SdrTextAniCountItem* )pItem )->GetValue();
278 aNumFldCount.SetValue( nValue );
279 if( nValue == 0 )
281 if( eAniKind == SDRTEXTANI_SLIDE )
283 aTsbEndless.SetState( STATE_NOCHECK );
284 aTsbEndless.Enable( sal_False );
286 else
288 aTsbEndless.SetState( STATE_CHECK );
289 aNumFldCount.SetEmptyFieldValue();
292 else
293 aTsbEndless.SetState( STATE_NOCHECK );
295 else
297 aNumFldCount.SetEmptyFieldValue();
298 aTsbEndless.SetState( STATE_DONTKNOW );
300 aTsbEndless.SaveValue();
301 aNumFldCount.SaveValue();
303 // Verzoegerung
304 pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIDELAY );
305 if( !pItem )
306 pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDELAY );
307 if( pItem )
309 aTsbAuto.EnableTriState( sal_False );
310 long nValue = (long) ( ( const SdrTextAniDelayItem* )pItem )->GetValue();
311 aMtrFldDelay.SetValue( nValue );
312 if( nValue == 0 )
314 aTsbAuto.SetState( STATE_CHECK );
315 aMtrFldDelay.SetEmptyFieldValue();
317 else
318 aTsbAuto.SetState( STATE_NOCHECK );
320 else
322 aMtrFldDelay.SetEmptyFieldValue();
323 aTsbAuto.SetState( STATE_DONTKNOW );
325 aTsbAuto.SaveValue();
326 aMtrFldDelay.SaveValue();
328 // Schrittweite
329 pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIAMOUNT );
330 if( !pItem )
331 pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIAMOUNT );
332 if( pItem )
334 aTsbPixel.EnableTriState( sal_False );
335 long nValue = (long) ( ( const SdrTextAniAmountItem* )pItem )->GetValue();
336 if( nValue <= 0 )
338 aTsbPixel.SetState( STATE_CHECK );
339 nValue = -nValue;
340 if( nValue == 0 )
341 nValue++;
342 aMtrFldAmount.SetUnit( FUNIT_CUSTOM );
343 aMtrFldAmount.SetDecimalDigits( 0 );
345 aMtrFldAmount.SetSpinSize( 1 );
346 aMtrFldAmount.SetMin( 1 );
347 aMtrFldAmount.SetFirst( 1 );
348 aMtrFldAmount.SetMax( 100 );
349 aMtrFldAmount.SetLast( 100 );
351 aMtrFldAmount.SetValue( nValue );
353 else
355 aTsbPixel.SetState( STATE_NOCHECK );
356 aMtrFldAmount.SetUnit( eFUnit );
357 aMtrFldAmount.SetDecimalDigits( 2 );
359 aMtrFldAmount.SetSpinSize( 10 );
360 aMtrFldAmount.SetMin( 1 );
361 aMtrFldAmount.SetFirst( 1 );
362 aMtrFldAmount.SetMax( 10000 );
363 aMtrFldAmount.SetLast( 10000 );
365 SetMetricValue( aMtrFldAmount, nValue, eUnit );
368 else
370 aMtrFldAmount.Disable();
371 aMtrFldAmount.SetEmptyFieldValue();
372 aTsbPixel.SetState( STATE_DONTKNOW );
374 aTsbPixel.SaveValue();
375 aMtrFldAmount.SaveValue();
378 SelectEffectHdl_Impl( NULL );
379 ClickEndlessHdl_Impl( NULL );
380 ClickAutoHdl_Impl( NULL );
381 //ClickPixelHdl_Impl( NULL );
384 /*************************************************************************
386 |* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen
388 \************************************************************************/
390 sal_Bool SvxTextAnimationPage::FillItemSet( SfxItemSet& rAttrs)
392 sal_Bool bModified = sal_False;
393 sal_uInt16 nPos;
394 TriState eState;
396 // Animationstyp
397 nPos = aLbEffect.GetSelectEntryPos();
398 if( nPos != LISTBOX_ENTRY_NOTFOUND &&
399 nPos != aLbEffect.GetSavedValue() )
401 rAttrs.Put( SdrTextAniKindItem( (SdrTextAniKind) nPos ) );
402 bModified = sal_True;
405 // Animationsrichtung
406 if( aBtnUp.GetSavedValue() != aBtnUp.IsChecked() ||
407 aBtnLeft.GetSavedValue() != aBtnLeft.IsChecked() ||
408 aBtnRight.GetSavedValue() != aBtnRight.IsChecked() ||
409 aBtnDown.GetSavedValue() != aBtnDown.IsChecked() )
411 SdrTextAniDirection eValue = (SdrTextAniDirection) GetSelectedDirection();
412 rAttrs.Put( SdrTextAniDirectionItem( eValue ) );
413 bModified = sal_True;
416 // Start inside
417 eState = aTsbStartInside.GetState();
418 if( eState != aTsbStartInside.GetSavedValue() )
420 rAttrs.Put( SdrTextAniStartInsideItem( (sal_Bool) STATE_CHECK == eState ) );
421 bModified = sal_True;
424 // Stop inside
425 eState = aTsbStopInside.GetState();
426 if( eState != aTsbStopInside.GetSavedValue() )
428 rAttrs.Put( SdrTextAniStopInsideItem( (sal_Bool) STATE_CHECK == eState ) );
429 bModified = sal_True;
432 // Anzahl
433 eState = aTsbEndless.GetState();
434 String aStr = aNumFldCount.GetText();
435 if( eState != aTsbEndless.GetSavedValue() ||
436 aStr != aNumFldCount.GetSavedValue() )
438 sal_Int64 nValue = 0;
439 if( eState == STATE_CHECK /*#89844#*/ && aTsbEndless.IsEnabled())
440 bModified = sal_True;
441 else
443 if( aStr != aNumFldCount.GetSavedValue() )
445 nValue = aNumFldCount.GetValue();
446 bModified = sal_True;
449 if( bModified )
450 rAttrs.Put( SdrTextAniCountItem( (sal_uInt16) nValue ) );
453 // Verzoegerung
454 eState = aTsbAuto.GetState();
455 aStr = aMtrFldDelay.GetText();
456 if( eState != aTsbAuto.GetSavedValue() ||
457 aStr != aMtrFldDelay.GetSavedValue() )
459 sal_Int64 nValue = 0;
460 if( eState == STATE_CHECK )
461 bModified = sal_True;
462 else
464 if( aStr != aMtrFldDelay.GetSavedValue() )
466 nValue = aMtrFldDelay.GetValue();
467 bModified = sal_True;
470 if( bModified )
471 rAttrs.Put( SdrTextAniDelayItem( (sal_uInt16) nValue ) );
474 // Schrittweite
475 eState = aTsbPixel.GetState();
476 aStr = aMtrFldAmount.GetText();
477 if( eState != aTsbPixel.GetSavedValue() ||
478 aStr != aMtrFldAmount.GetSavedValue() )
480 sal_Int64 nValue = 0;
481 if( eState == STATE_CHECK )
483 nValue = aMtrFldAmount.GetValue();
484 nValue = -nValue;
486 else
488 nValue = GetCoreValue( aMtrFldAmount, eUnit );
490 rAttrs.Put( SdrTextAniAmountItem( (sal_Int16) nValue ) );
492 bModified = sal_True;
495 return( bModified );
498 /*************************************************************************
502 \************************************************************************/
504 void SvxTextAnimationPage::Construct()
508 /*************************************************************************
512 \************************************************************************/
514 sal_uInt16* SvxTextAnimationPage::GetRanges()
516 return( pRanges );
519 /*************************************************************************
521 |* Erzeugt die Seite
523 \************************************************************************/
525 SfxTabPage* SvxTextAnimationPage::Create( Window* pWindow,
526 const SfxItemSet& rAttrs )
528 return( new SvxTextAnimationPage( pWindow, rAttrs ) );
531 /*************************************************************************
535 \************************************************************************/
537 IMPL_LINK( SvxTextAnimationPage, SelectEffectHdl_Impl, void *, EMPTYARG )
539 sal_uInt16 nPos = aLbEffect.GetSelectEntryPos();
540 if( nPos != LISTBOX_ENTRY_NOTFOUND )
542 eAniKind = (SdrTextAniKind) nPos;
543 switch( eAniKind )
545 case SDRTEXTANI_NONE:
547 aFtDirection.Disable();
548 aBtnUp.Disable();
549 aBtnLeft.Disable();
550 aBtnRight.Disable();
551 aBtnDown.Disable();
552 aTsbStartInside.Disable();
553 aTsbStopInside.Disable();
555 aTsbEndless.Disable();
556 aNumFldCount.Disable();
557 aFtCount.Disable();
559 aTsbAuto.Disable();
560 aMtrFldDelay.Disable();
561 aFtDelay.Disable();
563 aTsbPixel.Disable();
564 aMtrFldAmount.Disable();
565 aFtAmount.Disable();
567 break;
569 case SDRTEXTANI_BLINK:
570 case SDRTEXTANI_SCROLL:
571 case SDRTEXTANI_ALTERNATE:
572 case SDRTEXTANI_SLIDE:
574 if( eAniKind == SDRTEXTANI_SLIDE )
576 aTsbStartInside.Disable();
577 aTsbStopInside.Disable();
579 aTsbEndless.Disable();
580 aNumFldCount.Enable();
581 aNumFldCount.SetValue( aNumFldCount.GetValue() );
583 else
585 aTsbStartInside.Enable();
586 aTsbStopInside.Enable();
588 aTsbEndless.Enable();
589 ClickEndlessHdl_Impl( NULL );
591 aFtCount.Enable();
593 aTsbAuto.Enable();
594 aFtDelay.Enable();
595 ClickAutoHdl_Impl( NULL );
597 if( eAniKind == SDRTEXTANI_BLINK )
599 aFtDirection.Disable();
600 aBtnUp.Disable();
601 aBtnLeft.Disable();
602 aBtnRight.Disable();
603 aBtnDown.Disable();
605 aTsbPixel.Disable();
606 aMtrFldAmount.Disable();
607 aFtAmount.Disable();
609 else
611 aFtDirection.Enable();
612 aBtnUp.Enable();
613 aBtnLeft.Enable();
614 aBtnRight.Enable();
615 aBtnDown.Enable();
617 aTsbPixel.Enable();
618 aMtrFldAmount.Enable();
619 aFtAmount.Enable();
622 break;
626 return( 0L );
629 /*************************************************************************
633 \************************************************************************/
635 IMPL_LINK( SvxTextAnimationPage, ClickEndlessHdl_Impl, void *, EMPTYARG )
638 if( eAniKind != SDRTEXTANI_SLIDE )
640 TriState eState = aTsbEndless.GetState();
641 if( eState != STATE_NOCHECK )
643 aNumFldCount.Disable();
644 aNumFldCount.SetEmptyFieldValue();
646 else
648 aNumFldCount.Enable();
649 aNumFldCount.SetValue( aNumFldCount.GetValue() );
652 return( 0L );
655 /*************************************************************************
659 \************************************************************************/
661 IMPL_LINK( SvxTextAnimationPage, ClickAutoHdl_Impl, void *, EMPTYARG )
663 TriState eState = aTsbAuto.GetState();
664 if( eState != STATE_NOCHECK )
666 aMtrFldDelay.Disable();
667 aMtrFldDelay.SetEmptyFieldValue();
669 else
671 aMtrFldDelay.Enable();
672 aMtrFldDelay.SetValue( aMtrFldDelay.GetValue() );
675 return( 0L );
678 /*************************************************************************
682 \************************************************************************/
684 IMPL_LINK( SvxTextAnimationPage, ClickPixelHdl_Impl, void *, EMPTYARG )
686 TriState eState = aTsbPixel.GetState();
687 if( eState == STATE_CHECK )
689 sal_Int64 nValue = aMtrFldAmount.GetValue() / 10;
690 aMtrFldAmount.Enable();
691 aMtrFldAmount.SetUnit( FUNIT_CUSTOM );
692 //SetFieldUnit( aMtrFldAmount, FUNIT_CUSTOM );
693 aMtrFldAmount.SetDecimalDigits( 0 );
695 aMtrFldAmount.SetSpinSize( 1 );
696 aMtrFldAmount.SetMin( 1 );
697 aMtrFldAmount.SetFirst( 1 );
698 aMtrFldAmount.SetMax( 100 );
699 aMtrFldAmount.SetLast( 100 );
701 aMtrFldAmount.SetValue( nValue );
703 else if( eState == STATE_NOCHECK )
705 sal_Int64 nValue = aMtrFldAmount.GetValue() * 10;
706 aMtrFldAmount.Enable();
707 aMtrFldAmount.SetUnit( eFUnit );
708 //SetFieldUnit( aMtrFldAmount, eFUnit );
709 aMtrFldAmount.SetDecimalDigits( 2 );
711 aMtrFldAmount.SetSpinSize( 10 );
712 aMtrFldAmount.SetMin( 1 );
713 aMtrFldAmount.SetFirst( 1 );
714 aMtrFldAmount.SetMax( 10000 );
715 aMtrFldAmount.SetLast( 10000 );
717 aMtrFldAmount.SetValue( nValue );
720 return( 0L );
723 /*************************************************************************
727 \************************************************************************/
729 IMPL_LINK( SvxTextAnimationPage, ClickDirectionHdl_Impl, ImageButton *, pBtn )
731 aBtnUp.Check( pBtn == &aBtnUp );
732 aBtnLeft.Check( pBtn == &aBtnLeft );
733 aBtnRight.Check( pBtn == &aBtnRight );
734 aBtnDown.Check( pBtn == &aBtnDown );
736 return( 0L );
739 /*************************************************************************
743 \************************************************************************/
745 void SvxTextAnimationPage::SelectDirection( SdrTextAniDirection nValue )
747 aBtnUp.Check( nValue == SDRTEXTANI_UP );
748 aBtnLeft.Check( nValue == SDRTEXTANI_LEFT );
749 aBtnRight.Check( nValue == SDRTEXTANI_RIGHT );
750 aBtnDown.Check( nValue == SDRTEXTANI_DOWN );
753 /*************************************************************************
757 \************************************************************************/
759 sal_uInt16 SvxTextAnimationPage::GetSelectedDirection()
761 sal_uInt16 nValue = 0;
763 if( aBtnUp.IsChecked() )
764 nValue = SDRTEXTANI_UP;
765 else if( aBtnLeft.IsChecked() )
766 nValue = SDRTEXTANI_LEFT;
767 else if( aBtnRight.IsChecked() )
768 nValue = SDRTEXTANI_RIGHT;
769 else if( aBtnDown.IsChecked() )
770 nValue = SDRTEXTANI_DOWN;
772 return( nValue );