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

@@ -542,8 +542,15 @@ protected:
/**
Creates an animation (see wxAnimation) from the filename specified in @a param.
It is recommended to provide @a ctrl argument to this function (which
is only available in wxWidgets 3.1.4 or later) to make sure that the
created animation is compatible with the specified control, otherwise a
wxAnimation object compatible with the default wxAnimationCtrl
implementation is created.
*/
wxAnimation* GetAnimation(const wxString& param = "animation");
wxAnimation* GetAnimation(const wxString& param = "animation",
wxAnimationCtrlBase* ctrl = NULL);
/**
Gets a bitmap.