[ 1581391 ] wxAnimationCtrl XRC handler
(most of) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42196 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1139,6 +1139,39 @@ wxBitmap wxXmlResourceHandler::GetBitmap(const wxString& param,
|
||||
return wxBitmap(img);
|
||||
}
|
||||
|
||||
#if wxUSE_ANIMATIONCTRL
|
||||
wxAnimation wxXmlResourceHandler::GetAnimation(const wxString& param)
|
||||
{
|
||||
wxAnimation ani;
|
||||
|
||||
/* load the animation from file: */
|
||||
wxString name = GetParamValue(param);
|
||||
if (name.empty()) return wxNullAnimation;
|
||||
#if wxUSE_FILESYSTEM
|
||||
wxFSFile *fsfile = GetCurFileSystem().OpenFile(name);
|
||||
if (fsfile == NULL)
|
||||
{
|
||||
wxLogError(_("XRC resource: Cannot create animation from '%s'."),
|
||||
name.c_str());
|
||||
return wxNullAnimation;
|
||||
}
|
||||
ani.Load(*(fsfile->GetStream()));
|
||||
delete fsfile;
|
||||
#else
|
||||
ani.LoadFile(name);
|
||||
#endif
|
||||
|
||||
if (!ani.IsOk())
|
||||
{
|
||||
wxLogError(_("XRC resource: Cannot create animation from '%s'."),
|
||||
name.c_str());
|
||||
return wxNullAnimation;
|
||||
}
|
||||
|
||||
return ani;
|
||||
}
|
||||
#endif // wxUSE_ANIMATIONCTRL
|
||||
|
||||
|
||||
|
||||
wxIcon wxXmlResourceHandler::GetIcon(const wxString& param,
|
||||
|
Reference in New Issue
Block a user