Make wxImageList not copiable (fixes #10503), replace wxList with wxObjectList

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59036 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2009-02-19 20:26:00 +00:00
parent 668674c1e2
commit a1abd1a923
3 changed files with 12 additions and 12 deletions

View File

@@ -49,12 +49,12 @@ public:
// Internal use only // Internal use only
const wxBitmap *GetBitmapPtr(int index) const; const wxBitmap *GetBitmapPtr(int index) const;
private: private:
wxList m_images; wxObjectList m_images;
int m_width; int m_width;
int m_height; int m_height;
DECLARE_DYNAMIC_CLASS(wxGenericImageList) DECLARE_DYNAMIC_CLASS_NO_COPY(wxGenericImageList)
}; };
#ifndef wxHAS_NATIVE_IMAGELIST #ifndef wxHAS_NATIVE_IMAGELIST

View File

@@ -199,7 +199,7 @@ public:
protected: protected:
WXHIMAGELIST m_hImageList; WXHIMAGELIST m_hImageList;
DECLARE_DYNAMIC_CLASS(wxImageList) DECLARE_DYNAMIC_CLASS_NO_COPY(wxImageList)
}; };
#endif #endif

View File

@@ -120,7 +120,7 @@ int wxGenericImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour
const wxBitmap *wxGenericImageList::GetBitmapPtr( int index ) const const wxBitmap *wxGenericImageList::GetBitmapPtr( int index ) const
{ {
wxList::compatibility_iterator node = m_images.Item( index ); wxObjectList::compatibility_iterator node = m_images.Item( index );
wxCHECK_MSG( node, NULL, wxT("wrong index in image list") ); wxCHECK_MSG( node, NULL, wxT("wrong index in image list") );
@@ -153,7 +153,7 @@ wxIcon wxGenericImageList::GetIcon(int index) const
bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap ) bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
{ {
wxList::compatibility_iterator node = m_images.Item( index ); wxObjectList::compatibility_iterator node = m_images.Item( index );
wxCHECK_MSG( node, false, wxT("wrong index in image list") ); wxCHECK_MSG( node, false, wxT("wrong index in image list") );
@@ -175,7 +175,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
} }
else else
{ {
wxList::compatibility_iterator next = node->GetNext(); wxObjectList::compatibility_iterator next = node->GetNext();
delete node->GetData(); delete node->GetData();
m_images.Erase( node ); m_images.Erase( node );
m_images.Insert( next, newBitmap ); m_images.Insert( next, newBitmap );
@@ -186,7 +186,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap )
bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask ) bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap, const wxBitmap &mask )
{ {
wxList::compatibility_iterator node = m_images.Item( index ); wxObjectList::compatibility_iterator node = m_images.Item( index );
wxCHECK_MSG( node, false, wxT("wrong index in image list") ); wxCHECK_MSG( node, false, wxT("wrong index in image list") );
@@ -208,7 +208,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap, const wxBit
} }
else else
{ {
wxList::compatibility_iterator next = node->GetNext(); wxObjectList::compatibility_iterator next = node->GetNext();
delete node->GetData(); delete node->GetData();
m_images.Erase( node ); m_images.Erase( node );
m_images.Insert( next, newBitmap ); m_images.Insert( next, newBitmap );
@@ -222,7 +222,7 @@ bool wxGenericImageList::Replace( int index, const wxBitmap &bitmap, const wxBit
bool wxGenericImageList::Remove( int index ) bool wxGenericImageList::Remove( int index )
{ {
wxList::compatibility_iterator node = m_images.Item( index ); wxObjectList::compatibility_iterator node = m_images.Item( index );
wxCHECK_MSG( node, false, wxT("wrong index in image list") ); wxCHECK_MSG( node, false, wxT("wrong index in image list") );
@@ -234,7 +234,7 @@ bool wxGenericImageList::Remove( int index )
bool wxGenericImageList::RemoveAll() bool wxGenericImageList::RemoveAll()
{ {
WX_CLEAR_LIST(wxList, m_images); WX_CLEAR_LIST(wxObjectList, m_images);
m_images.Clear(); m_images.Clear();
return true; return true;
@@ -245,7 +245,7 @@ bool wxGenericImageList::GetSize( int index, int &width, int &height ) const
width = 0; width = 0;
height = 0; height = 0;
wxList::compatibility_iterator node = m_images.Item( index ); wxObjectList::compatibility_iterator node = m_images.Item( index );
wxCHECK_MSG( node, false, wxT("wrong index in image list") ); wxCHECK_MSG( node, false, wxT("wrong index in image list") );
@@ -259,7 +259,7 @@ bool wxGenericImageList::GetSize( int index, int &width, int &height ) const
bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y, bool wxGenericImageList::Draw( int index, wxDC &dc, int x, int y,
int flags, bool WXUNUSED(solidBackground) ) int flags, bool WXUNUSED(solidBackground) )
{ {
wxList::compatibility_iterator node = m_images.Item( index ); wxObjectList::compatibility_iterator node = m_images.Item( index );
wxCHECK_MSG( node, false, wxT("wrong index in image list") ); wxCHECK_MSG( node, false, wxT("wrong index in image list") );