diff --git a/include/wx/appprogress.h b/include/wx/appprogress.h index cda93729eb..816da3d548 100644 --- a/include/wx/appprogress.h +++ b/include/wx/appprogress.h @@ -29,7 +29,7 @@ private: wxDECLARE_NO_COPY_CLASS(wxAppProgressIndicatorBase); }; -#if defined(__WXMSW__) +#if defined(__WXMSW__) && wxUSE_TASKBARBUTTON #include "wx/msw/appprogress.h" #else class wxAppProgressIndicator : public wxAppProgressIndicatorBase diff --git a/include/wx/msw/appprogress.h b/include/wx/msw/appprogress.h index 4194e05aa7..0840c075d4 100644 --- a/include/wx/msw/appprogress.h +++ b/include/wx/msw/appprogress.h @@ -31,9 +31,7 @@ public: private: int m_maxValue; -#if wxUSE_TASKBARBUTTON wxVector m_taskBarButtons; -#endif // wxUSE_TASKBARBUTTON wxDECLARE_NO_COPY_CLASS(wxAppProgressIndicator); }; diff --git a/src/msw/appprogress.cpp b/src/msw/appprogress.cpp index 2aaa4883dc..9c753d1e71 100644 --- a/src/msw/appprogress.cpp +++ b/src/msw/appprogress.cpp @@ -13,6 +13,8 @@ #pragma hdrstop #endif +#if wxUSE_TASKBARBUTTON + #ifndef WX_PRECOMP #include "wx/toplevel.h" #endif @@ -26,7 +28,6 @@ wxAppProgressIndicator::wxAppProgressIndicator(wxWindow* parent, int maxValue) : m_maxValue(maxValue) { -#if wxUSE_TASKBARBUTTON if ( parent == NULL ) { for ( wxWindowList::const_iterator it = wxTopLevelWindows.begin(); @@ -47,19 +48,16 @@ wxAppProgressIndicator::wxAppProgressIndicator(wxWindow* parent, int maxValue) Reset(); SetRange(m_maxValue); -#endif // wxUSE_TASKBARBUTTON } wxAppProgressIndicator::~wxAppProgressIndicator() { -#if wxUSE_TASKBARBUTTON Reset(); for ( size_t i = 0; i < m_taskBarButtons.size(); ++i ) { delete m_taskBarButtons[i]; } -#endif // wxUSE_TASKBARBUTTON } bool wxAppProgressIndicator::IsAvailable() const @@ -71,41 +69,36 @@ void wxAppProgressIndicator::SetValue(int value) { wxASSERT_MSG( value <= m_maxValue, wxT("invalid progress value") ); -#if wxUSE_TASKBARBUTTON for ( size_t i = 0; i < m_taskBarButtons.size(); ++i ) { m_taskBarButtons[i]->SetProgressValue(value); } -#endif // wxUSE_TASKBARBUTTON } void wxAppProgressIndicator::SetRange(int range) { m_maxValue = range; -#if wxUSE_TASKBARBUTTON + for ( size_t i = 0; i < m_taskBarButtons.size(); ++i ) { m_taskBarButtons[i]->SetProgressRange(range); } -#endif // wxUSE_TASKBARBUTTON } void wxAppProgressIndicator::Pulse() { -#if wxUSE_TASKBARBUTTON for ( size_t i = 0; i < m_taskBarButtons.size(); ++i ) { m_taskBarButtons[i]->PulseProgress(); } -#endif // wxUSE_TASKBARBUTTON } void wxAppProgressIndicator::Reset() { -#if wxUSE_TASKBARBUTTON for ( size_t i = 0; i < m_taskBarButtons.size(); ++i ) { m_taskBarButtons[i]->SetProgressState(wxTASKBAR_BUTTON_NO_PROGRESS); } -#endif // wxUSE_TASKBARBUTTON } + +#endif // wxUSE_TASKBARBUTTON