// public API
virtual bool LoadFile(const wxString& filename,
wxAnimationType type = wxANIMATION_TYPE_ANY) = 0;
+ virtual bool Load(wxInputStream& stream,
+ wxAnimationType type = wxANIMATION_TYPE_ANY) = 0;
virtual void SetAnimation(const wxAnimation &anim) = 0;
virtual wxAnimation GetAnimation() const = 0;
public:
virtual bool LoadFile(const wxString& filename, wxAnimationType type = wxANIMATION_TYPE_ANY);
+ virtual bool Load(wxInputStream& stream, wxAnimationType type = wxANIMATION_TYPE_ANY);
virtual void Stop();
virtual bool Play()
public: // public API
virtual bool LoadFile(const wxString& filename, wxAnimationType type = wxANIMATION_TYPE_ANY);
+ virtual bool Load(wxInputStream& stream, wxAnimationType type = wxANIMATION_TYPE_ANY);
virtual void SetAnimation(const wxAnimation &anim);
virtual wxAnimation GetAnimation() const
virtual bool LoadFile(const wxString& file,
wxAnimationType animType = wxANIMATION_TYPE_ANY);
+ /**
+ Loads the animation from the given stream and calls SetAnimation().
+ See wxAnimation::Load() for more info.
+ */
+ virtual bool Load(wxInputStream& file,
+ wxAnimationType animType = wxANIMATION_TYPE_ANY);
+
/**
Starts playing the animation.
}
bool wxAnimationCtrl::LoadFile(const wxString& filename, wxAnimationType type)
+{
+ wxFileInputStream fis(filename);
+ return Load(fis, type);
+}
+
+bool wxAnimationCtrl::Load(wxInputStream& stream, wxAnimationType type)
{
wxAnimation anim;
- if (!anim.LoadFile(filename, type) ||
- !anim.IsOk())
+ if ( !anim.Load(stream, type) || !anim.IsOk() )
return false;
SetAnimation(anim);
}
bool wxAnimationCtrl::LoadFile(const wxString &filename, wxAnimationType type)
+{
+ wxFileInputStream fis(filename);
+ return Load(fis, type);
+}
+
+bool wxAnimationCtrl::Load(wxInputStream& stream, wxAnimationType type)
{
wxAnimation anim;
- if (!anim.LoadFile(filename, type))
+ if ( !anim.Load(stream, type) || !anim.IsOk() )
return false;
SetAnimation(anim);