X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b1fe32e2e392078ea65c528b290611584849929..132422c4b93a0fe5d4f313350adf2c13423c07ac:/src/mac/carbon/gauge.cpp diff --git a/src/mac/carbon/gauge.cpp b/src/mac/carbon/gauge.cpp index 8dadaff83f..c10665e402 100644 --- a/src/mac/carbon/gauge.cpp +++ b/src/mac/carbon/gauge.cpp @@ -9,14 +9,16 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "gauge.h" #endif -#include "wx/gauge.h" +#include "wx/wxprec.h" #if wxUSE_GAUGE +#include "wx/gauge.h" + #if !USE_SHARED_LIBRARY IMPLEMENT_DYNAMIC_CLASS(wxGauge, wxControl) #endif @@ -44,7 +46,7 @@ bool wxGauge::Create(wxWindow *parent, wxWindowID id, } */ Rect bounds = wxMacGetBoundsForControl( this , pos , size ) ; - m_peer = new wxMacControl() ; + m_peer = new wxMacControl(this) ; verify_noerr ( CreateProgressBarControl( MAC_WXHWND(parent->MacGetTopLevelWindowRef()) , &bounds , GetValue() , 0 , GetRange() , false /* not indeterminate */ , m_peer->GetControlRefAddr() ) ); @@ -73,6 +75,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( kControlEntireControl , kControlProgressBarAnimatingTag ) != shouldAnimate ) {