no message

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31300 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor 2005-01-09 09:52:34 +00:00
parent 0ff2493d74
commit 2b1fe32e2e

View File

@ -47,8 +47,10 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id,
m_peer = new wxMacControl() ; m_peer = new wxMacControl() ;
verify_noerr ( CreateProgressBarControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , verify_noerr ( CreateProgressBarControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds ,
GetValue() , 0 , GetRange() , false /* not indeterminate */ , m_peer->GetControlRefAddr() ) ); GetValue() , 0 , GetRange() , false /* not indeterminate */ , m_peer->GetControlRefAddr() ) );
if ( GetValue() == 0 )
m_peer->SetData<Boolean>( kControlEntireControl , kControlProgressBarAnimatingTag , (Boolean) false ) ;
MacPostControlCreate(pos,size) ; MacPostControlCreate(pos,size) ;
return TRUE; return TRUE;
@ -69,7 +71,18 @@ void wxGauge::SetValue(int pos)
// some change behind the values by it // some change behind the values by it
wxGaugeBase::SetValue(pos) ; wxGaugeBase::SetValue(pos) ;
if ( m_peer && m_peer->Ok() ) if ( m_peer && m_peer->Ok() )
{
m_peer->SetValue( GetValue() ) ; m_peer->SetValue( GetValue() ) ;
Boolean shouldAnimate = ( GetValue() > 0 && GetValue() < GetRange() ) ;
if ( m_peer->GetData<Boolean>( kControlEntireControl , kControlProgressBarAnimatingTag ) != shouldAnimate )
{
m_peer->SetData<Boolean>( kControlEntireControl , kControlProgressBarAnimatingTag , shouldAnimate ) ;
if ( !shouldAnimate )
{
Refresh() ;
}
}
}
} }
int wxGauge::GetValue() const int wxGauge::GetValue() const