// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#if wxUSE_IMAGLIST
+
#ifdef __BORLANDC__
#pragma hdrstop
#endif
return Add(wxBitmap(img));
}
-const wxBitmap *wxGenericImageList::GetBitmap( int index ) const
+const wxBitmap *wxGenericImageList::GetBitmapPtr( int index ) const
{
wxList::compatibility_iterator node = m_images.Item( index );
return (wxBitmap*)node->GetData();
}
+// Get the bitmap
+wxBitmap wxGenericImageList::GetBitmap(int index) const
+{
+ const wxBitmap* bmp = GetBitmapPtr(index);
+ if (bmp)
+ return *bmp;
+ else
+ return wxNullBitmap;
+}
+
+// Get the icon
+wxIcon wxGenericImageList::GetIcon(int index) const
+{
+ const wxBitmap* bmp = GetBitmapPtr(index);
+ if (bmp)
+ {
+ wxIcon icon;
+ icon.CopyFromBitmap(*bmp);
+ return icon;
+ }
+ else
+ return wxNullIcon;
+}
+
bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
{
wxList::compatibility_iterator node = m_images.Item( index );
return true;
}
+#endif // wxUSE_IMAGLIST
#endif // __WXPALMOS__