set SMALL_FONT for controls here because InheritAttributes() doesn't do it any longer
[wxWidgets.git] / contrib / src / animate / animate.cpp
index ec393517d37eee941aae7345dc7329935f2601b9..2bca70edb856075c2cb96934133ecc83f630b097 100644 (file)
 #include "wx/wfstream.h"
 #include "wx/image.h"
 #include "wx/gifdecod.h"
 #include "wx/wfstream.h"
 #include "wx/image.h"
 #include "wx/gifdecod.h"
-#include "wx/animate/animate.h"
 #include "wx/log.h"
 #include "wx/log.h"
+#include "wx/dcmemory.h"
+#include "wx/animate/animate.h"
 #include "wx/dc.h"
 #include "wx/dcclient.h"
 #include "wx/dc.h"
 #include "wx/dcclient.h"
-#include "wx/dcmemory.h"
 
 /*
  * wxAnimationPlayer
 
 /*
  * wxAnimationPlayer
@@ -109,7 +109,6 @@ bool wxAnimationPlayer::Build()
         int i;
         for (i = 0; i < n; i++)
         {
         int i;
         for (i = 0; i < n; i++)
         {
-            wxBitmap* bitmap = NULL;
             wxImage* image = GetFrame(i);
             if (image)
             {
             wxImage* image = GetFrame(i);
             if (image)
             {
@@ -120,7 +119,7 @@ bool wxAnimationPlayer::Build()
                 if (GetTransparentColour(transparentColour))
                     image->SetMaskColour(transparentColour.Red(), transparentColour.Green(), transparentColour.Blue());
 
                 if (GetTransparentColour(transparentColour))
                     image->SetMaskColour(transparentColour.Red(), transparentColour.Green(), transparentColour.Blue());
 
-                bitmap = new wxBitmap(* image);
+                wxBitmap* bitmap = new wxBitmap(* image);
                 delete image;
                 if (bitmap)
                     m_frames.Append(bitmap);
                 delete image;
                 if (bitmap)
                     m_frames.Append(bitmap);
@@ -293,13 +292,13 @@ bool wxAnimationPlayer::PlayFrame()
 // Clear the wxImage cache
 void wxAnimationPlayer::ClearCache()
 {
 // Clear the wxImage cache
 void wxAnimationPlayer::ClearCache()
 {
-    wxNode* node = m_frames.GetFirst();
+    wxList::compatibility_iterator node = m_frames.GetFirst();
     while (node)
     {
     while (node)
     {
-        wxNode* next = node->GetNext();
+        wxList::compatibility_iterator next = node->GetNext();
         wxBitmap* bitmap = (wxBitmap*) node->GetData();
         delete bitmap;
         wxBitmap* bitmap = (wxBitmap*) node->GetData();
         delete bitmap;
-        delete node;
+        m_frames.Erase(node);
         node = next;
     }
 }
         node = next;
     }
 }
@@ -370,7 +369,7 @@ void wxAnimationPlayer::DrawFrame(int frame, wxDC& dc, const wxPoint& pos)
 {
     wxASSERT_MSG( (m_animation != NULL), _T("Animation not present in wxAnimationPlayer"));
     wxASSERT_MSG( (m_frames.GetCount() != 0), _T("Animation cache not present in wxAnimationPlayer"));
 {
     wxASSERT_MSG( (m_animation != NULL), _T("Animation not present in wxAnimationPlayer"));
     wxASSERT_MSG( (m_frames.GetCount() != 0), _T("Animation cache not present in wxAnimationPlayer"));
-    wxASSERT_MSG( (m_frames.Item(frame) != (wxNode*) NULL), _T("Image not present in wxAnimationPlayer::DrawFrame"));
+    wxASSERT_MSG( !!m_frames.Item(frame), _T("Image not present in wxAnimationPlayer::DrawFrame"));
 
     wxBitmap* bitmap = (wxBitmap*) m_frames.Item(frame)->GetData() ;
 
 
     wxBitmap* bitmap = (wxBitmap*) m_frames.Item(frame)->GetData() ;