Move wxGenericAnimationCtrl::m_animation to the base class

API of wxAnimationCtrlBase practically forces the derived classes to
have such method, so just add it and make GetAnimation() a simple
non-virtual accessor.
This commit is contained in:
Vadim Zeitlin
2020-04-06 01:03:39 +02:00
parent b08db49bf6
commit 3678d67f92
4 changed files with 8 additions and 8 deletions

View File

@@ -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;