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