X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3db7c3b1aa4159d330a93be4b5d156e1f06b0f39..0f660b35d96f39c6b43be7ede9c30a7f4fc96451:/interface/animate.h diff --git a/interface/animate.h b/interface/animate.h index 3631671843..7fb3a9a3d5 100644 --- a/interface/animate.h +++ b/interface/animate.h @@ -62,19 +62,19 @@ public: all the parameters. */ wxAnimationCtrl(wxWindow* parent, wxWindowID id, - const wxAnimation& anim, + const wxAnimation& anim = wxNullAnimation, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxAC_DEFAULT_STYLE, - const wxString& name = "animationctrl"); + const wxString& name = wxAnimationCtrlNameStr); /** Creates the control with the given @a anim animation. - + After control creation you must explicitely call Play() to start to play the animation. Until that function won't be called, the first frame of the animation is displayed. - + @param parent Parent window, must be non-@NULL. @param id @@ -89,21 +89,21 @@ public: The window style, see wxAC_* flags. @param name Control name. - + @returns @true if the control was successfully created or @false if creation failed. */ bool Create(wxWindow* parent, wxWindowID id, - const wxAnimation& anim, + const wxAnimation& anim = wxNullAnimation, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxAC_DEFAULT_STYLE, - const wxString& name = "animationctrl"); + const wxString& name = wxAnimationCtrlNameStr); /** Returns the animation associated with this control. */ - wxAnimation GetAnimation() const; + virtual wxAnimation GetAnimation() const; /** Returns the inactive bitmap shown in this control when the; @@ -114,14 +114,14 @@ public: /** Returns @true if the animation is being played. */ - bool IsPlaying() const; + virtual bool IsPlaying() const; /** Loads the animation from the given file and calls SetAnimation(). See wxAnimation::LoadFile for more info. */ - bool LoadFile(const wxString& file, - wxAnimationType animType = wxANIMATION_TYPE_ANY); + virtual bool LoadFile(const wxString& file, + wxAnimationType animType = wxANIMATION_TYPE_ANY); /** Starts playing the animation. @@ -130,7 +130,7 @@ public: animation has an infinite delay time) and always start from the first frame even if you @ref Stop "stopped" it while some other frame was displayed. */ - bool Play(); + virtual bool Play(); /** Sets the animation to play in this control. @@ -140,7 +140,7 @@ public: animation or the background colour will be shown (see SetInactiveBitmap() for more info). */ - void SetAnimation(const wxAnimation& anim); + virtual void SetAnimation(const wxAnimation& anim); /** Sets the bitmap to show on the control when it's not playing an animation. @@ -156,21 +156,20 @@ public: Note that the inactive bitmap, if smaller than the control's size, will be centered in the control; if bigger, it will be stretched to fit it. */ - void SetInactiveBitmap(const wxBitmap& bmp); + virtual void SetInactiveBitmap(const wxBitmap& bmp); /** Stops playing the animation. The control will show the first frame of the animation, a custom static image or the window's background colour as specified by the last SetInactiveBitmap() call. */ - void Stop(); + virtual void Stop(); }; /** @class wxAnimation - @ingroup group_class_gdi @wxheader{animate.h} This class encapsulates the concept of a platform-dependent animation. @@ -188,12 +187,14 @@ public: class wxAnimation : public wxGDIObject { public: - wxAnimation(); + /** + Copy ctor. + */ wxAnimation(const wxAnimation& anim); /** Loads an animation from a file. - + @param name The name of the file to load. @param type @@ -206,37 +207,37 @@ public: Destructor. See @ref overview_refcount_destruct for more info. */ - ~wxAnimation(); + virtual ~wxAnimation(); /** Returns the delay for the i-th frame in milliseconds. If @c -1 is returned the frame is to be displayed forever. */ - int GetDelay(unsigned int i) const; + virtual int GetDelay(unsigned int i) const; /** Returns the i-th frame as a wxImage. */ - wxImage GetFrame(unsigned int i) const; + virtual wxImage GetFrame(unsigned int i) const; /** Returns the number of frames for this animation. */ - unsigned int GetFrameCount() const; + virtual unsigned int GetFrameCount() const; /** Returns the size of the animation. */ - wxSize GetSize() const; + virtual wxSize GetSize() const; /** Returns @true if animation data is present. */ - bool IsOk() const; + virtual bool IsOk() const; /** Loads an animation from the given stream. - + @param stream The stream to use to load the animation. @param type @@ -244,32 +245,37 @@ public: @li wxANIMATION_TYPE_GIF: loads an animated GIF file; @li wxANIMATION_TYPE_ANI: load an ANI file; @li wxANIMATION_TYPE_ANY: tries to autodetect the filetype. - + @returns @true if the operation succeeded, @false otherwise. */ - bool Load(wxInputStream& stream, - wxAnimationType type = wxANIMATION_TYPE_ANY); + virtual bool Load(wxInputStream& stream, + wxAnimationType type = wxANIMATION_TYPE_ANY); /** Loads an animation from a file. - + @param name A filename. @param type One of the wxAnimationType values; wxANIMATION_TYPE_ANY means that the function should try to autodetect the filetype. - + @returns @true if the operation succeeded, @false otherwise. */ - bool LoadFile(const wxString& name, - wxAnimationType type = wxANIMATION_TYPE_ANY); + virtual bool LoadFile(const wxString& name, + wxAnimationType type = wxANIMATION_TYPE_ANY); /** Assignment operator, using @ref overview_refcount "reference counting". */ - wxAnimation operator =(const wxAnimation& brush); + wxAnimation& operator =(const wxAnimation& brush); }; + +// ============================================================================ +// Global functions/macros +// ============================================================================ + /** An empty animation object. */