X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/aaf7ab431b85d817af39d1a19b6d392ff5bd9379..4bc0f25ed7eefb4a6fbeb61189a4c12023b9730f:/src/msw/icon.cpp diff --git a/src/msw/icon.cpp b/src/msw/icon.cpp index 74460dff34..564a07d875 100644 --- a/src/msw/icon.cpp +++ b/src/msw/icon.cpp @@ -17,7 +17,7 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "icon.h" #endif @@ -95,13 +95,32 @@ wxIcon::wxIcon(const wxIconLocation& loc) } //else: 0 is default - LoadFile(fullname); + LoadFile(fullname, wxBITMAP_TYPE_ICO); } 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); + self->UnRef(); + self->m_refData = new wxIconRefData(*data); + + if ( data->m_hIcon ) + { + ::CopyIcon(HICON(data->m_hIcon)); + } + + return m_refData; +} + void wxIcon::CopyFromBitmap(const wxBitmap& bmp) { #ifndef __WXMICROWIN__ @@ -135,7 +154,7 @@ bool wxIcon::LoadFile(const wxString& filename, if ( !handler ) { // say something? - return FALSE; + return false; } return handler->Load(this, filename, type, desiredWidth, desiredHeight);