diff options
Diffstat (limited to 'UnoControls/source/controls/progressbar.cxx')
-rw-r--r-- | UnoControls/source/controls/progressbar.cxx | 160 |
1 files changed, 80 insertions, 80 deletions
diff --git a/UnoControls/source/controls/progressbar.cxx b/UnoControls/source/controls/progressbar.cxx index 7d05435e48b2..2ca79b4b425b 100644 --- a/UnoControls/source/controls/progressbar.cxx +++ b/UnoControls/source/controls/progressbar.cxx @@ -26,13 +26,13 @@ * ************************************************************************/ //____________________________________________________________________________________________________________ -// my own includes +// my own includes //____________________________________________________________________________________________________________ #include "progressbar.hxx" //____________________________________________________________________________________________________________ -// includes of other projects +// includes of other projects //____________________________________________________________________________________________________________ #include <com/sun/star/awt/GradientStyle.hpp> #include <com/sun/star/awt/RasterOperation.hpp> @@ -45,36 +45,36 @@ #include <limits.h> //____________________________________________________________________________________________________________ -// includes of my project +// includes of my project //____________________________________________________________________________________________________________ //____________________________________________________________________________________________________________ -// namespace +// namespace //____________________________________________________________________________________________________________ -using namespace ::cppu ; -using namespace ::osl ; -using namespace ::rtl ; -using namespace ::com::sun::star::uno ; -using namespace ::com::sun::star::lang ; -using namespace ::com::sun::star::awt ; +using namespace ::cppu ; +using namespace ::osl ; +using namespace ::rtl ; +using namespace ::com::sun::star::uno ; +using namespace ::com::sun::star::lang ; +using namespace ::com::sun::star::awt ; namespace unocontrols{ //____________________________________________________________________________________________________________ -// construct/destruct +// construct/destruct //____________________________________________________________________________________________________________ ProgressBar::ProgressBar( const Reference< XMultiServiceFactory >& xFactory ) - : BaseControl ( xFactory ) - , m_bHorizontal ( PROGRESSBAR_DEFAULT_HORIZONTAL ) - , m_aBlockSize ( PROGRESSBAR_DEFAULT_BLOCKDIMENSION ) - , m_nForegroundColor ( PROGRESSBAR_DEFAULT_FOREGROUNDCOLOR ) - , m_nBackgroundColor ( PROGRESSBAR_DEFAULT_BACKGROUNDCOLOR ) - , m_nMinRange ( PROGRESSBAR_DEFAULT_MINRANGE ) - , m_nMaxRange ( PROGRESSBAR_DEFAULT_MAXRANGE ) - , m_nBlockValue ( PROGRESSBAR_DEFAULT_BLOCKVALUE ) - , m_nValue ( PROGRESSBAR_DEFAULT_VALUE ) + : BaseControl ( xFactory ) + , m_bHorizontal ( PROGRESSBAR_DEFAULT_HORIZONTAL ) + , m_aBlockSize ( PROGRESSBAR_DEFAULT_BLOCKDIMENSION ) + , m_nForegroundColor ( PROGRESSBAR_DEFAULT_FOREGROUNDCOLOR ) + , m_nBackgroundColor ( PROGRESSBAR_DEFAULT_BACKGROUNDCOLOR ) + , m_nMinRange ( PROGRESSBAR_DEFAULT_MINRANGE ) + , m_nMaxRange ( PROGRESSBAR_DEFAULT_MAXRANGE ) + , m_nBlockValue ( PROGRESSBAR_DEFAULT_BLOCKVALUE ) + , m_nValue ( PROGRESSBAR_DEFAULT_VALUE ) { } @@ -83,13 +83,13 @@ ProgressBar::~ProgressBar() } //____________________________________________________________________________________________________________ -// XInterface +// XInterface //____________________________________________________________________________________________________________ Any SAL_CALL ProgressBar::queryInterface( const Type& rType ) throw( RuntimeException ) { // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. + // Don't use mutex or guard in this method!!! Is a method of XInterface. Any aReturn ; Reference< XInterface > xDel = BaseControl::impl_getDelegator(); if ( xDel.is() ) @@ -108,33 +108,33 @@ Any SAL_CALL ProgressBar::queryInterface( const Type& rType ) throw( RuntimeExce } //____________________________________________________________________________________________________________ -// XInterface +// XInterface //____________________________________________________________________________________________________________ void SAL_CALL ProgressBar::acquire() throw() { // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. + // Don't use mutex or guard in this method!!! Is a method of XInterface. // Forward to baseclass BaseControl::acquire(); } //____________________________________________________________________________________________________________ -// XInterface +// XInterface //____________________________________________________________________________________________________________ void SAL_CALL ProgressBar::release() throw() { // Attention: - // Don't use mutex or guard in this method!!! Is a method of XInterface. + // Don't use mutex or guard in this method!!! Is a method of XInterface. // Forward to baseclass BaseControl::release(); } //____________________________________________________________________________________________________________ -// XTypeProvider +// XTypeProvider //____________________________________________________________________________________________________________ Sequence< Type > SAL_CALL ProgressBar::getTypes() throw( RuntimeException ) @@ -153,8 +153,8 @@ Sequence< Type > SAL_CALL ProgressBar::getTypes() throw( RuntimeException ) if ( pTypeCollection == NULL ) { // Create a static typecollection ... - static OTypeCollection aTypeCollection ( ::getCppuType(( const Reference< XControlModel >*) NULL ) , - ::getCppuType(( const Reference< XProgressBar >*) NULL ) , + static OTypeCollection aTypeCollection ( ::getCppuType(( const Reference< XControlModel >*) NULL ) , + ::getCppuType(( const Reference< XProgressBar >*) NULL ) , BaseControl::getTypes() ); // ... and set his address to static pointer! @@ -166,16 +166,16 @@ Sequence< Type > SAL_CALL ProgressBar::getTypes() throw( RuntimeException ) } //____________________________________________________________________________________________________________ -// XAggregation +// XAggregation //____________________________________________________________________________________________________________ Any SAL_CALL ProgressBar::queryAggregation( const Type& aType ) throw( RuntimeException ) { // Ask for my own supported interfaces ... // Attention: XTypeProvider and XInterface are supported by OComponentHelper! - Any aReturn ( ::cppu::queryInterface( aType , - static_cast< XControlModel* > ( this ) , - static_cast< XProgressBar* > ( this ) + Any aReturn ( ::cppu::queryInterface( aType , + static_cast< XControlModel* > ( this ) , + static_cast< XProgressBar* > ( this ) ) ); @@ -190,13 +190,13 @@ Any SAL_CALL ProgressBar::queryAggregation( const Type& aType ) throw( RuntimeEx } //____________________________________________________________________________________________________________ -// XProgressBar +// XProgressBar //____________________________________________________________________________________________________________ void SAL_CALL ProgressBar::setForegroundColor( sal_Int32 nColor ) throw( RuntimeException ) { // Ready for multithreading - MutexGuard aGuard (m_aMutex) ; + MutexGuard aGuard (m_aMutex) ; // Safe color for later use. m_nForegroundColor = nColor ; @@ -206,13 +206,13 @@ void SAL_CALL ProgressBar::setForegroundColor( sal_Int32 nColor ) throw( Runtime } //____________________________________________________________________________________________________________ -// XProgressBar +// XProgressBar //____________________________________________________________________________________________________________ void SAL_CALL ProgressBar::setBackgroundColor ( sal_Int32 nColor ) throw( RuntimeException ) { // Ready for multithreading - MutexGuard aGuard (m_aMutex) ; + MutexGuard aGuard (m_aMutex) ; // Safe color for later use. m_nBackgroundColor = nColor ; @@ -222,14 +222,14 @@ void SAL_CALL ProgressBar::setBackgroundColor ( sal_Int32 nColor ) throw( Runtim } //____________________________________________________________________________________________________________ -// XProgressBar +// XProgressBar //____________________________________________________________________________________________________________ void SAL_CALL ProgressBar::setValue ( sal_Int32 nValue ) throw( RuntimeException ) { // This method is defined for follow things: - // 1) Values >= _nMinRange - // 2) Values <= _nMaxRange + // 1) Values >= _nMinRange + // 2) Values <= _nMaxRange // Ready for multithreading MutexGuard aGuard (m_aMutex) ; @@ -253,15 +253,15 @@ void SAL_CALL ProgressBar::setValue ( sal_Int32 nValue ) throw( RuntimeException } //____________________________________________________________________________________________________________ -// XProgressBar +// XProgressBar //____________________________________________________________________________________________________________ void SAL_CALL ProgressBar::setRange ( sal_Int32 nMin, sal_Int32 nMax ) throw( RuntimeException ) { // This method is defined for follow things: - // 1) All values of sal_Int32 - // 2) Min < Max - // 3) Min > Max + // 1) All values of sal_Int32 + // 2) Min < Max + // 3) Min > Max // save impossible cases // This method is only defined for valid values @@ -269,20 +269,20 @@ void SAL_CALL ProgressBar::setRange ( sal_Int32 nMin, sal_Int32 nMax ) throw( Ru DBG_ASSERT ( ( nMin != nMax ) , "ProgressBar::setRange()\nValues for MIN and MAX are the same. This is not allowed!\n" ) ; // Ready for multithreading - MutexGuard aGuard (m_aMutex) ; + MutexGuard aGuard (m_aMutex) ; // control the values for min and max if ( nMin < nMax ) { // Take correct Min and Max - m_nMinRange = nMin ; - m_nMaxRange = nMax ; + m_nMinRange = nMin ; + m_nMaxRange = nMax ; } else { // Change Min and Max automaticly - m_nMinRange = nMax ; - m_nMaxRange = nMin ; + m_nMinRange = nMax ; + m_nMaxRange = nMin ; } // assure that m_nValue is within the range @@ -297,7 +297,7 @@ void SAL_CALL ProgressBar::setRange ( sal_Int32 nMin, sal_Int32 nMax ) throw( Ru } //____________________________________________________________________________________________________________ -// XProgressBar +// XProgressBar //____________________________________________________________________________________________________________ sal_Int32 SAL_CALL ProgressBar::getValue () throw( RuntimeException ) @@ -309,7 +309,7 @@ sal_Int32 SAL_CALL ProgressBar::getValue () throw( RuntimeException ) } //____________________________________________________________________________________________________________ -// XWindow +// XWindow //____________________________________________________________________________________________________________ void SAL_CALL ProgressBar::setPosSize ( @@ -327,17 +327,17 @@ void SAL_CALL ProgressBar::setPosSize ( // Do only, if size has changed. if ( - ( nWidth != aBasePosSize.Width ) || - ( nHeight != aBasePosSize.Height ) + ( nWidth != aBasePosSize.Width ) || + ( nHeight != aBasePosSize.Height ) ) { - impl_recalcRange ( ) ; - impl_paint ( 0, 0, impl_getGraphicsPeer () ) ; + impl_recalcRange ( ) ; + impl_paint ( 0, 0, impl_getGraphicsPeer () ) ; } } //____________________________________________________________________________________________________________ -// XControl +// XControl //____________________________________________________________________________________________________________ sal_Bool SAL_CALL ProgressBar::setModel( const Reference< XControlModel >& /*xModel*/ ) throw( RuntimeException ) @@ -347,7 +347,7 @@ sal_Bool SAL_CALL ProgressBar::setModel( const Reference< XControlModel >& /*xMo } //____________________________________________________________________________________________________________ -// XControl +// XControl //____________________________________________________________________________________________________________ Reference< XControlModel > SAL_CALL ProgressBar::getModel() throw( RuntimeException ) @@ -357,7 +357,7 @@ Reference< XControlModel > SAL_CALL ProgressBar::getModel() throw( RuntimeExcept } //____________________________________________________________________________________________________________ -// impl but public method to register service +// impl but public method to register service //____________________________________________________________________________________________________________ const Sequence< OUString > ProgressBar::impl_getStaticSupportedServiceNames() @@ -369,7 +369,7 @@ const Sequence< OUString > ProgressBar::impl_getStaticSupportedServiceNames() } //____________________________________________________________________________________________________________ -// impl but public method to register service +// impl but public method to register service //____________________________________________________________________________________________________________ const OUString ProgressBar::impl_getStaticImplementationName() @@ -378,7 +378,7 @@ const OUString ProgressBar::impl_getStaticImplementationName() } //____________________________________________________________________________________________________________ -// protected method +// protected method //____________________________________________________________________________________________________________ void ProgressBar::impl_paint ( sal_Int32 nX, sal_Int32 nY, const Reference< XGraphics > & rGraphics ) @@ -390,13 +390,13 @@ void ProgressBar::impl_paint ( sal_Int32 nX, sal_Int32 nY, const Reference< XGra // Every request paint the completely control. ( but only, if peer exist ) if ( rGraphics.is () ) { - MutexGuard aGuard (m_aMutex) ; + MutexGuard aGuard (m_aMutex) ; // Clear background // (same color for line and fill) - rGraphics->setFillColor ( m_nBackgroundColor ) ; - rGraphics->setLineColor ( m_nBackgroundColor ) ; - rGraphics->drawRect ( nX, nY, impl_getWidth(), impl_getHeight() ) ; + rGraphics->setFillColor ( m_nBackgroundColor ) ; + rGraphics->setLineColor ( m_nBackgroundColor ) ; + rGraphics->drawRect ( nX, nY, impl_getWidth(), impl_getHeight() ) ; // same color for line and fill for blocks rGraphics->setFillColor ( m_nForegroundColor ) ; @@ -410,16 +410,16 @@ void ProgressBar::impl_paint ( sal_Int32 nX, sal_Int32 nY, const Reference< XGra if (m_bHorizontal) { // Step to left side of window - nBlockStart = nX ; + nBlockStart = nX ; for ( sal_Int16 i=1; i<=nBlockCount; ++i ) { // step free field - nBlockStart += PROGRESSBAR_FREESPACE ; + nBlockStart += PROGRESSBAR_FREESPACE ; // paint block rGraphics->drawRect (nBlockStart, nY+PROGRESSBAR_FREESPACE, m_aBlockSize.Width, m_aBlockSize.Height) ; // step next free field - nBlockStart += m_aBlockSize.Width ; + nBlockStart += m_aBlockSize.Width ; } } // draw vertikal progressbar @@ -427,38 +427,38 @@ void ProgressBar::impl_paint ( sal_Int32 nX, sal_Int32 nY, const Reference< XGra else { // step to bottom side of window - nBlockStart = nY+impl_getHeight() ; - nBlockStart -= m_aBlockSize.Height ; + nBlockStart = nY+impl_getHeight() ; + nBlockStart -= m_aBlockSize.Height ; for ( sal_Int16 i=1; i<=nBlockCount; ++i ) { // step free field - nBlockStart -= PROGRESSBAR_FREESPACE ; + nBlockStart -= PROGRESSBAR_FREESPACE ; // paint block rGraphics->drawRect (nX+PROGRESSBAR_FREESPACE, nBlockStart, m_aBlockSize.Width, m_aBlockSize.Height) ; // step next free field - nBlockStart -= m_aBlockSize.Height; + nBlockStart -= m_aBlockSize.Height; } } // Paint shadow border around the progressbar - rGraphics->setLineColor ( PROGRESSBAR_LINECOLOR_SHADOW ) ; - rGraphics->drawLine ( nX, nY, impl_getWidth(), nY ) ; - rGraphics->drawLine ( nX, nY, nX , impl_getHeight() ) ; + rGraphics->setLineColor ( PROGRESSBAR_LINECOLOR_SHADOW ) ; + rGraphics->drawLine ( nX, nY, impl_getWidth(), nY ) ; + rGraphics->drawLine ( nX, nY, nX , impl_getHeight() ) ; - rGraphics->setLineColor ( PROGRESSBAR_LINECOLOR_BRIGHT ) ; - rGraphics->drawLine ( impl_getWidth()-1, impl_getHeight()-1, impl_getWidth()-1, nY ) ; - rGraphics->drawLine ( impl_getWidth()-1, impl_getHeight()-1, nX , impl_getHeight()-1 ) ; + rGraphics->setLineColor ( PROGRESSBAR_LINECOLOR_BRIGHT ) ; + rGraphics->drawLine ( impl_getWidth()-1, impl_getHeight()-1, impl_getWidth()-1, nY ) ; + rGraphics->drawLine ( impl_getWidth()-1, impl_getHeight()-1, nX , impl_getHeight()-1 ) ; } } //____________________________________________________________________________________________________________ -// protected method +// protected method //____________________________________________________________________________________________________________ void ProgressBar::impl_recalcRange () { - MutexGuard aGuard (m_aMutex) ; + MutexGuard aGuard (m_aMutex) ; sal_Int32 nWindowWidth = impl_getWidth() ; sal_Int32 nWindowHeight = impl_getHeight() ; @@ -489,6 +489,6 @@ void ProgressBar::impl_recalcRange () m_aBlockSize.Width = (sal_Int32)fBlockWidth ; } -} // namespace unocontrols +} // namespace unocontrols /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |