fixed CopyFromBitmap() for shared wxIcon objects by adding CloneRefData() implementation (patch 1026453)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29099 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -96,6 +96,8 @@ protected:
|
|||||||
return new wxIconRefData;
|
return new wxIconRefData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
|
||||||
|
|
||||||
// create from XPM data
|
// create from XPM data
|
||||||
void CreateIconFromXpm(const char **data);
|
void CreateIconFromXpm(const char **data);
|
||||||
|
|
||||||
|
@@ -102,6 +102,25 @@ wxIcon::~wxIcon()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxObjectRefData *wxIcon::CloneRefData(const wxObjectRefData *dataOrig) const
|
||||||
|
{
|
||||||
|
const wxIconRefData *
|
||||||
|
data = wx_static_cast(const wxIconRefData *, dataOrig);
|
||||||
|
if ( !data )
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
wxIcon *self = wx_const_cast(wxIcon *, this);
|
||||||
|
lf->UnRef();
|
||||||
|
lf->m_refData = new wxIconRefData(*data);
|
||||||
|
|
||||||
|
if ( data->m_hIcon )
|
||||||
|
{
|
||||||
|
::CopyIcon(HICON(data->m_hIcon));
|
||||||
|
}
|
||||||
|
|
||||||
|
return m_refData;
|
||||||
|
}
|
||||||
|
|
||||||
void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
|
void wxIcon::CopyFromBitmap(const wxBitmap& bmp)
|
||||||
{
|
{
|
||||||
#ifndef __WXMICROWIN__
|
#ifndef __WXMICROWIN__
|
||||||
|
Reference in New Issue
Block a user