diff --git a/include/wx/bmpbndl.h b/include/wx/bmpbndl.h index 8e4d9f68ab..f5db5ab140 100644 --- a/include/wx/bmpbndl.h +++ b/include/wx/bmpbndl.h @@ -41,6 +41,9 @@ public: // using wxBitmap. wxBitmapBundle(const wxBitmap& bitmap); + // This is similar to above and also exists only for compatibility. + wxBitmapBundle(const wxIcon& icon); + // Another conversion ctor from a single image: this one is needed to allow // passing wxImage to the functions that used to take wxBitmap but now take // wxBitmapBundle. diff --git a/interface/wx/bmpbndl.h b/interface/wx/bmpbndl.h index bd9d4cb5e3..c17273ef04 100644 --- a/interface/wx/bmpbndl.h +++ b/interface/wx/bmpbndl.h @@ -108,6 +108,14 @@ public: */ wxBitmapBundle(const wxBitmap& bitmap); + /** + Conversion constructor from a single icon. + + This constructor does the same thing as FromBitmap() and only exists + for interoperability with the existing code using wxIcon. + */ + wxBitmapBundle(const wxIcon& icon); + /** Conversion constructor from a single image. diff --git a/src/common/bmpbndl.cpp b/src/common/bmpbndl.cpp index 61ed5f731e..0628b5ecd0 100644 --- a/src/common/bmpbndl.cpp +++ b/src/common/bmpbndl.cpp @@ -22,6 +22,7 @@ #endif // WX_PRECOMP #include "wx/bmpbndl.h" +#include "wx/icon.h" #include "wx/private/bmpbndl.h" @@ -257,6 +258,11 @@ wxBitmapBundle::wxBitmapBundle(const wxBitmap& bitmap) { } +wxBitmapBundle::wxBitmapBundle(const wxIcon& icon) + : m_impl(icon.IsOk() ? new wxBitmapBundleImplSet(wxBitmap(icon)) : NULL) +{ +} + wxBitmapBundle::wxBitmapBundle(const wxImage& image) : m_impl(image.IsOk() ? new wxBitmapBundleImplSet(wxBitmap(image)) : NULL) {