[ 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:
Robert Roebling
2006-10-21 13:59:25 +00:00
parent 8e458bb539
commit 9e29cd0a28
7 changed files with 134 additions and 0 deletions

View File

@@ -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,