X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fe8635a7e78715344f0f4b6abc9d797931429333..6ea48c514e0b911113020c76fdb83b64f5941ddb:/src/mac/carbon/gauge.cpp

diff --git a/src/mac/carbon/gauge.cpp b/src/mac/carbon/gauge.cpp
index 531cf003f3..3793d8ed60 100644
--- a/src/mac/carbon/gauge.cpp
+++ b/src/mac/carbon/gauge.cpp
@@ -60,8 +60,15 @@ void wxGauge::SetRange(int r)
     // we are going via the base class in case there is 
     // some change behind the values by it
     wxGaugeBase::SetRange( r ) ;
-    if ( m_peer && m_peer->Ok() )
+    if ( m_peer && m_peer->Ok() ){
+        // switch back to determinate mode if not there already 
+        if ( m_peer->GetData<Boolean>( kControlNoPart, kControlProgressBarIndeterminateTag ) != false )
+        {
+             m_peer->SetData<Boolean>( kControlNoPart, kControlProgressBarIndeterminateTag, (Boolean)false );
+        }
+    
         m_peer->SetMaximum( GetRange() ) ;
+    }
 }
 
 void wxGauge::SetValue(int pos)
@@ -72,6 +79,12 @@ void wxGauge::SetValue(int pos)
 
     if ( m_peer && m_peer->Ok() )
     {
+        // switch back to determinate mode if not there already 
+        if ( m_peer->GetData<Boolean>( kControlNoPart, kControlProgressBarIndeterminateTag ) != false )
+        {
+            m_peer->SetData<Boolean>( kControlNoPart, kControlProgressBarIndeterminateTag, (Boolean)false );
+        }
+    
         m_peer->SetValue( GetValue() ) ;
 
         // turn off animation in the unnecessary situations as this is consuming a lot of CPU otherwise
@@ -99,7 +112,15 @@ void wxGauge::Pulse()
 {
     if ( m_peer && m_peer->Ok() )
     {
-        // need to use the animate() method of NSProgressIndicator Class here
+        if ( m_peer->GetData<Boolean>( kControlNoPart, kControlProgressBarIndeterminateTag ) != true )
+        {
+        m_peer->SetData<Boolean>( kControlNoPart, kControlProgressBarIndeterminateTag, true); 
+        }
+        
+        if ( m_peer->GetData<Boolean>( kControlEntireControl, kControlProgressBarAnimatingTag ) != true )
+        {
+            m_peer->SetData<Boolean>( kControlEntireControl, kControlProgressBarAnimatingTag, true ) ;
+        }
     }
 }