X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ffecfa5aeb540b54914739dbb8603edbbd4c00a0..8f98c6c007769184f28dfb9dcd97075bd0efeddc:/src/generic/imaglist.cpp diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 8c7f6898d3..54e53a6200 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -7,8 +7,6 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// -#ifndef __PALMOS__ - #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "imaglist.h" #endif @@ -20,7 +18,12 @@ #pragma hdrstop #endif +#include "wx/defs.h" + +#ifndef __WXPALMOS__ + #include "wx/generic/imaglist.h" + #include "wx/icon.h" #include "wx/image.h" #include "wx/dc.h" @@ -70,8 +73,8 @@ bool wxGenericImageList::Create() int wxGenericImageList::Add( const wxBitmap &bitmap ) { - wxASSERT_MSG( bitmap.GetWidth() == m_width && - bitmap.GetHeight() == m_height, + wxASSERT_MSG( (bitmap.GetWidth() == m_width && bitmap.GetHeight() == m_height) + || (m_width == 0 && m_height == 0), _T("invalid bitmap size in wxImageList: this might work ") _T("on this platform but definitely won't under Windows.") ); @@ -79,6 +82,13 @@ int wxGenericImageList::Add( const wxBitmap &bitmap ) m_images.Append( new wxIcon( (const wxIcon&) bitmap ) ); else m_images.Append( new wxBitmap(bitmap) ); + + if (m_width == 0 && m_height == 0) + { + m_width = bitmap.GetWidth(); + m_height = bitmap.GetHeight(); + } + return m_images.GetCount()-1; } @@ -192,4 +202,4 @@ bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y, return true; } -#endif // __PALMOS__ +#endif // __WXPALMOS__