allow loading wxAnimationCtrl contents from stream (patch 1962344)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53629 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
7bf2b0881a
commit
462167a9f7
@ -75,6 +75,8 @@ public:
|
||||
// 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;
|
||||
|
@ -97,6 +97,7 @@ public:
|
||||
|
||||
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()
|
||||
|
@ -113,6 +113,7 @@ public: // event handler
|
||||
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
|
||||
|
@ -123,6 +123,13 @@ public:
|
||||
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.
|
||||
|
||||
|
@ -307,10 +307,15 @@ wxAnimationCtrl::~wxAnimationCtrl()
|
||||
}
|
||||
|
||||
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);
|
||||
|
@ -232,9 +232,15 @@ wxAnimationCtrl::~wxAnimationCtrl()
|
||||
}
|
||||
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user