X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/87138c520ce5dc4d0268191074866e8bc300c984..7b9da2077d0975db6c965a85c91d5aca671ab5e3:/src/generic/imaglist.cpp?ds=sidebyside diff --git a/src/generic/imaglist.cpp b/src/generic/imaglist.cpp index 0c41c5255d..8011b2b648 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, _T("wrong index in image list") ); + wxCHECK_MSG( node, (wxBitmap *) NULL, wxT("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, _T("wrong index in image list") ); + wxCHECK_MSG( node, FALSE, wxT("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, _T("wrong index in image list") ); + wxCHECK_MSG( node, FALSE, wxT("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, _T("wrong index in image list") ); + wxCHECK_MSG( node, FALSE, wxT("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, _T("wrong index in image list") ); + wxCHECK_MSG( node, FALSE, wxT("wrong index in image list") ); wxBitmap *bm = (wxBitmap*)node->Data();