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