diff --git a/include/wx/animate.h b/include/wx/animate.h index ac50ddc2f6..d8d5e956ad 100644 --- a/include/wx/animate.h +++ b/include/wx/animate.h @@ -101,7 +101,7 @@ public: wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; virtual void SetAnimation(const wxAnimation &anim) = 0; - virtual wxAnimation GetAnimation() const = 0; + wxAnimation GetAnimation() const { return m_animation; } virtual bool Play() = 0; virtual void Stop() = 0; @@ -121,8 +121,11 @@ protected: virtual wxAnimationImpl* DoCreateAnimationImpl() const = 0; // This method allows derived classes access to wxAnimation::GetImpl(). - wxAnimationImpl* GetAnimImpl(const wxAnimation& anim) const - { return anim.GetImpl(); } + wxAnimationImpl* GetAnimImpl() const + { return m_animation.GetImpl(); } + + // The associated animation, possibly invalid/empty. + wxAnimation m_animation; // the inactive bitmap as it was set by the user wxBitmap m_bmpStatic; diff --git a/include/wx/generic/animate.h b/include/wx/generic/animate.h index d8ed6799e9..7de8ac8190 100644 --- a/include/wx/generic/animate.h +++ b/include/wx/generic/animate.h @@ -58,8 +58,6 @@ public: { return m_isPlaying; } void SetAnimation(const wxAnimation &animation) wxOVERRIDE; - wxAnimation GetAnimation() const wxOVERRIDE - { return m_animation; } virtual void SetInactiveBitmap(const wxBitmap &bmp) wxOVERRIDE; @@ -123,7 +121,6 @@ protected: unsigned int m_currentFrame; // Current frame bool m_looped; // Looped, or not wxTimer m_timer; // The timer - wxAnimation m_animation; // The animation bool m_isPlaying; // Is the animation playing? bool m_useWinBackgroundColour; // Use animation bg colour or window bg colour? diff --git a/src/generic/animateg.cpp b/src/generic/animateg.cpp index 4947b064dd..ea772ac1eb 100644 --- a/src/generic/animateg.cpp +++ b/src/generic/animateg.cpp @@ -623,7 +623,7 @@ void wxGenericAnimationCtrl::OnSize(wxSizeEvent &WXUNUSED(event)) // ---------------------------------------------------------------------------- // helpers to safely access wxAnimationGenericImpl methods // ---------------------------------------------------------------------------- -#define ANIMATION (static_cast(GetAnimImpl(m_animation))) +#define ANIMATION (static_cast(GetAnimImpl())) wxPoint wxGenericAnimationCtrl::AnimationImplGetFramePosition(unsigned int frame) const { diff --git a/src/gtk/animate.cpp b/src/gtk/animate.cpp index b8662acd86..d6e17a4f70 100644 --- a/src/gtk/animate.cpp +++ b/src/gtk/animate.cpp @@ -473,7 +473,7 @@ void wxAnimationCtrl::OnTimer(wxTimerEvent& WXUNUSED(ev)) // helpers to safely access wxAnimationGTKImpl methods -#define ANIMATION (static_cast(GetAnimImpl(m_animation))) +#define ANIMATION (static_cast(GetAnimImpl())) GdkPixbufAnimation* wxAnimationCtrl::AnimationImplGetPixbuf() const {