some fixes and a new mixin class added to the library

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10663 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-06-25 23:46:28 +00:00
parent bec0a26172
commit 6a1836a0a4
3 changed files with 55 additions and 9 deletions

View File

@@ -50,14 +50,15 @@ class MagicImageList:
'''Add an icon to the image list, or get the index if already there'''
index = self.__magicImageListMapping.get (id (icon))
if index is None:
if isinstance( icon, wxIcon ):
if isinstance( icon, wxIconPtr ):
index = self.__magicImageList.AddIcon( icon )
elif isinstance( icon, wxBitmap ):
elif isinstance( icon, wxBitmapPtr ):
if isinstance( mask, wxColour ):
index = self.__magicImageList.AddWithColourMask( icon, mask )
else:
index = self.__magicImageList.Add( icon, mask )
else:
print icon.__class__.__name__
raise ValueError("Unexpected icon object %s, "
"expected wxIcon or wxBitmap" % (icon))
self.__magicImageListMapping [id (icon)] = index