From 135c959fe7106455489a48e6817c64ee533e5719 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 6 Apr 2020 23:15:18 +0200 Subject: [PATCH] Fix wxRTTI for wxAnimationCtrl when using generic implementation It must use wxGenericAnimationCtrl as the base class in wxRTTI, as otherwise wxAnimation::IsCompatibleWith() would fail in this case for the generic implementation of wxAnimation. --- src/common/animatecmn.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/common/animatecmn.cpp b/src/common/animatecmn.cpp index 20eba7f317..9e74a365a9 100644 --- a/src/common/animatecmn.cpp +++ b/src/common/animatecmn.cpp @@ -43,7 +43,10 @@ wxIMPLEMENT_DYNAMIC_CLASS(wxAnimation, wxObject); #if !defined(wxHAS_NATIVE_ANIMATIONCTRL) // In this case the "native" ctrl is the generic ctrl. See wx/animate.h - wxIMPLEMENT_CLASS(wxAnimationCtrl, wxControl); + // Notice that it's important to use wxGenericAnimationCtrl here because + // wxAnimation::IsCompatibleWith() relies on control deriving from + // wxGenericAnimationCtrl when using generic wxAnimation implementation. + wxIMPLEMENT_CLASS(wxAnimationCtrl, wxGenericAnimationCtrl); #endif #include "wx/listimpl.cpp"