optimizing gauge cpu usage

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31301 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2005-01-09 09:55:27 +00:00
parent 2b1fe32e2e
commit 456fd7b661

View File

@ -73,6 +73,7 @@ void wxGauge::SetValue(int pos)
if ( m_peer && m_peer->Ok() )
{
m_peer->SetValue( GetValue() ) ;
// we turn off animation in the unnecessary situations as this is eating a lot of CPU otherwise
Boolean shouldAnimate = ( GetValue() > 0 && GetValue() < GetRange() ) ;
if ( m_peer->GetData<Boolean>( kControlEntireControl , kControlProgressBarAnimatingTag ) != shouldAnimate )
{