X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/580ca0a4e10dbd2fb0a144065004394b9d5dcc56..4e0a055757f928dce8c53b8e4cb60a699ab43e07:/include/wx/animate.h?ds=sidebyside diff --git a/include/wx/animate.h b/include/wx/animate.h index d228b37f19..bf25d5aa2e 100644 --- a/include/wx/animate.h +++ b/include/wx/animate.h @@ -9,8 +9,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef _WX_ANIMATEH__ -#define _WX_ANIMATEH__ +#ifndef _WX_ANIMATE_H_ +#define _WX_ANIMATE_H_ #include "wx/defs.h" @@ -39,14 +39,16 @@ public: virtual bool IsOk() const = 0; // can be -1 - virtual int GetDelay(size_t i) const = 0; + virtual int GetDelay(unsigned int frame) const = 0; - virtual size_t GetFrameCount() const = 0; - virtual wxImage GetFrame(size_t i) const = 0; + virtual unsigned int GetFrameCount() const = 0; + virtual wxImage GetFrame(unsigned int frame) const = 0; virtual wxSize GetSize() const = 0; - virtual bool LoadFile(const wxString &name, wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; - virtual bool Load(wxInputStream &stream, wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; + virtual bool LoadFile(const wxString& name, + wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; + virtual bool Load(wxInputStream& stream, + wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; protected: DECLARE_ABSTRACT_CLASS(wxAnimationBase) @@ -68,11 +70,11 @@ protected: class WXDLLIMPEXP_ADV wxAnimationCtrlBase : public wxControl { public: - wxAnimationCtrlBase() {} + wxAnimationCtrlBase() { } -public: // public API - - virtual bool LoadFile(const wxString& filename, wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; + // public API + virtual bool LoadFile(const wxString& filename, + wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; virtual void SetAnimation(const wxAnimation &anim) = 0; virtual wxAnimation GetAnimation() const = 0; @@ -82,13 +84,26 @@ public: // public API virtual bool IsPlaying() const = 0; - virtual void SetInactiveBitmap(const wxBitmap &bmp) = 0; + virtual void SetInactiveBitmap(const wxBitmap &bmp); + + // always return the original bitmap set in this control wxBitmap GetInactiveBitmap() const { return m_bmpStatic; } protected: + // the inactive bitmap as it was set by the user wxBitmap m_bmpStatic; + // the inactive bitmap currently shown in the control + // (may differ in the size from m_bmpStatic) + wxBitmap m_bmpStaticReal; + + // updates m_bmpStaticReal from m_bmpStatic if needed + virtual void UpdateStaticImage(); + + // called by SetInactiveBitmap + virtual void DisplayStaticImage() = 0; + private: DECLARE_ABSTRACT_CLASS(wxAnimationCtrlBase) }; @@ -104,6 +119,6 @@ private: #include "wx/generic/animate.h" #endif -#endif // wxUSE_ANIMATIONCTRL +#endif // wxUSE_ANIMATIONCTRL -#endif // _WX_ANIMATEH__ +#endif // _WX_ANIMATE_H_