From: Stefan Csomor Date: Sun, 9 Jan 2005 09:52:34 +0000 (+0000) Subject: no message X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/2b1fe32e2e392078ea65c528b290611584849929 no message git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31300 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/gauge.cpp b/src/mac/carbon/gauge.cpp index 6e9ed032f2..8dadaff83f 100644 --- a/src/mac/carbon/gauge.cpp +++ b/src/mac/carbon/gauge.cpp @@ -47,8 +47,10 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id, m_peer = new wxMacControl() ; verify_noerr ( CreateProgressBarControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , GetValue() , 0 , GetRange() , false /* not indeterminate */ , m_peer->GetControlRefAddr() ) ); - - + + if ( GetValue() == 0 ) + m_peer->SetData( kControlEntireControl , kControlProgressBarAnimatingTag , (Boolean) false ) ; + MacPostControlCreate(pos,size) ; return TRUE; @@ -69,7 +71,18 @@ void wxGauge::SetValue(int pos) // some change behind the values by it wxGaugeBase::SetValue(pos) ; if ( m_peer && m_peer->Ok() ) + { m_peer->SetValue( GetValue() ) ; + Boolean shouldAnimate = ( GetValue() > 0 && GetValue() < GetRange() ) ; + if ( m_peer->GetData( kControlEntireControl , kControlProgressBarAnimatingTag ) != shouldAnimate ) + { + m_peer->SetData( kControlEntireControl , kControlProgressBarAnimatingTag , shouldAnimate ) ; + if ( !shouldAnimate ) + { + Refresh() ; + } + } + } } int wxGauge::GetValue() const