X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f60d0f944a6ce86bce59901e7ea3811f0992bce7..4df78dc36e933fb1c3aa7c9d7ae2757a898ae05c:/src/generic/imaglist.cpp diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index b0dc6594c7..e6dcbfd926 100644 --- a/src/generic/imaglist.cpp +++ b/src/generic/imaglist.cpp @@ -19,6 +19,7 @@ #endif #include "wx/generic/imaglist.h" +#include "wx/icon.h" //----------------------------------------------------------------------------- // wxImageList @@ -54,14 +55,14 @@ int wxImageList::Add( const wxBitmap &bitmap ) m_images.Append( new wxIcon( (const wxIcon&) bitmap ) ); else m_images.Append( new wxBitmap(bitmap) ); - return m_images.Number(); + return m_images.Number()-1; } const wxBitmap *wxImageList::GetBitmap( int index ) const { wxNode *node = m_images.Nth( index ); - wxCHECK_MSG( node, (wxBitmap *) NULL, "wrong index in image list" ); + wxCHECK_MSG( node, (wxBitmap *) NULL, _T("wrong index in image list") ); return (wxBitmap*)node->Data(); } @@ -70,7 +71,7 @@ bool wxImageList::Replace( int index, const wxBitmap &bitmap ) { wxNode *node = m_images.Nth( index ); - wxCHECK_MSG( node, FALSE, "wrong index in image list" ); + wxCHECK_MSG( node, FALSE, _T("wrong index in image list") ); wxBitmap* newBitmap = NULL; if (bitmap.IsKindOf(CLASSINFO(wxIcon))) @@ -97,7 +98,7 @@ bool wxImageList::Remove( int index ) { wxNode *node = m_images.Nth( index ); - wxCHECK_MSG( node, FALSE, "wrong index in image list" ); + wxCHECK_MSG( node, FALSE, _T("wrong index in image list") ); m_images.DeleteNode( node ); @@ -118,7 +119,7 @@ bool wxImageList::GetSize( int index, int &width, int &height ) const wxNode *node = m_images.Nth( index ); - wxCHECK_MSG( node, FALSE, "wrong index in image list" ); + wxCHECK_MSG( node, FALSE, _T("wrong index in image list") ); wxBitmap *bm = (wxBitmap*)node->Data(); width = bm->GetWidth(); @@ -132,7 +133,7 @@ bool wxImageList::Draw( int index, wxDC &dc, int x, int y, { wxNode *node = m_images.Nth( index ); - wxCHECK_MSG( node, FALSE, "wrong index in image list" ); + wxCHECK_MSG( node, FALSE, _T("wrong index in image list") ); wxBitmap *bm = (wxBitmap*)node->Data();