diff --git a/samples/widgets/gauge.cpp b/samples/widgets/gauge.cpp index 97f3995d6d..87ad1b547d 100644 --- a/samples/widgets/gauge.cpp +++ b/samples/widgets/gauge.cpp @@ -293,10 +293,8 @@ void GaugeWidgetsPage::CreateGauge() if ( m_chkSmooth->GetValue() ) flags |= wxGA_SMOOTH; -#if wxUSE_TASKBARBUTTON if ( m_chkProgress->GetValue() ) flags |= wxGA_PROGRESS; -#endif int val = 0; if ( m_gauge ) diff --git a/src/common/gaugecmn.cpp b/src/common/gaugecmn.cpp index 9e698d7dd2..e08f48e4e4 100644 --- a/src/common/gaugecmn.cpp +++ b/src/common/gaugecmn.cpp @@ -155,6 +155,9 @@ bool wxGaugeBase::Create(wxWindow *parent, void wxGaugeBase::SetRange(int range) { m_rangeMax = range; + + if ( m_appProgressIndicator ) + m_appProgressIndicator->SetRange(m_rangeMax); } int wxGaugeBase::GetRange() const @@ -165,6 +168,15 @@ int wxGaugeBase::GetRange() const void wxGaugeBase::SetValue(int pos) { m_gaugePos = pos; + + if ( m_appProgressIndicator ) + { + m_appProgressIndicator->SetValue(pos); + if ( pos == 0 ) + { + m_appProgressIndicator->Reset(); + } + } } int wxGaugeBase::GetValue() const @@ -203,6 +215,9 @@ void wxGaugeBase::Pulse() } } #endif + + if ( m_appProgressIndicator ) + m_appProgressIndicator->Pulse(); } #endif // wxUSE_GAUGE diff --git a/src/msw/gauge.cpp b/src/msw/gauge.cpp index 8bf0645031..78d298ebc6 100644 --- a/src/msw/gauge.cpp +++ b/src/msw/gauge.cpp @@ -145,7 +145,7 @@ void wxGauge::SetRange(int r) if ( IsInIndeterminateMode() ) SetDeterminateMode(); - m_rangeMax = r; + wxGaugeBase::SetRange(r); #ifdef PBM_SETRANGE32 ::SendMessage(GetHwnd(), PBM_SETRANGE32, 0, r); @@ -153,9 +153,6 @@ void wxGauge::SetRange(int r) // fall back to PBM_SETRANGE (limited to 16 bits) ::SendMessage(GetHwnd(), PBM_SETRANGE, 0, MAKELPARAM(0, r)); #endif // PBM_SETRANGE32/!PBM_SETRANGE32 - - if ( m_appProgressIndicator ) - m_appProgressIndicator->SetRange(m_rangeMax); } void wxGauge::SetValue(int pos) @@ -166,18 +163,9 @@ void wxGauge::SetValue(int pos) if ( GetValue() != pos ) { - m_gaugePos = pos; + wxGaugeBase::SetValue(pos); ::SendMessage(GetHwnd(), PBM_SETPOS, pos, 0); - - if ( m_appProgressIndicator ) - { - m_appProgressIndicator->SetValue(pos); - if ( pos == 0 ) - { - m_appProgressIndicator->Reset(); - } - } } } @@ -235,15 +223,15 @@ void wxGauge::Pulse() SetIndeterminateMode(); SendMessage(GetHwnd(), PBM_STEPIT, 0, 0); + + if ( m_appProgressIndicator ) + m_appProgressIndicator->Pulse(); } else { // emulate indeterminate mode wxGaugeBase::Pulse(); } - - if ( m_appProgressIndicator ) - m_appProgressIndicator->Pulse(); } #endif // wxUSE_GAUGE diff --git a/src/osx/gauge_osx.cpp b/src/osx/gauge_osx.cpp index 40e4c71cd8..46ded9dcf2 100644 --- a/src/osx/gauge_osx.cpp +++ b/src/osx/gauge_osx.cpp @@ -14,6 +14,7 @@ #include "wx/gauge.h" +#include "wx/appprogress.h" #include "wx/osx/private.h" bool wxGauge::Create( wxWindow *parent, @@ -66,6 +67,9 @@ int wxGauge::GetValue() const void wxGauge::Pulse() { GetPeer()->PulseGauge(); + + if ( m_appProgressIndicator ) + m_appProgressIndicator->Pulse(); } #endif // wxUSE_GAUGE