diff options
Diffstat (limited to 'toolkit/source/awt/xthrobber.cxx')
-rw-r--r-- | toolkit/source/awt/xthrobber.cxx | 76 |
1 files changed, 18 insertions, 58 deletions
diff --git a/toolkit/source/awt/xthrobber.cxx b/toolkit/source/awt/xthrobber.cxx index 439fb49c1cbe..3b9b361202e9 100644 --- a/toolkit/source/awt/xthrobber.cxx +++ b/toolkit/source/awt/xthrobber.cxx @@ -30,7 +30,6 @@ #include "toolkit/awt/xthrobber.hxx" #include "toolkit/helper/property.hxx" #include <toolkit/helper/tkresmgr.hxx> -#include <toolkit/helper/throbberimpl.hxx> #ifndef _TOOLKIT_AWT_XTHROBBER_HRC_ #include "xthrobber.hrc" @@ -38,6 +37,7 @@ #include <tools/debug.hxx> #include <vcl/fixed.hxx> #include <vcl/timer.hxx> +#include <vcl/throbber.hxx> //........................................................................ namespace toolkit @@ -55,82 +55,37 @@ namespace toolkit XThrobber::XThrobber() { DBG_CTOR( XThrobber, NULL ); - - mpThrobber = new Throbber_Impl( this, 100, sal_True ); - - InitImageList(); } //-------------------------------------------------------------------- XThrobber::~XThrobber() { DBG_DTOR( XThrobber, NULL ); - delete mpThrobber; } //-------------------------------------------------------------------- - IMPLEMENT_FORWARD_XINTERFACE2( XThrobber, VCLXWindow, XThrobber_Base ) - - //-------------------------------------------------------------------- - IMPLEMENT_FORWARD_XTYPEPROVIDER2( XThrobber, VCLXWindow, XThrobber_Base ) - - //-------------------------------------------------------------------- void SAL_CALL XThrobber::start() throw ( uno::RuntimeException ) { - mpThrobber->start(); + ::vos::OGuard aGuard( GetMutex() ); + Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) ); + if ( pThrobber != NULL) + pThrobber->start(); } //-------------------------------------------------------------------- void SAL_CALL XThrobber::stop() throw ( uno::RuntimeException ) { - mpThrobber->stop(); - } - - //-------------------------------------------------------------------- - void XThrobber::ProcessWindowEvent( const VclWindowEvent& _rVclWindowEvent ) - { - static bool bInit = false; - if ( !bInit ) - { - // Images won't be shown if set too early - mpThrobber->initImage(); - bInit = true; - } - // TODO: XSimpleAnimation::ProcessWindowEvent - //::vos::OClearableGuard aGuard( GetMutex() ); - //Reference< XSimpleAnimation > xKeepAlive( this ); - //SpinButton* pSpinButton = static_cast< SpinButton* >( GetWindow() ); - //if ( !pSpinButton ) - // return; - - VCLXWindow::ProcessWindowEvent( _rVclWindowEvent ); - } - - //-------------------------------------------------------------------- - void SAL_CALL XThrobber::setProperty( const ::rtl::OUString& PropertyName, const uno::Any& Value ) - throw( uno::RuntimeException ) - { ::vos::OGuard aGuard( GetMutex() ); - - if ( GetWindow() ) - { - VCLXWindow::setProperty( PropertyName, Value ); - } + Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) ); + if ( pThrobber != NULL) + pThrobber->stop(); } //-------------------------------------------------------------------- - uno::Any SAL_CALL XThrobber::getProperty( const ::rtl::OUString& PropertyName ) - throw( uno::RuntimeException ) + void XThrobber::SetWindow( Window* pWindow ) { - ::vos::OGuard aGuard( GetMutex() ); - - uno::Any aReturn; - - if ( GetWindow() ) - { - aReturn = VCLXWindow::getProperty( PropertyName ); - } - return aReturn; + XThrobber_Base::SetWindow( pWindow ); + InitImageList(); } //-------------------------------------------------------------------- @@ -138,10 +93,15 @@ namespace toolkit throw( uno::RuntimeException ) { ::vos::OGuard aGuard( GetMutex() ); + + Throbber* pThrobber( dynamic_cast< Throbber* >( GetWindow() ) ); + if ( pThrobber == NULL) + return; + uno::Sequence< uno::Reference< graphic::XGraphic > > aImageList(12); sal_uInt16 nIconIdStart = RID_TK_ICON_THROBBER_START; - if ( mpThrobber->isHCMode() ) + if ( pThrobber->GetSettings().GetStyleSettings().GetHighContrastMode() ) nIconIdStart = RID_TK_HC_ICON_THROBBER_START; for ( sal_uInt16 i=0; i<12; i++ ) @@ -150,7 +110,7 @@ namespace toolkit aImageList[i] = aImage.GetXGraphic(); } - mpThrobber->setImageList( aImageList ); + pThrobber->setImageList( aImageList ); } //........................................................................ |