Use GetAnimation() in wxAnimationCtrlXmlHandler again

This function basically only exists in order to be used in this handler,
so extend it to allow doing it by adding wxAnimationCtrlBase argument to
it, allowing it to create wxAnimation object compatible with the given
control.

This reduces code duplication and, incidentally, makes GetAnimation()
more useful for any user-defined XRC handlers.
This commit is contained in:
Vadim Zeitlin
2020-06-09 18:05:00 +02:00
parent 2c4b0b4271
commit 8ff6fa6f54
4 changed files with 25 additions and 39 deletions

View File

@@ -591,8 +591,10 @@ public:
wxImageList *GetImageList(const wxString& param = wxT("imagelist")) wxOVERRIDE;
#if wxUSE_ANIMATIONCTRL
// Gets an animation.
wxAnimation* GetAnimation(const wxString& param = wxT("animation")) wxOVERRIDE;
// Gets an animation creating it using the provided control (so that it
// will be compatible with it) if any.
wxAnimation* GetAnimation(const wxString& param = wxT("animation"),
wxAnimationCtrlBase* ctrl = NULL) wxOVERRIDE;
#endif
// Gets a font.