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:
@@ -101,7 +101,7 @@ public:
|
|||||||
wxAnimationType type = wxANIMATION_TYPE_ANY) = 0;
|
wxAnimationType type = wxANIMATION_TYPE_ANY) = 0;
|
||||||
|
|
||||||
virtual void SetAnimation(const wxAnimation &anim) = 0;
|
virtual void SetAnimation(const wxAnimation &anim) = 0;
|
||||||
virtual wxAnimation GetAnimation() const = 0;
|
wxAnimation GetAnimation() const { return m_animation; }
|
||||||
|
|
||||||
virtual bool Play() = 0;
|
virtual bool Play() = 0;
|
||||||
virtual void Stop() = 0;
|
virtual void Stop() = 0;
|
||||||
@@ -121,8 +121,11 @@ protected:
|
|||||||
virtual wxAnimationImpl* DoCreateAnimationImpl() const = 0;
|
virtual wxAnimationImpl* DoCreateAnimationImpl() const = 0;
|
||||||
|
|
||||||
// This method allows derived classes access to wxAnimation::GetImpl().
|
// This method allows derived classes access to wxAnimation::GetImpl().
|
||||||
wxAnimationImpl* GetAnimImpl(const wxAnimation& anim) const
|
wxAnimationImpl* GetAnimImpl() const
|
||||||
{ return anim.GetImpl(); }
|
{ return m_animation.GetImpl(); }
|
||||||
|
|
||||||
|
// The associated animation, possibly invalid/empty.
|
||||||
|
wxAnimation m_animation;
|
||||||
|
|
||||||
// the inactive bitmap as it was set by the user
|
// the inactive bitmap as it was set by the user
|
||||||
wxBitmap m_bmpStatic;
|
wxBitmap m_bmpStatic;
|
||||||
|
@@ -58,8 +58,6 @@ public:
|
|||||||
{ return m_isPlaying; }
|
{ return m_isPlaying; }
|
||||||
|
|
||||||
void SetAnimation(const wxAnimation &animation) wxOVERRIDE;
|
void SetAnimation(const wxAnimation &animation) wxOVERRIDE;
|
||||||
wxAnimation GetAnimation() const wxOVERRIDE
|
|
||||||
{ return m_animation; }
|
|
||||||
|
|
||||||
virtual void SetInactiveBitmap(const wxBitmap &bmp) wxOVERRIDE;
|
virtual void SetInactiveBitmap(const wxBitmap &bmp) wxOVERRIDE;
|
||||||
|
|
||||||
@@ -123,7 +121,6 @@ protected:
|
|||||||
unsigned int m_currentFrame; // Current frame
|
unsigned int m_currentFrame; // Current frame
|
||||||
bool m_looped; // Looped, or not
|
bool m_looped; // Looped, or not
|
||||||
wxTimer m_timer; // The timer
|
wxTimer m_timer; // The timer
|
||||||
wxAnimation m_animation; // The animation
|
|
||||||
|
|
||||||
bool m_isPlaying; // Is the animation playing?
|
bool m_isPlaying; // Is the animation playing?
|
||||||
bool m_useWinBackgroundColour; // Use animation bg colour or window bg colour?
|
bool m_useWinBackgroundColour; // Use animation bg colour or window bg colour?
|
||||||
|
@@ -623,7 +623,7 @@ void wxGenericAnimationCtrl::OnSize(wxSizeEvent &WXUNUSED(event))
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// helpers to safely access wxAnimationGenericImpl methods
|
// helpers to safely access wxAnimationGenericImpl methods
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
#define ANIMATION (static_cast<wxAnimationGenericImpl*>(GetAnimImpl(m_animation)))
|
#define ANIMATION (static_cast<wxAnimationGenericImpl*>(GetAnimImpl()))
|
||||||
|
|
||||||
wxPoint wxGenericAnimationCtrl::AnimationImplGetFramePosition(unsigned int frame) const
|
wxPoint wxGenericAnimationCtrl::AnimationImplGetFramePosition(unsigned int frame) const
|
||||||
{
|
{
|
||||||
|
@@ -473,7 +473,7 @@ void wxAnimationCtrl::OnTimer(wxTimerEvent& WXUNUSED(ev))
|
|||||||
|
|
||||||
|
|
||||||
// helpers to safely access wxAnimationGTKImpl methods
|
// helpers to safely access wxAnimationGTKImpl methods
|
||||||
#define ANIMATION (static_cast<wxAnimationGTKImpl*>(GetAnimImpl(m_animation)))
|
#define ANIMATION (static_cast<wxAnimationGTKImpl*>(GetAnimImpl()))
|
||||||
|
|
||||||
GdkPixbufAnimation* wxAnimationCtrl::AnimationImplGetPixbuf() const
|
GdkPixbufAnimation* wxAnimationCtrl::AnimationImplGetPixbuf() const
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user