Merge branch 'xrc-generic-animation-ctrl'

Extend wxAnimationCtrl XRC handler to cover wxGenericAnimationCtrl too.

Also fix a bug with wxGenericAnimationCtrl inactive bitmap background.

See https://github.com/wxWidgets/wxWidgets/pull/1889
This commit is contained in:
Vadim Zeitlin
2020-06-10 00:02:59 +02:00
26 changed files with 137 additions and 200 deletions

View File

@@ -139,6 +139,10 @@ public:
WXDisplay *GetDisplay() const;
// This is provided only for compatibility with the other ports, there is
// no alpha support in X11 bitmaps.
bool HasAlpha() const { return false; }
protected:
virtual wxGDIRefData *CreateGDIRefData() const;
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const;

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.
@@ -603,7 +605,7 @@ public:
// Gets a file path from the given node, expanding environment variables in
// it if wxXRC_USE_ENVVARS is in use.
wxString GetFilePath(const wxXmlNode* node);
wxString GetFilePath(const wxXmlNode* node) wxOVERRIDE;
// Returns the window associated with the handler (may be NULL).
wxWindow* GetParentAsWindow() const { return m_handler->GetParentAsWindow(); }

View File

@@ -22,6 +22,7 @@
#include "wx/window.h"
class WXDLLIMPEXP_FWD_CORE wxAnimation;
class WXDLLIMPEXP_FWD_CORE wxAnimationCtrlBase;
class WXDLLIMPEXP_FWD_XML wxXmlNode;
class WXDLLIMPEXP_FWD_XML wxXmlResource;
@@ -100,11 +101,13 @@ public:
virtual wxImageList *GetImageList(const wxString& param = wxT("imagelist")) = 0;
#if wxUSE_ANIMATIONCTRL
virtual wxAnimation* GetAnimation(const wxString& param = wxT("animation")) = 0;
virtual wxAnimation* GetAnimation(const wxString& param = wxT("animation"),
wxAnimationCtrlBase* ctrl = NULL) = 0;
#endif
virtual wxFont GetFont(const wxString& param = wxT("font"), wxWindow* parent = NULL) = 0;
virtual bool GetBoolAttr(const wxString& attr, bool defaultv) = 0;
virtual wxString GetFilePath(const wxXmlNode* node) = 0;
virtual void SetupWindow(wxWindow *wnd) = 0;
virtual void CreateChildren(wxObject *parent, bool this_hnd_only = false) = 0;
virtual void CreateChildrenPrivately(wxObject *parent,
@@ -352,9 +355,10 @@ protected:
}
#if wxUSE_ANIMATIONCTRL
wxAnimation* GetAnimation(const wxString& param = wxT("animation"))
wxAnimation* GetAnimation(const wxString& param = wxT("animation"),
wxAnimationCtrlBase* ctrl = NULL)
{
return GetImpl()->GetAnimation(param);
return GetImpl()->GetAnimation(param, ctrl);
}
#endif
@@ -367,6 +371,10 @@ protected:
{
return GetImpl()->GetBoolAttr(attr, defaultv);
}
wxString GetFilePath(const wxXmlNode* node)
{
return GetImpl()->GetFilePath(node);
}
void SetupWindow(wxWindow *wnd)
{
GetImpl()->SetupWindow(wnd);