return index of first added image in Add(), like MSW does, #10013

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@58031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2009-01-12 05:39:04 +00:00
parent 7ab97504f3
commit ec88b74105

View File

@@ -2,7 +2,7 @@
// Name: src/generic/imaglist.cpp // Name: src/generic/imaglist.cpp
// Purpose: // Purpose:
// Author: Robert Roebling // Author: Robert Roebling
// Id: $id$ // Id: $Id$
// Copyright: (c) 1998 Robert Roebling // Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
@@ -68,6 +68,8 @@ int wxGenericImageList::Add( const wxBitmap &bitmap )
_T("invalid bitmap size in wxImageList: this might work ") _T("invalid bitmap size in wxImageList: this might work ")
_T("on this platform but definitely won't under Windows.") ); _T("on this platform but definitely won't under Windows.") );
const int index = int(m_images.GetCount());
if (bitmap.IsKindOf(CLASSINFO(wxIcon))) if (bitmap.IsKindOf(CLASSINFO(wxIcon)))
{ {
m_images.Append( new wxIcon( (const wxIcon&) bitmap ) ); m_images.Append( new wxIcon( (const wxIcon&) bitmap ) );
@@ -98,7 +100,7 @@ int wxGenericImageList::Add( const wxBitmap &bitmap )
m_height = bitmap.GetHeight(); m_height = bitmap.GetHeight();
} }
return m_images.GetCount()-1; return index;
} }
int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask ) int wxGenericImageList::Add( const wxBitmap& bitmap, const wxBitmap& mask )