// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "imaglist.h"
#endif
IMPLEMENT_DYNAMIC_CLASS(wxGenericImageList, wxObject)
-#if !defined(__WXMSW__) || defined(__WIN16__) || defined(__WXUNIVERSAL__)
+#if !defined(__WXMSW__) || defined(__WXUNIVERSAL__)
/*
* wxImageList has to be a real class or we have problems with
* the run-time information.
wxGenericImageList::~wxGenericImageList()
{
+ (void)RemoveAll();
}
int wxGenericImageList::GetImageCount() const
int wxGenericImageList::Add( const wxBitmap &bitmap )
{
+ wxASSERT_MSG( bitmap.GetWidth() == m_width &&
+ bitmap.GetHeight() == m_height,
+ _T("invalid bitmap size in wxImageList: this might work ")
+ _T("on this platform but definitely won't under Windows.") );
+
if (bitmap.IsKindOf(CLASSINFO(wxIcon)))
m_images.Append( new wxIcon( (const wxIcon&) bitmap ) );
else
wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") );
- wxBitmap* newBitmap = NULL;
- if (bitmap.IsKindOf(CLASSINFO(wxIcon)))
-#if defined(__VISAGECPP__)
-//just can't do this in VisualAge now, with all this new Bitmap-Icon stuff
-//so construct it from a bitmap object until I can figure this nonsense out. (DW)
- newBitmap = new wxBitmap(bitmap) ;
-#else
- newBitmap = new wxBitmap( (const wxIcon&) bitmap );
-#endif
- else
- newBitmap = new wxBitmap(bitmap) ;
+ wxBitmap* newBitmap = (bitmap.IsKindOf(CLASSINFO(wxIcon))) ?
+ #if defined(__VISAGECPP__)
+ //just can't do this in VisualAge now, with all this new Bitmap-Icon stuff
+ //so construct it from a bitmap object until I can figure this nonsense out. (DW)
+ new wxBitmap(bitmap)
+ #else
+ new wxBitmap( (const wxIcon&) bitmap )
+ #endif
+ : new wxBitmap(bitmap) ;
if (index == (int) m_images.GetCount() - 1)
{