Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #include <sfx2/app.hxx>
21 : #include <sfx2/module.hxx>
22 : #include <tools/shl.hxx>
23 :
24 : #include <cuires.hrc>
25 : #include <svx/dialogs.hrc>
26 :
27 : #include "textanim.hxx"
28 : #include "textanim.hrc"
29 : #include "textattr.hxx"
30 : #include <dialmgr.hxx>
31 : #include "svx/dlgutil.hxx"
32 :
33 : static sal_uInt16 pRanges[] =
34 : {
35 : SDRATTR_TEXT_ANIKIND,
36 : SDRATTR_TEXT_ANIAMOUNT,
37 : 0
38 : };
39 :
40 : /*************************************************************************
41 : |*
42 : |* constructor of the tab dialog: adds pages to the dialog
43 : |*
44 : \************************************************************************/
45 :
46 0 : SvxTextTabDialog::SvxTextTabDialog( Window* pParent,
47 : const SfxItemSet* pAttr,
48 : const SdrView* pSdrView ) :
49 0 : SfxTabDialog ( pParent, CUI_RES( RID_SVXDLG_TEXT ), pAttr ),
50 0 : pView ( pSdrView )
51 : {
52 0 : FreeResource();
53 :
54 0 : AddTabPage( RID_SVXPAGE_TEXTATTR, SvxTextAttrPage::Create, 0);
55 0 : AddTabPage( RID_SVXPAGE_TEXTANIMATION, SvxTextAnimationPage::Create, 0);
56 0 : }
57 :
58 : /*************************************************************************
59 : |*
60 : |* PageCreated()
61 : |*
62 : \************************************************************************/
63 :
64 0 : void SvxTextTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
65 : {
66 0 : switch( nId )
67 : {
68 : case RID_SVXPAGE_TEXTATTR:
69 : {
70 0 : ( (SvxTextAttrPage&) rPage ).SetView( pView );
71 0 : ( (SvxTextAttrPage&) rPage ).Construct();
72 : }
73 0 : break;
74 :
75 : case RID_SVXPAGE_TEXTANIMATION:
76 0 : break;
77 :
78 : default:
79 0 : break;
80 : }
81 0 : }
82 :
83 :
84 : /*************************************************************************
85 : |*
86 : |* Page
87 : |*
88 : \************************************************************************/
89 :
90 0 : SvxTextAnimationPage::SvxTextAnimationPage( Window* pWindow, const SfxItemSet& rInAttrs ) :
91 0 : SfxTabPage ( pWindow, CUI_RES( RID_SVXPAGE_TEXTANIMATION ),
92 : rInAttrs ),
93 0 : aFlEffect ( this, CUI_RES(FL_EFFECT)),
94 0 : aFtEffects ( this, CUI_RES(FT_EFFECTS)),
95 0 : aLbEffect ( this, CUI_RES( LB_EFFECT ) ),
96 : //aCtlEffect ( this, CUI_RES( CTL_EFFECT ) ),
97 0 : aFtDirection ( this, CUI_RES(FT_DIRECTION) ),
98 0 : aBtnUp ( this, CUI_RES( BTN_UP ) ),
99 0 : aBtnLeft ( this, CUI_RES( BTN_LEFT ) ),
100 0 : aBtnRight ( this, CUI_RES( BTN_RIGHT ) ),
101 0 : aBtnDown ( this, CUI_RES( BTN_DOWN ) ),
102 :
103 0 : aFlProperties ( this, CUI_RES(FL_PROPERTIES)),
104 0 : aTsbStartInside ( this, CUI_RES( TSB_START_INSIDE ) ),
105 0 : aTsbStopInside ( this, CUI_RES( TSB_STOP_INSIDE ) ),
106 :
107 0 : aFtCount ( this, CUI_RES(FT_COUNT)),
108 0 : aTsbEndless ( this, CUI_RES( TSB_ENDLESS ) ),
109 0 : aNumFldCount ( this, CUI_RES( NUM_FLD_COUNT ) ),
110 :
111 0 : aFtAmount ( this, CUI_RES(FT_AMOUNT)),
112 0 : aTsbPixel ( this, CUI_RES( TSB_PIXEL ) ),
113 0 : aMtrFldAmount ( this, CUI_RES( MTR_FLD_AMOUNT ) ),
114 :
115 0 : aFtDelay ( this, CUI_RES(FT_DELAY)),
116 0 : aTsbAuto ( this, CUI_RES( TSB_AUTO ) ),
117 0 : aMtrFldDelay ( this, CUI_RES( MTR_FLD_DELAY ) ),
118 :
119 : rOutAttrs ( rInAttrs ),
120 0 : eAniKind ( SDRTEXTANI_NONE )
121 : {
122 0 : FreeResource();
123 :
124 0 : eFUnit = GetModuleFieldUnit( rInAttrs );
125 0 : SfxItemPool* pPool = rOutAttrs.GetPool();
126 : DBG_ASSERT( pPool, "Wo ist der Pool" );
127 0 : eUnit = pPool->GetMetric( SDRATTR_TEXT_LEFTDIST );
128 :
129 0 : Construct();
130 :
131 : aLbEffect.SetSelectHdl(
132 0 : LINK( this, SvxTextAnimationPage, SelectEffectHdl_Impl ) );
133 : aTsbEndless.SetClickHdl(
134 0 : LINK( this, SvxTextAnimationPage, ClickEndlessHdl_Impl ) );
135 : aTsbAuto.SetClickHdl(
136 0 : LINK( this, SvxTextAnimationPage, ClickAutoHdl_Impl ) );
137 : aTsbPixel.SetClickHdl(
138 0 : LINK( this, SvxTextAnimationPage, ClickPixelHdl_Impl ) );
139 :
140 0 : Link aLink( LINK( this, SvxTextAnimationPage, ClickDirectionHdl_Impl ) );
141 0 : aBtnUp.SetClickHdl( aLink );
142 0 : aBtnLeft.SetClickHdl( aLink );
143 0 : aBtnRight.SetClickHdl( aLink );
144 0 : aBtnDown.SetClickHdl( aLink );
145 :
146 0 : aNumFldCount.SetAccessibleRelationLabeledBy( &aTsbEndless );
147 0 : aMtrFldAmount.SetAccessibleRelationLabeledBy( &aTsbPixel );
148 0 : aMtrFldDelay.SetAccessibleRelationLabeledBy( &aTsbAuto );
149 :
150 0 : aBtnUp.SetAccessibleRelationLabeledBy( &aFtDirection );
151 0 : aBtnLeft.SetAccessibleRelationLabeledBy( &aFtDirection );
152 0 : aBtnRight.SetAccessibleRelationLabeledBy( &aFtDirection );
153 0 : aBtnDown.SetAccessibleRelationLabeledBy( &aFtDirection );
154 :
155 0 : aBtnUp.SetAccessibleRelationMemberOf( &aFlEffect );
156 0 : aBtnLeft.SetAccessibleRelationMemberOf( &aFlEffect );
157 0 : aBtnRight.SetAccessibleRelationMemberOf( &aFlEffect );
158 0 : aBtnDown.SetAccessibleRelationMemberOf( &aFlEffect );
159 :
160 0 : aTsbEndless.SetAccessibleRelationLabeledBy( &aFtCount );
161 0 : aTsbPixel.SetAccessibleRelationLabeledBy( &aFtAmount );
162 0 : aTsbAuto.SetAccessibleRelationLabeledBy( &aFtDelay );
163 0 : }
164 :
165 : /*************************************************************************
166 : |*
167 : |* Dtor
168 : |*
169 : \************************************************************************/
170 :
171 0 : SvxTextAnimationPage::~SvxTextAnimationPage()
172 : {
173 0 : }
174 :
175 : /*************************************************************************
176 : |*
177 : |* reads the passed item set
178 : |*
179 : \************************************************************************/
180 :
181 0 : void SvxTextAnimationPage::Reset( const SfxItemSet& rAttrs )
182 : {
183 0 : const SfxItemPool* pPool = rAttrs.GetPool();
184 :
185 : // animation type
186 0 : const SfxPoolItem* pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIKIND );
187 :
188 0 : if( !pItem )
189 0 : pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIKIND );
190 0 : if( pItem )
191 : {
192 0 : eAniKind = ( ( const SdrTextAniKindItem* )pItem )->GetValue();
193 0 : aLbEffect.SelectEntryPos( sal::static_int_cast< sal_uInt16 >(eAniKind) );
194 : }
195 : else
196 0 : aLbEffect.SetNoSelection();
197 0 : aLbEffect.SaveValue();
198 :
199 : // animation direction
200 0 : pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIDIRECTION );
201 0 : if( !pItem )
202 0 : pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDIRECTION );
203 0 : if( pItem )
204 : {
205 0 : SdrTextAniDirection eValue = ( ( const SdrTextAniDirectionItem* )pItem )->GetValue();
206 0 : SelectDirection( eValue );
207 : }
208 : else
209 : {
210 0 : aBtnUp.Check( sal_False );
211 0 : aBtnLeft.Check( sal_False );
212 0 : aBtnRight.Check( sal_False );
213 0 : aBtnDown.Check( sal_False );
214 : }
215 0 : aBtnUp.SaveValue();
216 0 : aBtnLeft.SaveValue();
217 0 : aBtnRight.SaveValue();
218 0 : aBtnDown.SaveValue();
219 :
220 : // Start inside
221 0 : pItem = GetItem( rAttrs, SDRATTR_TEXT_ANISTARTINSIDE );
222 0 : if( !pItem )
223 0 : pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANISTARTINSIDE );
224 0 : if( pItem )
225 : {
226 0 : aTsbStartInside.EnableTriState( sal_False );
227 0 : sal_Bool bValue = ( ( const SdrTextAniStartInsideItem* )pItem )->GetValue();
228 0 : if( bValue )
229 0 : aTsbStartInside.SetState( STATE_CHECK );
230 : else
231 0 : aTsbStartInside.SetState( STATE_NOCHECK );
232 : }
233 : else
234 0 : aTsbStartInside.SetState( STATE_DONTKNOW );
235 0 : aTsbStartInside.SaveValue();
236 :
237 : // Stop inside
238 0 : pItem = GetItem( rAttrs, SDRATTR_TEXT_ANISTOPINSIDE );
239 0 : if( !pItem )
240 0 : pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANISTOPINSIDE );
241 0 : if( pItem )
242 : {
243 0 : aTsbStopInside.EnableTriState( sal_False );
244 0 : sal_Bool bValue = ( ( const SdrTextAniStopInsideItem* )pItem )->GetValue();
245 0 : if( bValue )
246 0 : aTsbStopInside.SetState( STATE_CHECK );
247 : else
248 0 : aTsbStopInside.SetState( STATE_NOCHECK );
249 : }
250 : else
251 0 : aTsbStopInside.SetState( STATE_DONTKNOW );
252 0 : aTsbStopInside.SaveValue();
253 :
254 : // quantity
255 0 : pItem = GetItem( rAttrs, SDRATTR_TEXT_ANICOUNT );
256 0 : if( !pItem )
257 0 : pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANICOUNT );
258 0 : if( pItem )
259 : {
260 0 : aTsbEndless.EnableTriState( sal_False );
261 0 : long nValue = (long) ( ( const SdrTextAniCountItem* )pItem )->GetValue();
262 0 : aNumFldCount.SetValue( nValue );
263 0 : if( nValue == 0 )
264 : {
265 0 : if( eAniKind == SDRTEXTANI_SLIDE )
266 : {
267 0 : aTsbEndless.SetState( STATE_NOCHECK );
268 0 : aTsbEndless.Enable( sal_False );
269 : }
270 : else
271 : {
272 0 : aTsbEndless.SetState( STATE_CHECK );
273 0 : aNumFldCount.SetEmptyFieldValue();
274 : }
275 : }
276 : else
277 0 : aTsbEndless.SetState( STATE_NOCHECK );
278 : }
279 : else
280 : {
281 0 : aNumFldCount.SetEmptyFieldValue();
282 0 : aTsbEndless.SetState( STATE_DONTKNOW );
283 : }
284 0 : aTsbEndless.SaveValue();
285 0 : aNumFldCount.SaveValue();
286 :
287 : // delay
288 0 : pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIDELAY );
289 0 : if( !pItem )
290 0 : pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIDELAY );
291 0 : if( pItem )
292 : {
293 0 : aTsbAuto.EnableTriState( sal_False );
294 0 : long nValue = (long) ( ( const SdrTextAniDelayItem* )pItem )->GetValue();
295 0 : aMtrFldDelay.SetValue( nValue );
296 0 : if( nValue == 0 )
297 : {
298 0 : aTsbAuto.SetState( STATE_CHECK );
299 0 : aMtrFldDelay.SetEmptyFieldValue();
300 : }
301 : else
302 0 : aTsbAuto.SetState( STATE_NOCHECK );
303 : }
304 : else
305 : {
306 0 : aMtrFldDelay.SetEmptyFieldValue();
307 0 : aTsbAuto.SetState( STATE_DONTKNOW );
308 : }
309 0 : aTsbAuto.SaveValue();
310 0 : aMtrFldDelay.SaveValue();
311 :
312 : // step size
313 0 : pItem = GetItem( rAttrs, SDRATTR_TEXT_ANIAMOUNT );
314 0 : if( !pItem )
315 0 : pItem = &pPool->GetDefaultItem( SDRATTR_TEXT_ANIAMOUNT );
316 0 : if( pItem )
317 : {
318 0 : aTsbPixel.EnableTriState( sal_False );
319 0 : long nValue = (long) ( ( const SdrTextAniAmountItem* )pItem )->GetValue();
320 0 : if( nValue <= 0 )
321 : {
322 0 : aTsbPixel.SetState( STATE_CHECK );
323 0 : nValue = -nValue;
324 0 : if( nValue == 0 )
325 0 : nValue++;
326 0 : aMtrFldAmount.SetUnit( FUNIT_CUSTOM );
327 0 : aMtrFldAmount.SetDecimalDigits( 0 );
328 :
329 0 : aMtrFldAmount.SetSpinSize( 1 );
330 0 : aMtrFldAmount.SetMin( 1 );
331 0 : aMtrFldAmount.SetFirst( 1 );
332 0 : aMtrFldAmount.SetMax( 100 );
333 0 : aMtrFldAmount.SetLast( 100 );
334 :
335 0 : aMtrFldAmount.SetValue( nValue );
336 : }
337 : else
338 : {
339 0 : aTsbPixel.SetState( STATE_NOCHECK );
340 0 : aMtrFldAmount.SetUnit( eFUnit );
341 0 : aMtrFldAmount.SetDecimalDigits( 2 );
342 :
343 0 : aMtrFldAmount.SetSpinSize( 10 );
344 0 : aMtrFldAmount.SetMin( 1 );
345 0 : aMtrFldAmount.SetFirst( 1 );
346 0 : aMtrFldAmount.SetMax( 10000 );
347 0 : aMtrFldAmount.SetLast( 10000 );
348 :
349 0 : SetMetricValue( aMtrFldAmount, nValue, eUnit );
350 : }
351 : }
352 : else
353 : {
354 0 : aMtrFldAmount.Disable();
355 0 : aMtrFldAmount.SetEmptyFieldValue();
356 0 : aTsbPixel.SetState( STATE_DONTKNOW );
357 : }
358 0 : aTsbPixel.SaveValue();
359 0 : aMtrFldAmount.SaveValue();
360 :
361 :
362 0 : SelectEffectHdl_Impl( NULL );
363 0 : ClickEndlessHdl_Impl( NULL );
364 0 : ClickAutoHdl_Impl( NULL );
365 : //ClickPixelHdl_Impl( NULL );
366 0 : }
367 :
368 : /*************************************************************************
369 : |*
370 : |* fills the passed item set with dialog box attributes
371 : |*
372 : \************************************************************************/
373 :
374 0 : sal_Bool SvxTextAnimationPage::FillItemSet( SfxItemSet& rAttrs)
375 : {
376 0 : sal_Bool bModified = sal_False;
377 : sal_uInt16 nPos;
378 : TriState eState;
379 :
380 : // animation type
381 0 : nPos = aLbEffect.GetSelectEntryPos();
382 0 : if( nPos != LISTBOX_ENTRY_NOTFOUND &&
383 0 : nPos != aLbEffect.GetSavedValue() )
384 : {
385 0 : rAttrs.Put( SdrTextAniKindItem( (SdrTextAniKind) nPos ) );
386 0 : bModified = sal_True;
387 : }
388 :
389 : // animation direction
390 0 : if( aBtnUp.GetSavedValue() != aBtnUp.IsChecked() ||
391 0 : aBtnLeft.GetSavedValue() != aBtnLeft.IsChecked() ||
392 0 : aBtnRight.GetSavedValue() != aBtnRight.IsChecked() ||
393 0 : aBtnDown.GetSavedValue() != aBtnDown.IsChecked() )
394 : {
395 0 : SdrTextAniDirection eValue = (SdrTextAniDirection) GetSelectedDirection();
396 0 : rAttrs.Put( SdrTextAniDirectionItem( eValue ) );
397 0 : bModified = sal_True;
398 : }
399 :
400 : // Start inside
401 0 : eState = aTsbStartInside.GetState();
402 0 : if( eState != aTsbStartInside.GetSavedValue() )
403 : {
404 0 : rAttrs.Put( SdrTextAniStartInsideItem( (sal_Bool) STATE_CHECK == eState ) );
405 0 : bModified = sal_True;
406 : }
407 :
408 : // Stop inside
409 0 : eState = aTsbStopInside.GetState();
410 0 : if( eState != aTsbStopInside.GetSavedValue() )
411 : {
412 0 : rAttrs.Put( SdrTextAniStopInsideItem( (sal_Bool) STATE_CHECK == eState ) );
413 0 : bModified = sal_True;
414 : }
415 :
416 : // quantity
417 0 : eState = aTsbEndless.GetState();
418 0 : String aStr = aNumFldCount.GetText();
419 0 : if( eState != aTsbEndless.GetSavedValue() ||
420 0 : aStr != aNumFldCount.GetSavedValue() )
421 : {
422 0 : sal_Int64 nValue = 0;
423 0 : if( eState == STATE_CHECK /*#89844#*/ && aTsbEndless.IsEnabled())
424 0 : bModified = sal_True;
425 : else
426 : {
427 0 : if( aStr != aNumFldCount.GetSavedValue() )
428 : {
429 0 : nValue = aNumFldCount.GetValue();
430 0 : bModified = sal_True;
431 : }
432 : }
433 0 : if( bModified )
434 0 : rAttrs.Put( SdrTextAniCountItem( (sal_uInt16) nValue ) );
435 : }
436 :
437 : // delay
438 0 : eState = aTsbAuto.GetState();
439 0 : aStr = aMtrFldDelay.GetText();
440 0 : if( eState != aTsbAuto.GetSavedValue() ||
441 0 : aStr != aMtrFldDelay.GetSavedValue() )
442 : {
443 0 : sal_Int64 nValue = 0;
444 0 : if( eState == STATE_CHECK )
445 0 : bModified = sal_True;
446 : else
447 : {
448 0 : if( aStr != aMtrFldDelay.GetSavedValue() )
449 : {
450 0 : nValue = aMtrFldDelay.GetValue();
451 0 : bModified = sal_True;
452 : }
453 : }
454 0 : if( bModified )
455 0 : rAttrs.Put( SdrTextAniDelayItem( (sal_uInt16) nValue ) );
456 : }
457 :
458 : // step size
459 0 : eState = aTsbPixel.GetState();
460 0 : aStr = aMtrFldAmount.GetText();
461 0 : if( eState != aTsbPixel.GetSavedValue() ||
462 0 : aStr != aMtrFldAmount.GetSavedValue() )
463 : {
464 0 : sal_Int64 nValue = 0;
465 0 : if( eState == STATE_CHECK )
466 : {
467 0 : nValue = aMtrFldAmount.GetValue();
468 0 : nValue = -nValue;
469 : }
470 : else
471 : {
472 0 : nValue = GetCoreValue( aMtrFldAmount, eUnit );
473 : }
474 0 : rAttrs.Put( SdrTextAniAmountItem( (sal_Int16) nValue ) );
475 :
476 0 : bModified = sal_True;
477 : }
478 :
479 0 : return( bModified );
480 : }
481 :
482 0 : void SvxTextAnimationPage::Construct()
483 : {
484 0 : }
485 :
486 0 : sal_uInt16* SvxTextAnimationPage::GetRanges()
487 : {
488 0 : return( pRanges );
489 : }
490 :
491 : /*************************************************************************
492 : |*
493 : |* creates the page
494 : |*
495 : \************************************************************************/
496 :
497 0 : SfxTabPage* SvxTextAnimationPage::Create( Window* pWindow,
498 : const SfxItemSet& rAttrs )
499 : {
500 0 : return( new SvxTextAnimationPage( pWindow, rAttrs ) );
501 : }
502 :
503 0 : IMPL_LINK_NOARG(SvxTextAnimationPage, SelectEffectHdl_Impl)
504 : {
505 0 : sal_uInt16 nPos = aLbEffect.GetSelectEntryPos();
506 0 : if( nPos != LISTBOX_ENTRY_NOTFOUND )
507 : {
508 0 : eAniKind = (SdrTextAniKind) nPos;
509 0 : switch( eAniKind )
510 : {
511 : case SDRTEXTANI_NONE:
512 : {
513 0 : aFtDirection.Disable();
514 0 : aBtnUp.Disable();
515 0 : aBtnLeft.Disable();
516 0 : aBtnRight.Disable();
517 0 : aBtnDown.Disable();
518 0 : aTsbStartInside.Disable();
519 0 : aTsbStopInside.Disable();
520 :
521 0 : aTsbEndless.Disable();
522 0 : aNumFldCount.Disable();
523 0 : aFtCount.Disable();
524 :
525 0 : aTsbAuto.Disable();
526 0 : aMtrFldDelay.Disable();
527 0 : aFtDelay.Disable();
528 :
529 0 : aTsbPixel.Disable();
530 0 : aMtrFldAmount.Disable();
531 0 : aFtAmount.Disable();
532 : }
533 0 : break;
534 :
535 : case SDRTEXTANI_BLINK:
536 : case SDRTEXTANI_SCROLL:
537 : case SDRTEXTANI_ALTERNATE:
538 : case SDRTEXTANI_SLIDE:
539 : {
540 0 : if( eAniKind == SDRTEXTANI_SLIDE )
541 : {
542 0 : aTsbStartInside.Disable();
543 0 : aTsbStopInside.Disable();
544 :
545 0 : aTsbEndless.Disable();
546 0 : aNumFldCount.Enable();
547 0 : aNumFldCount.SetValue( aNumFldCount.GetValue() );
548 : }
549 : else
550 : {
551 0 : aTsbStartInside.Enable();
552 0 : aTsbStopInside.Enable();
553 :
554 0 : aTsbEndless.Enable();
555 0 : ClickEndlessHdl_Impl( NULL );
556 : }
557 0 : aFtCount.Enable();
558 :
559 0 : aTsbAuto.Enable();
560 0 : aFtDelay.Enable();
561 0 : ClickAutoHdl_Impl( NULL );
562 :
563 0 : if( eAniKind == SDRTEXTANI_BLINK )
564 : {
565 0 : aFtDirection.Disable();
566 0 : aBtnUp.Disable();
567 0 : aBtnLeft.Disable();
568 0 : aBtnRight.Disable();
569 0 : aBtnDown.Disable();
570 :
571 0 : aTsbPixel.Disable();
572 0 : aMtrFldAmount.Disable();
573 0 : aFtAmount.Disable();
574 : }
575 : else
576 : {
577 0 : aFtDirection.Enable();
578 0 : aBtnUp.Enable();
579 0 : aBtnLeft.Enable();
580 0 : aBtnRight.Enable();
581 0 : aBtnDown.Enable();
582 :
583 0 : aTsbPixel.Enable();
584 0 : aMtrFldAmount.Enable();
585 0 : aFtAmount.Enable();
586 : }
587 : }
588 0 : break;
589 : }
590 :
591 : }
592 0 : return( 0L );
593 : }
594 :
595 0 : IMPL_LINK_NOARG(SvxTextAnimationPage, ClickEndlessHdl_Impl)
596 : {
597 :
598 0 : if( eAniKind != SDRTEXTANI_SLIDE )
599 : {
600 0 : TriState eState = aTsbEndless.GetState();
601 0 : if( eState != STATE_NOCHECK )
602 : {
603 0 : aNumFldCount.Disable();
604 0 : aNumFldCount.SetEmptyFieldValue();
605 : }
606 : else
607 : {
608 0 : aNumFldCount.Enable();
609 0 : aNumFldCount.SetValue( aNumFldCount.GetValue() );
610 : }
611 : }
612 0 : return( 0L );
613 : }
614 :
615 0 : IMPL_LINK_NOARG(SvxTextAnimationPage, ClickAutoHdl_Impl)
616 : {
617 0 : TriState eState = aTsbAuto.GetState();
618 0 : if( eState != STATE_NOCHECK )
619 : {
620 0 : aMtrFldDelay.Disable();
621 0 : aMtrFldDelay.SetEmptyFieldValue();
622 : }
623 : else
624 : {
625 0 : aMtrFldDelay.Enable();
626 0 : aMtrFldDelay.SetValue( aMtrFldDelay.GetValue() );
627 : }
628 :
629 0 : return( 0L );
630 : }
631 :
632 0 : IMPL_LINK_NOARG(SvxTextAnimationPage, ClickPixelHdl_Impl)
633 : {
634 0 : TriState eState = aTsbPixel.GetState();
635 0 : if( eState == STATE_CHECK )
636 : {
637 0 : sal_Int64 nValue = aMtrFldAmount.GetValue() / 10;
638 0 : aMtrFldAmount.Enable();
639 0 : aMtrFldAmount.SetUnit( FUNIT_CUSTOM );
640 : //SetFieldUnit( aMtrFldAmount, FUNIT_CUSTOM );
641 0 : aMtrFldAmount.SetDecimalDigits( 0 );
642 :
643 0 : aMtrFldAmount.SetSpinSize( 1 );
644 0 : aMtrFldAmount.SetMin( 1 );
645 0 : aMtrFldAmount.SetFirst( 1 );
646 0 : aMtrFldAmount.SetMax( 100 );
647 0 : aMtrFldAmount.SetLast( 100 );
648 :
649 0 : aMtrFldAmount.SetValue( nValue );
650 : }
651 0 : else if( eState == STATE_NOCHECK )
652 : {
653 0 : sal_Int64 nValue = aMtrFldAmount.GetValue() * 10;
654 0 : aMtrFldAmount.Enable();
655 0 : aMtrFldAmount.SetUnit( eFUnit );
656 : //SetFieldUnit( aMtrFldAmount, eFUnit );
657 0 : aMtrFldAmount.SetDecimalDigits( 2 );
658 :
659 0 : aMtrFldAmount.SetSpinSize( 10 );
660 0 : aMtrFldAmount.SetMin( 1 );
661 0 : aMtrFldAmount.SetFirst( 1 );
662 0 : aMtrFldAmount.SetMax( 10000 );
663 0 : aMtrFldAmount.SetLast( 10000 );
664 :
665 0 : aMtrFldAmount.SetValue( nValue );
666 : }
667 :
668 0 : return( 0L );
669 : }
670 :
671 0 : IMPL_LINK( SvxTextAnimationPage, ClickDirectionHdl_Impl, ImageButton *, pBtn )
672 : {
673 0 : aBtnUp.Check( pBtn == &aBtnUp );
674 0 : aBtnLeft.Check( pBtn == &aBtnLeft );
675 0 : aBtnRight.Check( pBtn == &aBtnRight );
676 0 : aBtnDown.Check( pBtn == &aBtnDown );
677 :
678 0 : return( 0L );
679 : }
680 :
681 0 : void SvxTextAnimationPage::SelectDirection( SdrTextAniDirection nValue )
682 : {
683 0 : aBtnUp.Check( nValue == SDRTEXTANI_UP );
684 0 : aBtnLeft.Check( nValue == SDRTEXTANI_LEFT );
685 0 : aBtnRight.Check( nValue == SDRTEXTANI_RIGHT );
686 0 : aBtnDown.Check( nValue == SDRTEXTANI_DOWN );
687 0 : }
688 :
689 0 : sal_uInt16 SvxTextAnimationPage::GetSelectedDirection()
690 : {
691 0 : sal_uInt16 nValue = 0;
692 :
693 0 : if( aBtnUp.IsChecked() )
694 0 : nValue = SDRTEXTANI_UP;
695 0 : else if( aBtnLeft.IsChecked() )
696 0 : nValue = SDRTEXTANI_LEFT;
697 0 : else if( aBtnRight.IsChecked() )
698 0 : nValue = SDRTEXTANI_RIGHT;
699 0 : else if( aBtnDown.IsChecked() )
700 0 : nValue = SDRTEXTANI_DOWN;
701 :
702 0 : return( nValue );
703 0 : }
704 :
705 :
706 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|