xref: /aoo42x/main/cui/source/tabpages/textanim.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
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.
14  *
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).
20  *
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.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_cui.hxx"
30 
31 // include ---------------------------------------------------------------
32 #include <sfx2/app.hxx>
33 #include <sfx2/module.hxx>
34 #include <tools/shl.hxx>
35 
36 #include <cuires.hrc>
37 #include <svx/dialogs.hrc>
38 
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"
47 
48 static sal_uInt16 pRanges[] =
49 {
50 	SDRATTR_TEXT_ANIKIND,
51 	SDRATTR_TEXT_ANIAMOUNT,
52 	0
53 };
54 
55 /*************************************************************************
56 |*
57 |* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
58 |*
59 \************************************************************************/
60 
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 )
67 {
68 	FreeResource();
69 
70 	AddTabPage( RID_SVXPAGE_TEXTATTR, SvxTextAttrPage::Create, 0);
71 	AddTabPage( RID_SVXPAGE_TEXTANIMATION, SvxTextAnimationPage::Create, 0);
72 }
73 
74 /*************************************************************************
75 |*
76 |* PageCreated()
77 |*
78 \************************************************************************/
79 
80 void __EXPORT SvxTextTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
81 {
82 	switch( nId )
83 	{
84 		case RID_SVXPAGE_TEXTATTR:
85 		{
86 			( (SvxTextAttrPage&) rPage ).SetView( pView );
87 			( (SvxTextAttrPage&) rPage ).Construct();
88 		}
89 		break;
90 
91 		case RID_SVXPAGE_TEXTANIMATION:
92 		break;
93 
94 		default:
95 		break;
96 	}
97 }
98 
99 
100 /*************************************************************************
101 |*
102 |* Page
103 |*
104 \************************************************************************/
105 
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 ) ),
118 
119 				aFlProperties   ( this, CUI_RES(FL_PROPERTIES)),
120 				aTsbStartInside	( this, CUI_RES( TSB_START_INSIDE ) ),
121 				aTsbStopInside	( this, CUI_RES( TSB_STOP_INSIDE ) ),
122 
123 				aFtCount		( this, CUI_RES(FT_COUNT)),
124 				aTsbEndless		( this, CUI_RES( TSB_ENDLESS ) ),
125 				aNumFldCount	( this, CUI_RES( NUM_FLD_COUNT ) ),
126 
127 				aFtAmount		( this, CUI_RES(FT_AMOUNT)),
128 				aTsbPixel		( this, CUI_RES( TSB_PIXEL ) ),
129 				aMtrFldAmount	( this, CUI_RES( MTR_FLD_AMOUNT ) ),
130 
131 				aFtDelay		( this, CUI_RES(FT_DELAY)),
132 				aTsbAuto   		( this, CUI_RES( TSB_AUTO ) ),
133 				aMtrFldDelay	( this, CUI_RES( MTR_FLD_DELAY ) ),
134 
135 				rOutAttrs		( rInAttrs ),
136 				eAniKind		( SDRTEXTANI_NONE )
137 {
138 	FreeResource();
139 
140 	eFUnit = GetModuleFieldUnit( rInAttrs );
141 	SfxItemPool* pPool = rOutAttrs.GetPool();
142 	DBG_ASSERT( pPool, "Wo ist der Pool" );
143 	eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST );
144 
145 	Construct();
146 
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 ) );
155 
156 	Link aLink( LINK( this, SvxTextAnimationPage, ClickDirectionHdl_Impl ) );
157 	aBtnUp.SetClickHdl( aLink );
158 	aBtnLeft.SetClickHdl( aLink );
159 	aBtnRight.SetClickHdl( aLink );
160 	aBtnDown.SetClickHdl( aLink );
161 
162 	aNumFldCount.SetAccessibleRelationLabeledBy( &aTsbEndless );
163 	aMtrFldAmount.SetAccessibleRelationLabeledBy( &aTsbPixel );
164 	aMtrFldDelay.SetAccessibleRelationLabeledBy( &aTsbAuto );
165 
166 	aBtnUp.SetAccessibleRelationLabeledBy( &aFtDirection );
167 	aBtnLeft.SetAccessibleRelationLabeledBy( &aFtDirection );
168 	aBtnRight.SetAccessibleRelationLabeledBy( &aFtDirection );
169 	aBtnDown.SetAccessibleRelationLabeledBy( &aFtDirection );
170 
171 	aBtnUp.SetAccessibleRelationMemberOf( &aFlEffect );
172 	aBtnLeft.SetAccessibleRelationMemberOf( &aFlEffect );
173 	aBtnRight.SetAccessibleRelationMemberOf( &aFlEffect );
174 	aBtnDown.SetAccessibleRelationMemberOf( &aFlEffect );
175 
176 	aTsbEndless.SetAccessibleRelationLabeledBy( &aFtCount );
177 	aTsbPixel.SetAccessibleRelationLabeledBy( &aFtAmount );
178 	aTsbAuto.SetAccessibleRelationLabeledBy( &aFtDelay );
179 }
180 
181 /*************************************************************************
182 |*
183 |* Dtor
184 |*
185 \************************************************************************/
186 
187 SvxTextAnimationPage::~SvxTextAnimationPage()
188 {
189 }
190 
191 /*************************************************************************
192 |*
193 |* Liest uebergebenen Item-Set
194 |*
195 \************************************************************************/
196 
197 void __EXPORT SvxTextAnimationPage::Reset( const SfxItemSet& rAttrs )
198 {
199 	const SfxItemPool* pPool = rAttrs.GetPool();
200 
201 	// Animationstyp
202 	const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIKIND );
203 
204 	if( !pItem )
205 		pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIKIND );
206 	if( pItem )
207 	{
208 		eAniKind = ( ( const SdrTextAniKindItem* )pItem )->GetValue();
209 		aLbEffect.SelectEntryPos( sal::static_int_cast< sal_uInt16 >(eAniKind) );
210 	}
211 	else
212 		aLbEffect.SetNoSelection();
213 	aLbEffect.SaveValue();
214 
215 	// Animationsrichtung
216 	pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIDIRECTION );
217 	if( !pItem )
218 		pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDIRECTION );
219 	if( pItem )
220 	{
221 		SdrTextAniDirection eValue = ( ( const SdrTextAniDirectionItem* )pItem )->GetValue();
222 		SelectDirection( eValue );
223 	}
224 	else
225 	{
226 		aBtnUp.Check( sal_False );
227 		aBtnLeft.Check( sal_False );
228 		aBtnRight.Check( sal_False );
229 		aBtnDown.Check( sal_False );
230 	}
231 	aBtnUp.SaveValue();
232 	aBtnLeft.SaveValue();
233 	aBtnRight.SaveValue();
234 	aBtnDown.SaveValue();
235 
236 	// Start inside
237 	pItem = GetItem( rAttrs, SDRATTR_TEXT_ANISTARTINSIDE );
238 	if( !pItem )
239 		pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANISTARTINSIDE );
240 	if( pItem )
241 	{
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 );
248 	}
249 	else
250 		aTsbStartInside.SetState( STATE_DONTKNOW );
251 	aTsbStartInside.SaveValue();
252 
253 	// Stop inside
254 	pItem = GetItem( rAttrs, SDRATTR_TEXT_ANISTOPINSIDE );
255 	if( !pItem )
256 		pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANISTOPINSIDE );
257 	if( pItem )
258 	{
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 );
265 	}
266 	else
267 		aTsbStopInside.SetState( STATE_DONTKNOW );
268 	aTsbStopInside.SaveValue();
269 
270 	// Anzahl
271 	pItem = GetItem( rAttrs, SDRATTR_TEXT_ANICOUNT );
272 	if( !pItem )
273 		pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANICOUNT );
274 	if( pItem )
275 	{
276 		aTsbEndless.EnableTriState( sal_False );
277 		long nValue = (long) ( ( const SdrTextAniCountItem* )pItem )->GetValue();
278 		aNumFldCount.SetValue( nValue );
279 		if( nValue == 0 )
280 		{
281 			if( eAniKind == SDRTEXTANI_SLIDE )
282 			{
283 				aTsbEndless.SetState( STATE_NOCHECK );
284 				aTsbEndless.Enable( sal_False );
285 			}
286 			else
287 			{
288 				aTsbEndless.SetState( STATE_CHECK );
289 				aNumFldCount.SetEmptyFieldValue();
290 			}
291 		}
292 		else
293 			aTsbEndless.SetState( STATE_NOCHECK );
294 	}
295 	else
296 	{
297 		aNumFldCount.SetEmptyFieldValue();
298 		aTsbEndless.SetState( STATE_DONTKNOW );
299 	}
300 	aTsbEndless.SaveValue();
301 	aNumFldCount.SaveValue();
302 
303 	// Verzoegerung
304 	pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIDELAY );
305 	if( !pItem )
306 		pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDELAY );
307 	if( pItem )
308 	{
309 		aTsbAuto.EnableTriState( sal_False );
310 		long nValue = (long) ( ( const SdrTextAniDelayItem* )pItem )->GetValue();
311 		aMtrFldDelay.SetValue( nValue );
312 		if( nValue == 0 )
313 		{
314 			aTsbAuto.SetState( STATE_CHECK );
315 			aMtrFldDelay.SetEmptyFieldValue();
316 		}
317 		else
318 			aTsbAuto.SetState( STATE_NOCHECK );
319 	}
320 	else
321 	{
322 		aMtrFldDelay.SetEmptyFieldValue();
323 		aTsbAuto.SetState( STATE_DONTKNOW );
324 	}
325 	aTsbAuto.SaveValue();
326 	aMtrFldDelay.SaveValue();
327 
328 	// Schrittweite
329 	pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIAMOUNT );
330 	if( !pItem )
331 		pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIAMOUNT );
332 	if( pItem )
333 	{
334 		aTsbPixel.EnableTriState( sal_False );
335 		long nValue = (long) ( ( const SdrTextAniAmountItem* )pItem )->GetValue();
336 		if( nValue <= 0 )
337 		{
338 			aTsbPixel.SetState( STATE_CHECK );
339 			nValue = -nValue;
340 			if( nValue == 0 )
341 				nValue++;
342 			aMtrFldAmount.SetUnit( FUNIT_CUSTOM );
343 			aMtrFldAmount.SetDecimalDigits( 0 );
344 
345 			aMtrFldAmount.SetSpinSize( 1 );
346             aMtrFldAmount.SetMin( 1 );
347 			aMtrFldAmount.SetFirst( 1 );
348             aMtrFldAmount.SetMax( 100 );
349 			aMtrFldAmount.SetLast( 100 );
350 
351 			aMtrFldAmount.SetValue( nValue );
352 		}
353 		else
354 		{
355 			aTsbPixel.SetState( STATE_NOCHECK );
356 			aMtrFldAmount.SetUnit( eFUnit );
357 			aMtrFldAmount.SetDecimalDigits( 2 );
358 
359 			aMtrFldAmount.SetSpinSize( 10 );
360             aMtrFldAmount.SetMin( 1 );
361 			aMtrFldAmount.SetFirst( 1 );
362             aMtrFldAmount.SetMax( 10000 );
363 			aMtrFldAmount.SetLast( 10000 );
364 
365 			SetMetricValue( aMtrFldAmount, nValue, eUnit );
366 		}
367 	}
368 	else
369 	{
370 		aMtrFldAmount.Disable();
371 		aMtrFldAmount.SetEmptyFieldValue();
372 		aTsbPixel.SetState( STATE_DONTKNOW );
373 	}
374 	aTsbPixel.SaveValue();
375 	aMtrFldAmount.SaveValue();
376 
377 
378 	SelectEffectHdl_Impl( NULL );
379 	ClickEndlessHdl_Impl( NULL );
380 	ClickAutoHdl_Impl( NULL );
381 	//ClickPixelHdl_Impl( NULL );
382 }
383 
384 /*************************************************************************
385 |*
386 |* Fuellt uebergebenen Item-Set mit Dialogbox-Attributen
387 |*
388 \************************************************************************/
389 
390 sal_Bool SvxTextAnimationPage::FillItemSet( SfxItemSet& rAttrs)
391 {
392 	sal_Bool bModified = sal_False;
393 	sal_uInt16 nPos;
394 	TriState eState;
395 
396 	// Animationstyp
397 	nPos = aLbEffect.GetSelectEntryPos();
398 	if( nPos != LISTBOX_ENTRY_NOTFOUND &&
399 		nPos != aLbEffect.GetSavedValue() )
400 	{
401 		rAttrs.Put( SdrTextAniKindItem( (SdrTextAniKind) nPos ) );
402 		bModified = sal_True;
403 	}
404 
405 	// Animationsrichtung
406 	if( aBtnUp.GetSavedValue() != aBtnUp.IsChecked() ||
407 		aBtnLeft.GetSavedValue() != aBtnLeft.IsChecked() ||
408 		aBtnRight.GetSavedValue() != aBtnRight.IsChecked() ||
409 		aBtnDown.GetSavedValue() != aBtnDown.IsChecked() )
410 	{
411 		SdrTextAniDirection eValue = (SdrTextAniDirection) GetSelectedDirection();
412 		rAttrs.Put( SdrTextAniDirectionItem( eValue ) );
413 		bModified = sal_True;
414 	}
415 
416 	// Start inside
417 	eState = aTsbStartInside.GetState();
418 	if( eState != aTsbStartInside.GetSavedValue() )
419 	{
420 		rAttrs.Put( SdrTextAniStartInsideItem( (sal_Bool) STATE_CHECK == eState ) );
421 		bModified = sal_True;
422 	}
423 
424 	// Stop inside
425 	eState = aTsbStopInside.GetState();
426 	if( eState != aTsbStopInside.GetSavedValue() )
427 	{
428 		rAttrs.Put( SdrTextAniStopInsideItem( (sal_Bool) STATE_CHECK == eState ) );
429 		bModified = sal_True;
430 	}
431 
432 	// Anzahl
433 	eState = aTsbEndless.GetState();
434 	String aStr = aNumFldCount.GetText();
435 	if( eState != aTsbEndless.GetSavedValue() ||
436 		aStr != aNumFldCount.GetSavedValue() )
437 	{
438 		sal_Int64 nValue = 0;
439 		if( eState == STATE_CHECK /*#89844#*/ && aTsbEndless.IsEnabled())
440 			bModified = sal_True;
441 		else
442 		{
443 			if( aStr != aNumFldCount.GetSavedValue() )
444 			{
445 				nValue = aNumFldCount.GetValue();
446 				bModified = sal_True;
447 			}
448 		}
449 		if( bModified )
450 			rAttrs.Put( SdrTextAniCountItem( (sal_uInt16) nValue ) );
451 	}
452 
453 	// Verzoegerung
454 	eState = aTsbAuto.GetState();
455 	aStr = aMtrFldDelay.GetText();
456 	if( eState != aTsbAuto.GetSavedValue() ||
457 		aStr != aMtrFldDelay.GetSavedValue() )
458 	{
459 		sal_Int64 nValue = 0;
460 		if( eState == STATE_CHECK )
461 			bModified = sal_True;
462 		else
463 		{
464 			if( aStr != aMtrFldDelay.GetSavedValue() )
465 			{
466 				nValue = aMtrFldDelay.GetValue();
467 				bModified = sal_True;
468 			}
469 		}
470 		if( bModified )
471 			rAttrs.Put( SdrTextAniDelayItem( (sal_uInt16) nValue ) );
472 	}
473 
474 	// Schrittweite
475 	eState = aTsbPixel.GetState();
476 	aStr = aMtrFldAmount.GetText();
477 	if( eState != aTsbPixel.GetSavedValue() ||
478 		aStr != aMtrFldAmount.GetSavedValue() )
479 	{
480 		sal_Int64 nValue = 0;
481 		if( eState == STATE_CHECK )
482 		{
483 			nValue = aMtrFldAmount.GetValue();
484 			nValue = -nValue;
485 		}
486 		else
487 		{
488 			nValue = GetCoreValue( aMtrFldAmount, eUnit );
489 		}
490 		rAttrs.Put( SdrTextAniAmountItem( (sal_Int16) nValue ) );
491 
492 		bModified = sal_True;
493 	}
494 
495 	return( bModified );
496 }
497 
498 /*************************************************************************
499 |*
500 |*
501 |*
502 \************************************************************************/
503 
504 void SvxTextAnimationPage::Construct()
505 {
506 }
507 
508 /*************************************************************************
509 |*
510 |*
511 |*
512 \************************************************************************/
513 
514 sal_uInt16*	SvxTextAnimationPage::GetRanges()
515 {
516 	return( pRanges );
517 }
518 
519 /*************************************************************************
520 |*
521 |* Erzeugt die Seite
522 |*
523 \************************************************************************/
524 
525 SfxTabPage* SvxTextAnimationPage::Create( Window* pWindow,
526 				const SfxItemSet& rAttrs )
527 {
528 	return( new SvxTextAnimationPage( pWindow, rAttrs ) );
529 }
530 
531 /*************************************************************************
532 |*
533 |*
534 |*
535 \************************************************************************/
536 
537 IMPL_LINK( SvxTextAnimationPage, SelectEffectHdl_Impl, void *, EMPTYARG )
538 {
539 	sal_uInt16 nPos = aLbEffect.GetSelectEntryPos();
540 	if( nPos != LISTBOX_ENTRY_NOTFOUND )
541 	{
542 		eAniKind = (SdrTextAniKind) nPos;
543 		switch( eAniKind )
544 		{
545 			case SDRTEXTANI_NONE:
546 			{
547                 aFtDirection.Disable();
548                 aBtnUp.Disable();
549 				aBtnLeft.Disable();
550 				aBtnRight.Disable();
551 				aBtnDown.Disable();
552 				aTsbStartInside.Disable();
553 				aTsbStopInside.Disable();
554 
555 				aTsbEndless.Disable();
556 				aNumFldCount.Disable();
557 				aFtCount.Disable();
558 
559 				aTsbAuto.Disable();
560 				aMtrFldDelay.Disable();
561 				aFtDelay.Disable();
562 
563 				aTsbPixel.Disable();
564 				aMtrFldAmount.Disable();
565 				aFtAmount.Disable();
566 			}
567 			break;
568 
569 			case SDRTEXTANI_BLINK:
570 			case SDRTEXTANI_SCROLL:
571 			case SDRTEXTANI_ALTERNATE:
572 			case SDRTEXTANI_SLIDE:
573 			{
574 				if( eAniKind == SDRTEXTANI_SLIDE )
575 				{
576 					aTsbStartInside.Disable();
577 					aTsbStopInside.Disable();
578 
579 					aTsbEndless.Disable();
580 					aNumFldCount.Enable();
581 					aNumFldCount.SetValue( aNumFldCount.GetValue() );
582 				}
583 				else
584 				{
585 					aTsbStartInside.Enable();
586 					aTsbStopInside.Enable();
587 
588 					aTsbEndless.Enable();
589 					ClickEndlessHdl_Impl( NULL );
590 				}
591 				aFtCount.Enable();
592 
593 				aTsbAuto.Enable();
594 				aFtDelay.Enable();
595 				ClickAutoHdl_Impl( NULL );
596 
597 				if( eAniKind == SDRTEXTANI_BLINK )
598 				{
599                     aFtDirection.Disable();
600                     aBtnUp.Disable();
601 					aBtnLeft.Disable();
602 					aBtnRight.Disable();
603 					aBtnDown.Disable();
604 
605 					aTsbPixel.Disable();
606 					aMtrFldAmount.Disable();
607 					aFtAmount.Disable();
608 				}
609 				else
610 				{
611                     aFtDirection.Enable();
612                     aBtnUp.Enable();
613 					aBtnLeft.Enable();
614 					aBtnRight.Enable();
615 					aBtnDown.Enable();
616 
617 					aTsbPixel.Enable();
618 					aMtrFldAmount.Enable();
619 					aFtAmount.Enable();
620 				}
621 			}
622 			break;
623 		}
624 
625 	}
626 	return( 0L );
627 }
628 
629 /*************************************************************************
630 |*
631 |*
632 |*
633 \************************************************************************/
634 
635 IMPL_LINK( SvxTextAnimationPage, ClickEndlessHdl_Impl, void *, EMPTYARG )
636 {
637 
638 	if( eAniKind != SDRTEXTANI_SLIDE )
639 	{
640 		TriState eState = aTsbEndless.GetState();
641 		if( eState != STATE_NOCHECK )
642 		{
643 			aNumFldCount.Disable();
644 			aNumFldCount.SetEmptyFieldValue();
645 		}
646 		else
647 		{
648 			aNumFldCount.Enable();
649 			aNumFldCount.SetValue( aNumFldCount.GetValue() );
650 		}
651 	}
652 	return( 0L );
653 }
654 
655 /*************************************************************************
656 |*
657 |*
658 |*
659 \************************************************************************/
660 
661 IMPL_LINK( SvxTextAnimationPage, ClickAutoHdl_Impl, void *, EMPTYARG )
662 {
663 	TriState eState = aTsbAuto.GetState();
664 	if( eState != STATE_NOCHECK )
665 	{
666 		aMtrFldDelay.Disable();
667 		aMtrFldDelay.SetEmptyFieldValue();
668 	}
669 	else
670 	{
671 		aMtrFldDelay.Enable();
672 		aMtrFldDelay.SetValue( aMtrFldDelay.GetValue() );
673 	}
674 
675 	return( 0L );
676 }
677 
678 /*************************************************************************
679 |*
680 |*
681 |*
682 \************************************************************************/
683 
684 IMPL_LINK( SvxTextAnimationPage, ClickPixelHdl_Impl, void *, EMPTYARG )
685 {
686 	TriState eState = aTsbPixel.GetState();
687 	if( eState == STATE_CHECK )
688 	{
689 		sal_Int64 nValue = aMtrFldAmount.GetValue() / 10;
690 		aMtrFldAmount.Enable();
691 		aMtrFldAmount.SetUnit( FUNIT_CUSTOM );
692 		//SetFieldUnit( aMtrFldAmount, FUNIT_CUSTOM );
693 		aMtrFldAmount.SetDecimalDigits( 0 );
694 
695 		aMtrFldAmount.SetSpinSize( 1 );
696         aMtrFldAmount.SetMin( 1 );
697 		aMtrFldAmount.SetFirst( 1 );
698         aMtrFldAmount.SetMax( 100 );
699 		aMtrFldAmount.SetLast( 100 );
700 
701 		aMtrFldAmount.SetValue( nValue );
702 	}
703 	else if( eState == STATE_NOCHECK )
704 	{
705 		sal_Int64 nValue = aMtrFldAmount.GetValue() * 10;
706 		aMtrFldAmount.Enable();
707 		aMtrFldAmount.SetUnit( eFUnit );
708 		//SetFieldUnit( aMtrFldAmount, eFUnit );
709 		aMtrFldAmount.SetDecimalDigits( 2 );
710 
711 		aMtrFldAmount.SetSpinSize( 10 );
712         aMtrFldAmount.SetMin( 1 );
713 		aMtrFldAmount.SetFirst( 1 );
714         aMtrFldAmount.SetMax( 10000 );
715 		aMtrFldAmount.SetLast( 10000 );
716 
717 		aMtrFldAmount.SetValue( nValue );
718 	}
719 
720 	return( 0L );
721 }
722 
723 /*************************************************************************
724 |*
725 |*
726 |*
727 \************************************************************************/
728 
729 IMPL_LINK( SvxTextAnimationPage, ClickDirectionHdl_Impl, ImageButton *, pBtn )
730 {
731 	aBtnUp.Check( pBtn == &aBtnUp );
732 	aBtnLeft.Check( pBtn == &aBtnLeft );
733 	aBtnRight.Check( pBtn == &aBtnRight );
734 	aBtnDown.Check( pBtn == &aBtnDown );
735 
736 	return( 0L );
737 }
738 
739 /*************************************************************************
740 |*
741 |*
742 |*
743 \************************************************************************/
744 
745 void SvxTextAnimationPage::SelectDirection( SdrTextAniDirection nValue )
746 {
747 	aBtnUp.Check( nValue == SDRTEXTANI_UP );
748 	aBtnLeft.Check( nValue == SDRTEXTANI_LEFT );
749 	aBtnRight.Check( nValue == SDRTEXTANI_RIGHT );
750 	aBtnDown.Check( nValue == SDRTEXTANI_DOWN );
751 }
752 
753 /*************************************************************************
754 |*
755 |*
756 |*
757 \************************************************************************/
758 
759 sal_uInt16 SvxTextAnimationPage::GetSelectedDirection()
760 {
761 	sal_uInt16 nValue = 0;
762 
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;
771 
772 	return( nValue );
773 }
774 
775 
776