Added GetBitmap, GetIcon to wxImageList
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32400 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -107,7 +107,7 @@ int wxGenericImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour
|
||||
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 );
|
||||
|
||||
@@ -116,6 +116,30 @@ const wxBitmap *wxGenericImageList::GetBitmap( int index ) const
|
||||
return (wxBitmap*)node->GetData();
|
||||
}
|
||||
|
||||
// Get the bitmap
|
||||
wxBitmap wxImageList::GetBitmap(int index) const
|
||||
{
|
||||
const wxBitmap* bmp = GetBitmapPtr(index);
|
||||
if (bmp)
|
||||
return *bmp;
|
||||
else
|
||||
return wxNullBitmap;
|
||||
}
|
||||
|
||||
// Get the icon
|
||||
wxIcon wxImageList::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 );
|
||||
|
Reference in New Issue
Block a user