Add conversion ctor from wxIcon to wxBitmapBundle too
Existing code may call functions taking wxBitmap with wxIcon, due to an existing conversion from wxIcon to wxBitmap, so we need to provide a similar conversion to wxBitmapBundle for compatibility.
This commit is contained in:
@@ -41,6 +41,9 @@ public:
|
|||||||
// using wxBitmap.
|
// using wxBitmap.
|
||||||
wxBitmapBundle(const wxBitmap& bitmap);
|
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
|
// 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
|
// passing wxImage to the functions that used to take wxBitmap but now take
|
||||||
// wxBitmapBundle.
|
// wxBitmapBundle.
|
||||||
|
@@ -108,6 +108,14 @@ public:
|
|||||||
*/
|
*/
|
||||||
wxBitmapBundle(const wxBitmap& bitmap);
|
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.
|
Conversion constructor from a single image.
|
||||||
|
|
||||||
|
@@ -22,6 +22,7 @@
|
|||||||
#endif // WX_PRECOMP
|
#endif // WX_PRECOMP
|
||||||
|
|
||||||
#include "wx/bmpbndl.h"
|
#include "wx/bmpbndl.h"
|
||||||
|
#include "wx/icon.h"
|
||||||
|
|
||||||
#include "wx/private/bmpbndl.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)
|
wxBitmapBundle::wxBitmapBundle(const wxImage& image)
|
||||||
: m_impl(image.IsOk() ? new wxBitmapBundleImplSet(wxBitmap(image)) : NULL)
|
: m_impl(image.IsOk() ? new wxBitmapBundleImplSet(wxBitmap(image)) : NULL)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user