1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: animobjs.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
33 #include <com/sun/star/presentation/AnimationEffect.hpp>
34 #include <com/sun/star/presentation/AnimationSpeed.hpp>
36 #define _ANIMATION //animation freischalten
39 #include <svx/xoutbmp.hxx>
42 #include <svtools/eitem.hxx>
43 #include <svx/svdograf.hxx>
44 #include <svx/svdogrp.hxx>
45 #include <sfx2/dispatch.hxx>
46 #include <sfx2/progress.hxx>
47 #include <vcl/msgbox.hxx>
48 #include "anminfo.hxx"
49 #include "animobjs.hxx"
50 #include "animobjs.hrc"
53 #include "strings.hrc"
54 #include "sdresid.hxx"
56 #include "drawdoc.hxx"
58 #include "res_bmp.hrc"
59 #include "ViewShell.hxx"
61 #ifndef _SV_SVAPP_HXX_
62 #include <vcl/svapp.hxx>
68 using namespace ::com::sun::star
;
72 /*************************************************************************
73 |* SdDisplay - Control
74 \************************************************************************/
76 SdDisplay::SdDisplay( Window
* pWin
, SdResId Id
) :
80 SetMapMode( MAP_PIXEL
);
81 const StyleSettings
& rStyles
= Application::GetSettings().GetStyleSettings();
82 SetBackground( Wallpaper( Color( rStyles
.GetFieldColor() ) ) );
85 // -----------------------------------------------------------------------
87 SdDisplay::~SdDisplay()
91 // -----------------------------------------------------------------------
93 void SdDisplay::SetBitmapEx( BitmapEx
* pBmpEx
)
101 const StyleSettings
& rStyles
= Application::GetSettings().GetStyleSettings();
102 const Color aFillColor
= rStyles
.GetFieldColor();
103 aBitmapEx
.Erase(aFillColor
);
107 // -----------------------------------------------------------------------
109 void SdDisplay::Paint( const Rectangle
& )
112 Size aSize
= GetOutputSize();
113 Size aBmpSize
= aBitmapEx
.GetBitmap().GetSizePixel();
114 aBmpSize
.Width() = (long) ( (double) aBmpSize
.Width() * (double) aScale
);
115 aBmpSize
.Height() = (long) ( (double) aBmpSize
.Height() * (double) aScale
);
117 if( aBmpSize
.Width() < aSize
.Width() )
118 aPt
.X() = ( aSize
.Width() - aBmpSize
.Width() ) / 2;
119 if( aBmpSize
.Height() < aSize
.Height() )
120 aPt
.Y() = ( aSize
.Height() - aBmpSize
.Height() ) / 2;
122 aBitmapEx
.Draw( this, aPt
, aBmpSize
);
123 //DrawBitmap( aPt, aBmpSize, *pBitmap );
126 // -----------------------------------------------------------------------
128 void SdDisplay::SetScale( const Fraction
& rFrac
)
133 void SdDisplay::DataChanged( const DataChangedEvent
& rDCEvt
)
135 Control::DataChanged( rDCEvt
);
137 if ( (rDCEvt
.GetType() == DATACHANGED_SETTINGS
) && (rDCEvt
.GetFlags() & SETTINGS_STYLE
) )
139 const StyleSettings
& rStyles
= Application::GetSettings().GetStyleSettings();
140 SetBackground( Wallpaper( Color( rStyles
.GetFieldColor() ) ) );
141 SetDrawMode( GetDisplayBackground().GetColor().IsDark()
142 ? ViewShell::OUTPUT_DRAWMODE_CONTRAST
143 : ViewShell::OUTPUT_DRAWMODE_COLOR
);
147 /*************************************************************************
148 |* AnimationWindow - FloatingWindow
149 \************************************************************************/
151 AnimationWindow::AnimationWindow( SfxBindings
* pInBindings
,
152 SfxChildWindow
*pCW
, Window
* pParent
, const SdResId
& rSdResId
) :
153 SfxDockingWindow ( pInBindings
, pCW
, pParent
, rSdResId
),
154 aCtlDisplay ( this, SdResId( CTL_DISPLAY
) ),
155 aBtnFirst ( this, SdResId( BTN_FIRST
) ),
156 aBtnReverse ( this, SdResId( BTN_REVERSE
) ),
157 aBtnStop ( this, SdResId( BTN_STOP
) ),
158 aBtnPlay ( this, SdResId( BTN_PLAY
) ),
159 aBtnLast ( this, SdResId( BTN_LAST
) ),
160 aNumFldBitmap ( this, SdResId( NUM_FLD_BITMAP
) ),
161 aTimeField ( this, SdResId( TIME_FIELD
) ),
162 aLbLoopCount ( this, SdResId( LB_LOOP_COUNT
) ),
164 aBtnGetOneObject ( this, SdResId( BTN_GET_ONE_OBJECT
) ),
165 aBtnGetAllObjects ( this, SdResId( BTN_GET_ALL_OBJECTS
) ),
166 aBtnRemoveBitmap ( this, SdResId( BTN_REMOVE_BITMAP
) ),
167 aBtnRemoveAll ( this, SdResId( BTN_REMOVE_ALL
) ),
168 aFtCount ( this, SdResId( FT_COUNT
) ),
169 aFiCount ( this, SdResId( FI_COUNT
) ),
170 aGrpBitmap ( this, SdResId( GRP_BITMAP
) ),
172 aRbtGroup ( this, SdResId( RBT_GROUP
) ),
173 aRbtBitmap ( this, SdResId( RBT_BITMAP
) ),
174 aFtAdjustment ( this, SdResId( FT_ADJUSTMENT
) ),
175 aLbAdjustment ( this, SdResId( LB_ADJUSTMENT
) ),
176 aBtnCreateGroup ( this, SdResId( BTN_CREATE_GROUP
) ),
177 aGrpAnimation ( this, SdResId( GRP_ANIMATION_GROUP
) ),
183 bAllObjects ( FALSE
),
185 pBindings ( pInBindings
)
189 aBtnGetOneObject
.SetModeImage( Image( SdResId( IMG_GET1OBJECT_H
) ), BMP_COLOR_HIGHCONTRAST
);
190 aBtnGetAllObjects
.SetModeImage( Image( SdResId( IMG_GETALLOBJECT_H
) ), BMP_COLOR_HIGHCONTRAST
);
191 aBtnRemoveBitmap
.SetModeImage( Image( SdResId( IMG_REMOVEBMP_H
) ), BMP_COLOR_HIGHCONTRAST
);
192 aBtnRemoveAll
.SetModeImage( Image( SdResId( IMG_REMOVEALLBMP_H
) ), BMP_COLOR_HIGHCONTRAST
);
194 // neues Dokument mit Seite erzeugen
195 pMyDoc
= new SdDrawDocument(DOCUMENT_TYPE_IMPRESS
, NULL
);
196 SdPage
* pPage
= (SdPage
*) pMyDoc
->AllocPage(FALSE
);
197 pMyDoc
->InsertPage(pPage
);
199 pControllerItem
= new AnimationControllerItem( SID_ANIMATOR_STATE
, this, pBindings
);
201 // Solange noch nicht in der Resource
202 aTimeField
.SetFormat( TIMEF_SEC_CS
);
204 aBtnFirst
.SetClickHdl( LINK( this, AnimationWindow
, ClickFirstHdl
) );
205 aBtnReverse
.SetClickHdl( LINK( this, AnimationWindow
, ClickPlayHdl
) );
206 aBtnStop
.SetClickHdl( LINK( this, AnimationWindow
, ClickStopHdl
) );
207 aBtnPlay
.SetClickHdl( LINK( this, AnimationWindow
, ClickPlayHdl
) );
208 aBtnLast
.SetClickHdl( LINK( this, AnimationWindow
, ClickLastHdl
) );
210 aBtnGetOneObject
.SetClickHdl( LINK( this, AnimationWindow
, ClickGetObjectHdl
) );
211 aBtnGetAllObjects
.SetClickHdl( LINK( this, AnimationWindow
, ClickGetObjectHdl
) );
212 aBtnRemoveBitmap
.SetClickHdl( LINK( this, AnimationWindow
, ClickRemoveBitmapHdl
) );
213 aBtnRemoveAll
.SetClickHdl( LINK( this, AnimationWindow
, ClickRemoveBitmapHdl
) );
215 aRbtGroup
.SetClickHdl( LINK( this, AnimationWindow
, ClickRbtHdl
) );
216 aRbtBitmap
.SetClickHdl( LINK( this, AnimationWindow
, ClickRbtHdl
) );
217 aBtnCreateGroup
.SetClickHdl( LINK( this, AnimationWindow
, ClickCreateGroupHdl
) );
218 aNumFldBitmap
.SetModifyHdl( LINK( this, AnimationWindow
, ModifyBitmapHdl
) );
219 aTimeField
.SetModifyHdl( LINK( this, AnimationWindow
, ModifyTimeHdl
) );
222 aCtlDisplay
.SetBorderStyle(WINDOW_BORDER_MONO
);
223 aDisplaySize
= aCtlDisplay
.GetOutputSize();
225 aSize
= GetOutputSizePixel();
226 SetMinOutputSizePixel( aSize
);
230 // der Animator ist leer; es kann keine Animationsgruppe erstellt werden
231 aBtnCreateGroup
.Disable();
234 // -----------------------------------------------------------------------
236 AnimationWindow::~AnimationWindow()
240 delete pControllerItem
;
242 // Bitmapliste bereinigen
243 for( i
= 0, nCount
= aBmpExList
.Count(); i
< nCount
; i
++ )
244 delete static_cast< BitmapEx
* >( aBmpExList
.GetObject( i
) );
247 // Timeliste bereinigen
248 for( i
= 0, nCount
= aTimeList
.Count(); i
< nCount
; i
++ )
249 delete static_cast< Time
* >( aTimeList
.GetObject( i
) );
252 // die Clones loeschen
256 // -----------------------------------------------------------------------
258 IMPL_LINK( AnimationWindow
, ClickFirstHdl
, void *, EMPTYARG
)
261 pBitmapEx
= static_cast< BitmapEx
* >( aBmpExList
.GetCurObject() );
262 UpdateControl( aBmpExList
.GetCurPos() );
267 // -----------------------------------------------------------------------
269 IMPL_LINK( AnimationWindow
, ClickStopHdl
, void *, EMPTYARG
)
275 // -----------------------------------------------------------------------
277 IMPL_LINK( AnimationWindow
, ClickPlayHdl
, void *, p
)
279 ScopeLockGuard
aGuard( maPlayLock
);
282 BOOL bDisableCtrls
= FALSE
;
283 ULONG nCount
= aBmpExList
.Count();
284 BOOL bReverse
= p
== &aBtnReverse
;
286 // Kann spaeter schwer ermittelt werden
287 BOOL bRbtGroupEnabled
= aRbtGroup
.IsEnabled();
288 BOOL bBtnGetAllObjectsEnabled
= aBtnGetAllObjects
.IsEnabled();
289 BOOL bBtnGetOneObjectEnabled
= aBtnGetOneObject
.IsEnabled();
291 // Gesamtzeit ermitteln
294 if( aRbtBitmap
.IsChecked() )
296 for( ULONG i
= 0; i
< nCount
; i
++ )
297 aTime
+= *static_cast< Time
* >( aTimeList
.GetObject( i
) );
298 nFullTime
= aTime
.GetMSFromTime();
302 nFullTime
= nCount
* 100;
303 aTime
.MakeTimeFromMS( nFullTime
);
306 // StatusBarManager ab 1 Sekunde
307 SfxProgress
* pProgress
= NULL
;
308 if( nFullTime
>= 1000 )
310 bDisableCtrls
= TRUE
;
313 String
aStr( RTL_CONSTASCII_USTRINGPARAM( "Animator:" ) ); // Hier sollte man sich noch etwas gescheites ausdenken!
314 pProgress
= new SfxProgress( NULL
, aStr
, nFullTime
);
319 BOOL bCount
= i
< (long) nCount
;
325 while( bCount
&& bMovie
)
327 // Um Konsistenz zwischen Liste und Anzeige zu erwirken
328 aBmpExList
.Seek( i
);
329 pBitmapEx
= static_cast< BitmapEx
* >( aBmpExList
.GetCurObject() );
331 UpdateControl( i
, bDisableCtrls
);
333 if( aRbtBitmap
.IsChecked() )
335 Time
* pTime
= static_cast< Time
* >( aTimeList
.GetObject( i
) );
336 DBG_ASSERT( pTime
, "Keine Zeit gefunden!" );
338 aTimeField
.SetTime( *pTime
);
339 ULONG nTime
= pTime
->GetMSFromTime();
341 WaitInEffect( nTime
, nTmpTime
, pProgress
);
346 WaitInEffect( 100, nTmpTime
, pProgress
);
356 // Move i back into valid range.
363 if (i
>= (long) nCount
)
367 // Move i back into valid range.
373 // Um die Controls wieder zu enablen
384 aRbtGroup
.Enable( bRbtGroupEnabled
);
385 aBtnGetAllObjects
.Enable( bBtnGetAllObjectsEnabled
);
386 aBtnGetOneObject
.Enable( bBtnGetOneObjectEnabled
);
391 // -----------------------------------------------------------------------
393 IMPL_LINK( AnimationWindow
, ClickLastHdl
, void *, EMPTYARG
)
396 pBitmapEx
= static_cast< BitmapEx
* >( aBmpExList
.GetCurObject() );
397 UpdateControl( aBmpExList
.GetCurPos() );
402 // -----------------------------------------------------------------------
404 IMPL_LINK( AnimationWindow
, ClickRbtHdl
, void *, p
)
406 if( !pBitmapEx
|| p
== &aRbtGroup
|| aRbtGroup
.IsChecked() )
408 aTimeField
.SetText( String() );
409 aTimeField
.Enable( FALSE
);
410 aLbLoopCount
.Enable( FALSE
);
412 else if( p
== &aRbtBitmap
|| aRbtBitmap
.IsChecked() )
414 ULONG n
= static_cast<ULONG
>(aNumFldBitmap
.GetValue());
417 Time
* pTime
= static_cast< Time
* >( aTimeList
.GetObject( n
- 1 ) );
419 aTimeField
.SetTime( *pTime
);
422 aLbLoopCount
.Enable();
428 // -----------------------------------------------------------------------
430 IMPL_LINK( AnimationWindow
, ClickGetObjectHdl
, void *, pBtn
)
432 bAllObjects
= pBtn
== &aBtnGetAllObjects
;
434 // Code jetzt in AddObj()
435 SfxBoolItem
aItem( SID_ANIMATOR_ADD
, TRUE
);
437 GetBindings().GetDispatcher()->Execute(
438 SID_ANIMATOR_ADD
, SFX_CALLMODE_SLOT
| SFX_CALLMODE_RECORD
, &aItem
, 0L );
442 // -----------------------------------------------------------------------
444 IMPL_LINK( AnimationWindow
, ClickRemoveBitmapHdl
, void *, pBtn
)
446 SdPage
* pPage
= pMyDoc
->GetSdPage(0, PK_STANDARD
);
449 if( pBtn
== &aBtnRemoveBitmap
)
451 ULONG nPos
= aBmpExList
.GetCurPos();
452 pBitmapEx
= static_cast< BitmapEx
* >( aBmpExList
.GetCurObject() );
457 pBitmapEx
= static_cast< BitmapEx
* >( aBmpExList
.GetCurObject() );
459 Time
* pTime
= static_cast< Time
* >( aTimeList
.GetObject( nPos
) );
463 aTimeList
.Remove( nPos
);
466 pObject
= pPage
->GetObj( nPos
);
467 // Durch Uebernahme der AnimatedGIFs muessen nicht unbedingt
468 // Objekte vorhanden sein.
471 pObject
= pPage
->RemoveObject(nPos
);
472 DBG_ASSERT(pObject
, "Clone beim Loeschen nicht gefunden");
473 SdrObject::Free( pObject
);
474 pPage
->RecalcObjOrdNums();
478 else // Alles loeschen
480 WarningBox
aWarnBox( this, WB_YES_NO
, String( SdResId( STR_ASK_DELETE_ALL_PICTURES
) ) );
481 short nReturn
= aWarnBox
.Execute();
483 if( nReturn
== RET_YES
)
485 // Bitmapliste bereinigen
486 long nCount
= aBmpExList
.Count();
489 for( i
= nCount
- 1; i
>= 0; i
-- )
491 pBitmapEx
= static_cast< BitmapEx
* >( aBmpExList
.GetObject( i
) );
494 pObject
= pPage
->GetObj( i
);
497 pObject
= pPage
->RemoveObject( i
);
498 DBG_ASSERT(pObject
, "Clone beim Loeschen nicht gefunden");
499 SdrObject::Free( pObject
);
500 //pPage->RecalcObjOrdNums();
506 // Timeliste bereinigen
507 nCount
= aTimeList
.Count();
508 for( i
= 0; i
< nCount
; i
++ )
510 delete static_cast< Time
* >( aTimeList
.GetObject( i
) );
516 // kann noch eine Animationsgruppe erstellt werden?
517 if (aBmpExList
.Count() == 0)
519 aBtnCreateGroup
.Disable();
520 // Falls vorher durch Uebernahme von AnimatedGIFs disabled:
521 //aRbtBitmap.Enable();
525 // Zoom fuer DisplayWin berechnen und setzen
526 Fraction
aFrac( GetScale() );
527 aCtlDisplay
.SetScale( aFrac
);
529 UpdateControl( aBmpExList
.GetCurPos() );
534 // -----------------------------------------------------------------------
536 IMPL_LINK( AnimationWindow
, ClickCreateGroupHdl
, void *, EMPTYARG
)
538 // Code jetzt in CreatePresObj()
539 SfxBoolItem
aItem( SID_ANIMATOR_CREATE
, TRUE
);
541 GetBindings().GetDispatcher()->Execute(
542 SID_ANIMATOR_CREATE
, SFX_CALLMODE_SLOT
| SFX_CALLMODE_RECORD
, &aItem
, 0L );
546 // -----------------------------------------------------------------------
548 IMPL_LINK( AnimationWindow
, ModifyBitmapHdl
, void *, EMPTYARG
)
550 ULONG nBmp
= static_cast<ULONG
>(aNumFldBitmap
.GetValue());
552 if( nBmp
> aBmpExList
.Count() )
553 nBmp
= aBmpExList
.Count();
555 pBitmapEx
= static_cast< BitmapEx
* >( aBmpExList
.GetObject( nBmp
- 1 ) );
557 // Positionieren in der Liste
558 aBmpExList
.Seek( nBmp
- 1 );
560 UpdateControl( nBmp
- 1 );
565 // -----------------------------------------------------------------------
567 IMPL_LINK( AnimationWindow
, ModifyTimeHdl
, void *, EMPTYARG
)
569 ULONG nPos
= static_cast<ULONG
>(aNumFldBitmap
.GetValue() - 1);
571 Time
* pTime
= static_cast< Time
* >( aTimeList
.GetObject( nPos
) );
572 DBG_ASSERT( pTime
, "Zeit nicht gefunden!" );
574 *pTime
= aTimeField
.GetTime();
579 // -----------------------------------------------------------------------
581 void AnimationWindow::UpdateControl( ULONG nListPos
, BOOL bDisableCtrls
)
587 BitmapEx
aBmp( *pBitmapEx
);
589 SdPage
* pPage
= pMyDoc
->GetSdPage(0, PK_STANDARD
);
590 SdrObject
* pObject
= (SdrObject
*) pPage
->GetObj( (ULONG
) nListPos
);
594 Rectangle
aObjRect( pObject
->GetCurrentBoundRect() );
595 Size
aObjSize( aObjRect
.GetSize() );
596 Point
aOrigin( Point( -aObjRect
.Left(), -aObjRect
.Top() ) );
597 MapMode
aMap( aVD
.GetMapMode() );
598 aMap
.SetMapUnit( MAP_100TH_MM
);
599 aMap
.SetOrigin( aOrigin
);
600 aVD
.SetMapMode( aMap
);
601 aVD
.SetOutputSize( aObjSize
);
602 const StyleSettings
& rStyles
= Application::GetSettings().GetStyleSettings();
603 aVD
.SetBackground( Wallpaper( rStyles
.GetFieldColor() ) );
604 aVD
.SetDrawMode( GetDisplayBackground().GetColor().IsDark()
605 ? ViewShell::OUTPUT_DRAWMODE_CONTRAST
606 : ViewShell::OUTPUT_DRAWMODE_COLOR
);
608 pObject
->SingleObjectPainter( aVD
); // #110094#-17
609 aBmp
= BitmapEx( aVD
.GetBitmap( aObjRect
.TopLeft(), aObjSize
) );
613 aCtlDisplay
.SetBitmapEx( &aBmp
);
617 aCtlDisplay
.SetBitmapEx( pBitmapEx
);
619 aCtlDisplay
.Invalidate();
620 aCtlDisplay
.Update();
622 aFiCount
.SetText( UniString::CreateFromInt32( aBmpExList
.Count() ) );
624 if( pBitmapEx
&& !bMovie
)
626 aNumFldBitmap
.SetValue( nListPos
+ 1 );
628 // Wenn mind. 1 Objekt in der Liste ist
630 aBtnReverse
.Enable();
633 aNumFldBitmap
.Enable();
635 aLbLoopCount
.Enable();
636 aBtnRemoveBitmap
.Enable();
637 aBtnRemoveAll
.Enable();
641 //aFiCount.SetText( String( SdResId( STR_NULL ) ) );
643 // Wenn kein Objekt in der Liste ist
644 aBtnFirst
.Enable( FALSE
);
645 aBtnReverse
.Enable( FALSE
);
646 aBtnPlay
.Enable( FALSE
);
647 aBtnLast
.Enable( FALSE
);
648 aNumFldBitmap
.Enable( FALSE
);
649 aTimeField
.Enable( FALSE
);
650 aLbLoopCount
.Enable( FALSE
);
651 aBtnRemoveBitmap
.Enable( FALSE
);
652 aBtnRemoveAll
.Enable( FALSE
);
654 //aFtAdjustment.Enable();
655 //aLbAdjustment.Enable();
658 if( bMovie
&& bDisableCtrls
)
660 aBtnGetOneObject
.Enable( FALSE
);
661 aBtnGetAllObjects
.Enable( FALSE
);
662 aRbtGroup
.Enable( FALSE
);
663 aRbtBitmap
.Enable( FALSE
);
664 aBtnCreateGroup
.Enable( FALSE
);
665 aFtAdjustment
.Enable( FALSE
);
666 aLbAdjustment
.Enable( FALSE
);
670 // 'Gruppenobjekt' nur dann enablen, wenn es kein Animated GIF ist
671 if (aBmpExList
.Count() == 0)
675 aBtnCreateGroup
.Enable(aBmpExList
.Count() != 0);
676 aFtAdjustment
.Enable( TRUE
);
677 aLbAdjustment
.Enable( TRUE
);
683 // -----------------------------------------------------------------------
685 void AnimationWindow::ResetAttrs()
688 aLbAdjustment
.SelectEntryPos( BA_CENTER
);
690 aLbLoopCount
.SelectEntryPos( aLbLoopCount
.GetEntryCount() - 1);
695 // -----------------------------------------------------------------------
697 void AnimationWindow::WaitInEffect( ULONG nMilliSeconds
) const
699 ULONG nEnd
= Time::GetSystemTicks() + nMilliSeconds
;
700 ULONG nCurrent
= Time::GetSystemTicks();
701 while (nCurrent
< nEnd
)
703 nCurrent
= Time::GetSystemTicks();
704 Application::Reschedule();
708 // -----------------------------------------------------------------------
710 void AnimationWindow::WaitInEffect( ULONG nMilliSeconds
, ULONG nTime
,
711 SfxProgress
* pProgress
) const
713 clock_t aEnd
= Time::GetSystemTicks() + nMilliSeconds
;
714 clock_t aCurrent
= Time::GetSystemTicks();
715 while (aCurrent
< aEnd
)
717 aCurrent
= Time::GetSystemTicks();
720 pProgress
->SetState( nTime
+ nMilliSeconds
+ aCurrent
- aEnd
);
722 Application::Reschedule();
729 // -----------------------------------------------------------------------
731 Fraction
AnimationWindow::GetScale()
734 ULONG nPos
= aBmpExList
.GetCurPos();
735 ULONG nCount
= aBmpExList
.Count();
738 aBmpSize
.Width() = 0;
739 aBmpSize
.Height() = 0;
740 for( ULONG i
= 0; i
< nCount
; i
++ )
742 pBitmapEx
= static_cast< BitmapEx
* >( aBmpExList
.GetObject( i
) );
743 Size
aTempSize( pBitmapEx
->GetBitmap().GetSizePixel() );
744 aBmpSize
.Width() = Max( aBmpSize
.Width(), aTempSize
.Width() );
745 aBmpSize
.Height() = Max( aBmpSize
.Height(), aTempSize
.Height() );
748 aBmpSize
.Width() += 10;
749 aBmpSize
.Height() += 10;
751 aFrac
= Fraction( std::min( (double)aDisplaySize
.Width() / (double)aBmpSize
.Width(),
752 (double)aDisplaySize
.Height() / (double)aBmpSize
.Height() ) );
754 // Liste wieder auf alten Stand bringen
755 pBitmapEx
= static_cast< BitmapEx
* >( aBmpExList
.GetObject( nPos
) );
759 // -----------------------------------------------------------------------
761 void AnimationWindow::Resize()
763 //if( !IsZoomedIn() )
764 if ( !IsFloatingMode() ||
765 !GetFloatingWindow()->IsRollUp() )
767 Size
aWinSize( GetOutputSizePixel() ); // vorher rSize im Resizing()
770 aDiffSize
.Width() = aWinSize
.Width() - aSize
.Width();
771 aDiffSize
.Height() = aWinSize
.Height() - aSize
.Height();
773 // Umgroessern des Display-Controls
774 aDisplaySize
.Width() += aDiffSize
.Width();
775 aDisplaySize
.Height() += aDiffSize
.Height();
776 aCtlDisplay
.SetOutputSizePixel( aDisplaySize
);
779 // aPt.X() = aDiffSize.Width() / 2;
780 aPt
.Y() = aDiffSize
.Height();
782 // Verschieben der anderen Controls
790 aNumFldBitmap
.Hide();
793 aBtnGetOneObject
.Hide();
794 aBtnGetAllObjects
.Hide();
795 aBtnRemoveBitmap
.Hide();
796 aBtnRemoveAll
.Hide();
800 aFtAdjustment
.Hide();
801 aLbAdjustment
.Hide();
802 aBtnCreateGroup
.Hide();
803 aGrpAnimation
.Hide();
806 aBtnFirst
.SetPosPixel( aBtnFirst
.GetPosPixel() + aPt
);
807 aBtnReverse
.SetPosPixel( aBtnReverse
.GetPosPixel() + aPt
);
808 aBtnStop
.SetPosPixel( aBtnStop
.GetPosPixel() + aPt
);
809 aBtnPlay
.SetPosPixel( aBtnPlay
.GetPosPixel() + aPt
);
810 aBtnLast
.SetPosPixel( aBtnLast
.GetPosPixel() + aPt
);
811 aNumFldBitmap
.SetPosPixel( aNumFldBitmap
.GetPosPixel() + aPt
);
812 aTimeField
.SetPosPixel( aTimeField
.GetPosPixel() + aPt
);
813 aLbLoopCount
.SetPosPixel( aLbLoopCount
.GetPosPixel() + aPt
);
814 aFtCount
.SetPosPixel( aFtCount
.GetPosPixel() + aPt
);
815 aFiCount
.SetPosPixel( aFiCount
.GetPosPixel() + aPt
);
816 aRbtGroup
.SetPosPixel( aRbtGroup
.GetPosPixel() + aPt
);
817 aRbtBitmap
.SetPosPixel( aRbtBitmap
.GetPosPixel() + aPt
);
818 aFtAdjustment
.SetPosPixel( aFtAdjustment
.GetPosPixel() + aPt
);
819 aLbAdjustment
.SetPosPixel( aLbAdjustment
.GetPosPixel() + aPt
);
820 aBtnGetOneObject
.SetPosPixel( aBtnGetOneObject
.GetPosPixel() + aPt
);
821 aBtnGetAllObjects
.SetPosPixel( aBtnGetAllObjects
.GetPosPixel() + aPt
);
822 aBtnRemoveBitmap
.SetPosPixel( aBtnRemoveBitmap
.GetPosPixel() + aPt
);
823 aBtnRemoveAll
.SetPosPixel( aBtnRemoveAll
.GetPosPixel() + aPt
);
824 aBtnCreateGroup
.SetPosPixel( aBtnCreateGroup
.GetPosPixel() + aPt
);
825 aGrpBitmap
.SetPosPixel( aGrpBitmap
.GetPosPixel() + aPt
);
826 aGrpAnimation
.SetPosPixel( aGrpAnimation
.GetPosPixel() + aPt
);
828 // Zoom fuer DisplayWin berechnen und setzen
829 Fraction
aFrac( GetScale() );
830 aCtlDisplay
.SetScale( aFrac
);
837 aNumFldBitmap
.Show();
842 aFtAdjustment
.Show();
843 aLbAdjustment
.Show();
844 aBtnGetOneObject
.Show();
845 aBtnGetAllObjects
.Show();
846 aBtnRemoveBitmap
.Show();
847 aBtnRemoveAll
.Show();
851 aFtAdjustment
.Show();
852 aLbAdjustment
.Show();
853 aBtnCreateGroup
.Show();
854 aGrpAnimation
.Show();
858 //aFltWinSize = GetSizePixel();
860 SfxDockingWindow::Resize();
863 // -----------------------------------------------------------------------
865 BOOL
AnimationWindow::Close()
867 if( maPlayLock
.isLocked() )
873 SfxBoolItem
aItem( SID_ANIMATION_OBJECTS
, FALSE
);
875 GetBindings().GetDispatcher()->Execute(
876 SID_ANIMATION_OBJECTS
, SFX_CALLMODE_ASYNCHRON
| SFX_CALLMODE_RECORD
, &aItem
, 0L );
878 SfxDockingWindow::Close();
884 // -----------------------------------------------------------------------
886 void AnimationWindow::FillInfo( SfxChildWinInfo
& rInfo
) const
888 SfxDockingWindow::FillInfo( rInfo
) ;
891 // -----------------------------------------------------------------------
893 void AnimationWindow::AddObj (::sd::View
& rView
)
895 // Texteingabemodus beenden, damit Bitmap mit
896 // Objekt identisch ist.
897 if( rView
.IsTextEdit() )
898 rView
.SdrEndTextEdit();
900 // Objekt(e) clonen und den/die Clone(s) in die Liste stellen
901 const SdrMarkList
& rMarkList
= rView
.GetMarkedObjectList();
902 ULONG nMarkCount
= rMarkList
.GetMarkCount();
903 SdPage
* pPage
= pMyDoc
->GetSdPage(0, PK_STANDARD
);
904 ULONG nCloneCount
= pPage
->GetObjCount();
908 // Wenn es sich um EIN Animationsobjekt oder ein Gruppenobjekt
909 // handelt, das 'einzeln uebernommen' wurde,
910 // werden die einzelnen Objekte eingefuegt
911 BOOL bAnimObj
= FALSE
;
912 if( nMarkCount
== 1 )
914 SdrMark
* pMark
= rMarkList
.GetMark(0);
915 SdrObject
* pObject
= pMark
->GetMarkedSdrObj();
916 SdAnimationInfo
* pAnimInfo
= rView
.GetDoc()->GetAnimationInfo( pObject
);
917 UINT32 nInv
= pObject
->GetObjInventor();
918 UINT16 nId
= pObject
->GetObjIdentifier();
920 // Animated Bitmap (GIF)
921 if( nInv
== SdrInventor
&& nId
== OBJ_GRAF
&& ( (SdrGrafObj
*) pObject
)->IsAnimated() )
923 const SdrGrafObj
* pGrafObj
= (SdrGrafObj
*) pObject
;
924 Graphic
aGraphic( pGrafObj
->GetTransformedGraphic() );
927 if( aGraphic
.IsAnimated() )
928 nCount
= aGraphic
.GetAnimation().Count();
932 const Animation
aAnimation( aGraphic
.GetAnimation() );
934 for( USHORT i
= 0; i
< nCount
; i
++ )
936 const AnimationBitmap
& rAnimBmp
= aAnimation
.Get( i
);
938 pBitmapEx
= new BitmapEx( rAnimBmp
.aBmpEx
);
939 aBmpExList
.Insert( pBitmapEx
, aBmpExList
.GetCurPos() + 1 );
944 long nLoopCount
= aAnimation
.GetLoopCount();
946 if( !nLoopCount
) // unendlich
947 aLbLoopCount
.SelectEntryPos( aLbLoopCount
.GetEntryCount() - 1);
949 aLbLoopCount
.SelectEntry( UniString::CreateFromInt32( nLoopCount
) );
953 long nTime
= rAnimBmp
.nWait
;
954 Time
* pTime
= new Time( 0, 0, nTime
/ 100, nTime
% 100 );
955 aTimeList
.Insert( pTime
, aBmpExList
.GetCurPos() + 1 );
957 // Weiterschalten der BitmapListe
960 // Nachdem ein animated GIF uebernommen wurde, kann auch nur ein solches erstellt werden
962 aRbtGroup
.Enable( FALSE
);
966 else if( bAllObjects
|| ( pAnimInfo
&& pAnimInfo
->mbIsMovie
) )
969 SdrObjList
* pObjList
= ((SdrObjGroup
*)pObject
)->GetSubList();
971 for( USHORT nObject
= 0; nObject
< pObjList
->GetObjCount(); nObject
++ )
973 SdrObject
* pSnapShot
= (SdrObject
*) pObjList
->GetObj( (ULONG
) nObject
);
975 pBitmapEx
= new BitmapEx( SdrExchangeView::GetObjGraphic( pSnapShot
->GetModel(), pSnapShot
).GetBitmapEx() );
976 aBmpExList
.Insert( pBitmapEx
, aBmpExList
.GetCurPos() + 1 );
979 Time
* pTime
= new Time( aTimeField
.GetTime() );
980 aTimeList
.Insert( pTime
, aBmpExList
.GetCurPos() + 1 );
983 pPage
->InsertObject( pSnapShot
->Clone(), aBmpExList
.GetCurPos() + 1 );
985 // Weiterschalten der BitmapListe
991 // Auch ein einzelnes animiertes Objekt
992 if( !bAnimObj
&& !( bAllObjects
&& nMarkCount
> 1 ) )
994 pBitmapEx
= new BitmapEx( rView
.GetAllMarkedGraphic().GetBitmapEx() );
995 aBmpExList
.Insert( pBitmapEx
, aBmpExList
.GetCurPos() + 1 );
998 Time
* pTime
= new Time( aTimeField
.GetTime() );
999 aTimeList
.Insert( pTime
, aBmpExList
.GetCurPos() + 1 );
1003 // ein einzelnes Objekt
1004 if( nMarkCount
== 1 && !bAnimObj
)
1006 SdrMark
* pMark
= rMarkList
.GetMark(0);
1007 SdrObject
* pObject
= pMark
->GetMarkedSdrObj();
1008 SdrObject
* pClone
= pObject
->Clone();
1009 pPage
->InsertObject(pClone
, aBmpExList
.GetCurPos() + 1);
1011 // mehrere Objekte: die Clones zu einer Gruppe zusammenfassen
1012 else if (nMarkCount
> 1)
1014 // Objekte einzeln uebernehmen
1017 for( ULONG nObject
= 0; nObject
< nMarkCount
; nObject
++ )
1020 SdrObject
* pObject
= rMarkList
.GetMark( nObject
)->GetMarkedSdrObj();
1022 pBitmapEx
= new BitmapEx( SdrExchangeView::GetObjGraphic( pObject
->GetModel(), pObject
).GetBitmapEx() );
1023 aBmpExList
.Insert( pBitmapEx
, aBmpExList
.GetCurPos() + 1 );
1026 Time
* pTime
= new Time( aTimeField
.GetTime() );
1027 aTimeList
.Insert( pTime
, aBmpExList
.GetCurPos() + 1 );
1029 pPage
->InsertObject( pObject
->Clone(), aBmpExList
.GetCurPos() + 1 );
1033 bAnimObj
= TRUE
; // damit nicht nochmal weitergeschaltet wird
1037 SdrObjGroup
* pCloneGroup
= new SdrObjGroup
;
1038 SdrObjList
* pObjList
= pCloneGroup
->GetSubList();
1040 for (ULONG nObject
= 0; nObject
< nMarkCount
; nObject
++)
1041 pObjList
->InsertObject(rMarkList
.GetMark(nObject
)->GetMarkedSdrObj()->Clone(), LIST_APPEND
);
1043 pPage
->InsertObject(pCloneGroup
, aBmpExList
.GetCurPos() + 1);
1050 // wenn vorher nichts im Animator war und jetzt was da ist, kann eine
1051 // Animationsgruppe erstellt werden
1052 if (nCloneCount
== 0 && aBmpExList
.Count() > 0)
1053 aBtnCreateGroup
.Enable();
1055 // Zoom fuer DisplayWin berechnen und setzen
1056 Fraction
aFrac( GetScale() );
1057 aCtlDisplay
.SetScale( aFrac
);
1059 UpdateControl( aBmpExList
.GetCurPos() );
1063 // -----------------------------------------------------------------------
1065 void AnimationWindow::CreateAnimObj (::sd::View
& rView
)
1067 ::Window
* pOutWin
= static_cast< ::Window
*>(rView
.GetFirstOutputDevice()); // GetWin( 0 );
1068 DBG_ASSERT( pOutWin
, "Window ist nicht vorhanden!" );
1070 // die Fentermitte ermitteln
1071 const MapMode
aMap100( MAP_100TH_MM
);
1074 Size
aTemp( pOutWin
->GetOutputSizePixel() );
1075 const Point
aWindowCenter( pOutWin
->PixelToLogic( Point( aTemp
.Width() >> 1, aTemp
.Height() >> 1 ) ) );
1076 const OutputDevice
* pDefDev
= Application::GetDefaultDevice();
1077 const ULONG nCount
= aBmpExList
.Count();
1078 BitmapAdjustment eBA
= (BitmapAdjustment
) aLbAdjustment
.GetSelectEntryPos();
1081 // Groesste Bitmap ermitteln
1082 for( i
= 0; i
< nCount
; i
++ )
1084 const BitmapEx
& rBmpEx
= *static_cast< BitmapEx
* >( aBmpExList
.GetObject( i
) );
1085 const Graphic
aGraphic( rBmpEx
);
1087 const Size
aTmpSizePix( rBmpEx
.GetSizePixel() );
1089 if ( aGraphic
.GetPrefMapMode().GetMapUnit() == MAP_PIXEL
)
1090 aTmpSizeLog
= pDefDev
->PixelToLogic( aGraphic
.GetPrefSize(), aMap100
);
1092 aTmpSizeLog
= pDefDev
->LogicToLogic( aGraphic
.GetPrefSize(), aGraphic
.GetPrefMapMode(), aMap100
);
1094 aMaxSizeLog
.Width() = Max( aMaxSizeLog
.Width(), aTmpSizeLog
.Width() );
1095 aMaxSizeLog
.Height() = Max( aMaxSizeLog
.Height(), aTmpSizeLog
.Height() );
1097 aMaxSizePix
.Width() = Max( aMaxSizePix
.Width(), aTmpSizePix
.Width() );
1098 aMaxSizePix
.Height() = Max( aMaxSizePix
.Height(), aTmpSizePix
.Height() );
1101 SdrPageView
* pPV
= rView
.GetSdrPageView();
1103 if( aRbtBitmap
.IsChecked() )
1105 // Bitmapgruppe erzeugen (Animated GIF)
1106 Animation aAnimation
;
1109 for( i
= 0; i
< nCount
; i
++ )
1111 Time
* pTime
= static_cast< Time
* >( aTimeList
.GetObject( i
) );
1112 long nTime
= pTime
->Get100Sec();
1113 nTime
+= pTime
->GetSec() * 100;
1115 pBitmapEx
= static_cast< BitmapEx
* >( aBmpExList
.GetObject( i
) );
1117 // Offset fuer die gewuenschte Ausrichtung bestimmen
1118 const Size
aBitmapSize( pBitmapEx
->GetSizePixel() );
1126 aPt
.Y() = (aMaxSizePix
.Height() - aBitmapSize
.Height()) >> 1;
1130 aPt
.Y() = aMaxSizePix
.Height() - aBitmapSize
.Height();
1134 aPt
.X() = (aMaxSizePix
.Width() - aBitmapSize
.Width()) >> 1;
1138 aPt
.X() = (aMaxSizePix
.Width() - aBitmapSize
.Width()) >> 1;
1139 aPt
.Y() = (aMaxSizePix
.Height() - aBitmapSize
.Height()) >> 1;
1143 aPt
.X() = (aMaxSizePix
.Width() - aBitmapSize
.Width()) >> 1;
1144 aPt
.Y() = aMaxSizePix
.Height() - aBitmapSize
.Height();
1148 aPt
.X() = aMaxSizePix
.Width() - aBitmapSize
.Width();
1152 aPt
.X() = aMaxSizePix
.Width() - aBitmapSize
.Width();
1153 aPt
.Y() = (aMaxSizePix
.Height() - aBitmapSize
.Height()) >> 1;
1157 aPt
.X() = aMaxSizePix
.Width() - aBitmapSize
.Width();
1158 aPt
.Y() = aMaxSizePix
.Height() - aBitmapSize
.Height();
1163 // LoopCount (Anzahl der Durchlaeufe) ermitteln
1164 AnimationBitmap aAnimBmp
;
1165 long nLoopCount
= 0L;
1166 USHORT nPos
= aLbLoopCount
.GetSelectEntryPos();
1168 if( nPos
!= LISTBOX_ENTRY_NOTFOUND
&& nPos
!= aLbLoopCount
.GetEntryCount() - 1 ) // unendlich
1169 nLoopCount
= (long) aLbLoopCount
.GetSelectEntry().ToInt32();
1171 aAnimBmp
.aBmpEx
= *pBitmapEx
;
1172 aAnimBmp
.aPosPix
= aPt
;
1173 aAnimBmp
.aSizePix
= aBitmapSize
;
1174 aAnimBmp
.nWait
= nTime
;
1175 aAnimBmp
.eDisposal
= DISPOSE_BACK
;
1176 aAnimBmp
.bUserInput
= FALSE
;
1178 aAnimation
.Insert( aAnimBmp
);
1179 aAnimation
.SetDisplaySizePixel( aMaxSizePix
);
1180 aAnimation
.SetLoopCount( nLoopCount
);
1183 SdrGrafObj
* pGrafObj
= new SdrGrafObj( Graphic( aAnimation
) );
1184 const Point
aOrg( aWindowCenter
.X() - ( aMaxSizeLog
.Width() >> 1 ), aWindowCenter
.Y() - ( aMaxSizeLog
.Height() >> 1 ) );
1186 pGrafObj
->SetLogicRect( Rectangle( aOrg
, aMaxSizeLog
) );
1187 rView
.InsertObjectAtView( pGrafObj
, *pPV
, SDRINSERT_SETDEFLAYER
);
1191 // Offset fuer die gewuenschte Ausrichtung bestimmen
1193 SdrObject
* pClone
= NULL
;
1194 SdPage
* pPage
= pMyDoc
->GetSdPage(0, PK_STANDARD
);
1196 for(i
= 0; i
< nCount
; i
++)
1198 pClone
= pPage
->GetObj(i
);
1199 Rectangle
aRect( pClone
->GetSnapRect() );
1207 aOffset
.Height() = (aMaxSizeLog
.Height() - aRect
.GetHeight()) / 2;
1211 aOffset
.Height() = aMaxSizeLog
.Height() - aRect
.GetHeight();
1215 aOffset
.Width() = (aMaxSizeLog
.Width() - aRect
.GetWidth()) / 2;
1219 aOffset
.Width() = (aMaxSizeLog
.Width() - aRect
.GetWidth()) / 2;
1220 aOffset
.Height() = (aMaxSizeLog
.Height() - aRect
.GetHeight()) / 2;
1224 aOffset
.Width() = (aMaxSizeLog
.Width() - aRect
.GetWidth()) / 2;
1225 aOffset
.Height() = aMaxSizeLog
.Height() - aRect
.GetHeight();
1229 aOffset
.Width() = aMaxSizeLog
.Width() - aRect
.GetWidth();
1233 aOffset
.Width() = aMaxSizeLog
.Width() - aRect
.GetWidth();
1234 aOffset
.Height() = (aMaxSizeLog
.Height() - aRect
.GetHeight()) / 2;
1238 aOffset
.Width() = aMaxSizeLog
.Width() - aRect
.GetWidth();
1239 aOffset
.Height() = aMaxSizeLog
.Height() - aRect
.GetHeight();
1243 //aRect.SetPos(aWindowCenter + Point(aOffset.Width(), aOffset.Height()));
1244 //pClone->SetSnapRect( aRect );
1245 // SetSnapRect ist fuer Ellipsen leider nicht implementiert !!!
1246 Point
aMovePt( aWindowCenter
+ Point( aOffset
.Width(), aOffset
.Height() ) - aRect
.TopLeft() );
1247 Size
aMoveSize( aMovePt
.X(), aMovePt
.Y() );
1248 pClone
->NbcMove( aMoveSize
);
1251 // Animationsgruppe erzeugen
1252 SdrObjGroup
* pGroup
= new SdrObjGroup
;
1253 SdrObjList
* pObjList
= pGroup
->GetSubList();
1255 for (i
= 0; i
< nCount
; i
++)
1257 // der Clone verbleibt im Animator; in die Gruppe kommt ein Clone
1259 pClone
= pPage
->GetObj(i
);
1260 SdrObject
* pCloneOfClone
= pClone
->Clone();
1261 //SdrObject* pCloneOfClone = pPage->GetObj(i)->Clone();
1262 pObjList
->InsertObject(pCloneOfClone
, LIST_APPEND
);
1265 // bis jetzt liegt die linke obere Ecke der Gruppe in der Fenstermitte;
1266 // jetzt noch um die Haelfte der Groesse nach oben und links korrigieren
1267 aTemp
= aMaxSizeLog
;
1268 aTemp
.Height() = - aTemp
.Height() / 2;
1269 aTemp
.Width() = - aTemp
.Width() / 2;
1270 pGroup
->NbcMove(aTemp
);
1272 // Animationsinformation erzeugen
1273 SdAnimationInfo
* pInfo
= SdDrawDocument::GetShapeUserData(*pGroup
,true);
1274 pInfo
->meEffect
= presentation::AnimationEffect_NONE
;
1275 pInfo
->meSpeed
= presentation::AnimationSpeed_MEDIUM
;
1276 pInfo
->mbActive
= TRUE
;
1277 pInfo
->mbIsMovie
= TRUE
;
1278 pInfo
->maBlueScreen
= COL_WHITE
;
1280 rView
.InsertObjectAtView( pGroup
, *pPV
, SDRINSERT_SETDEFLAYER
);
1283 ClickFirstHdl( this );
1286 void AnimationWindow::DataChanged( const DataChangedEvent
& rDCEvt
)
1288 SfxDockingWindow::DataChanged( rDCEvt
);
1290 if ( (rDCEvt
.GetType() == DATACHANGED_SETTINGS
) && (rDCEvt
.GetFlags() & SETTINGS_STYLE
) )
1292 UpdateControl( aBmpExList
.GetCurPos() );
1296 /*************************************************************************
1298 |* ControllerItem fuer Animator
1300 \************************************************************************/
1302 AnimationControllerItem::AnimationControllerItem(
1304 AnimationWindow
* pAnimWin
,
1305 SfxBindings
* _pBindings
)
1306 : SfxControllerItem( _nId
, *_pBindings
),
1307 pAnimationWin( pAnimWin
)
1311 // -----------------------------------------------------------------------
1313 void AnimationControllerItem::StateChanged( USHORT nSId
,
1314 SfxItemState eState
, const SfxPoolItem
* pItem
)
1316 if( eState
>= SFX_ITEM_AVAILABLE
&& nSId
== SID_ANIMATOR_STATE
)
1318 const SfxUInt16Item
* pStateItem
= PTR_CAST( SfxUInt16Item
, pItem
);
1319 DBG_ASSERT( pStateItem
, "SfxUInt16Item erwartet");
1320 UINT16 nState
= pStateItem
->GetValue();
1322 pAnimationWin
->aBtnGetOneObject
.Enable( nState
& 1 );
1323 pAnimationWin
->aBtnGetAllObjects
.Enable( nState
& 2 );
1328 } // end of namespace sd