From c5ee5b8ea7e1fb8c86628973ee835179ea1591b7 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 20 Sep 2014 22:07:37 +0000 Subject: [PATCH] Don't use wxMSW wxAppProgressIndicator if wxUSE_TASKBARBUTTON==0. This class requires wxTaskBarButton to be really implemented, so there is no need to even define the MSW-specific version of it if wxUSE_TASKBARBUTTON is 0 anyhow. This fixes a compilation problem with wxUSE_TASKBARBUTTON==0 but, more importantly, just makes more sense. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/appprogress.h | 2 +- include/wx/msw/appprogress.h | 2 -- src/msw/appprogress.cpp | 17 +++++------------ 3 files changed, 6 insertions(+), 15 deletions(-) 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