]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/animateg.cpp
!__WX_DC_BLIT_FIXED__ case
[wxWidgets.git] / src / generic / animateg.cpp
index d03b9b2dbcee5a9ab448cdef7377e6ea83dc57fb..062855d92687b61085f458e093faaeef9cff053d 100644 (file)
   #pragma hdrstop
 #endif  //__BORLANDC__
 
-
 #if wxUSE_ANIMATIONCTRL
 
-#include "wx/log.h"
+#include "wx/animate.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/log.h"
+    #include "wx/image.h"
+    #include "wx/dcmemory.h"
+    #include "wx/dcclient.h"
+    #include "wx/module.h"
+#endif
+
 #include "wx/wfstream.h"
-#include "wx/image.h"
 #include "wx/gifdecod.h"
 #include "wx/anidecod.h"
-#include "wx/dcmemory.h"
-#include "wx/dc.h"
-#include "wx/dcclient.h"
-#include "wx/animate.h"
-#include "wx/animdecod.h"
-
 
-#include <wx/listimpl.cpp>
-WX_DEFINE_LIST(wxAnimationDecoderList);
+#include "wx/listimpl.cpp"
+WX_DEFINE_LIST(wxAnimationDecoderList)
 
 wxAnimationDecoderList wxAnimation::sm_handlers;
 
 
-
 // ----------------------------------------------------------------------------
 // wxAnimation
 // ----------------------------------------------------------------------------
@@ -209,8 +209,12 @@ const wxAnimationDecoder *wxAnimation::FindHandler( wxAnimationType animType )
 
 void wxAnimation::InitStandardHandlers()
 {
+#if wxUSE_GIF
     AddHandler(new wxGIFDecoder);
+#endif // wxUSE_GIF
+#if wxUSE_ICO_CUR
     AddHandler(new wxANIDecoder);
+#endif // wxUSE_ICO_CUR
 }
 
 void wxAnimation::CleanUpHandlers()
@@ -244,8 +248,6 @@ public:
 IMPLEMENT_DYNAMIC_CLASS(wxAnimationModule, wxModule)
 
 
-
-
 // ----------------------------------------------------------------------------
 // wxAnimationCtrl
 // ----------------------------------------------------------------------------
@@ -257,6 +259,14 @@ BEGIN_EVENT_TABLE(wxAnimationCtrl, wxAnimationCtrlBase)
     EVT_TIMER(wxID_ANY, wxAnimationCtrl::OnTimer)
 END_EVENT_TABLE()
 
+wxAnimationCtrl::wxAnimationCtrl()
+{
+    m_currentFrame = 0;
+    m_looped = false;
+    m_isPlaying = false;
+    m_useWinBackgroundColour = false;
+}
+
 bool wxAnimationCtrl::Create(wxWindow *parent, wxWindowID id,
             const wxAnimation& animation, const wxPoint& pos,
             const wxSize& size, long style, const wxString& name)
@@ -268,7 +278,7 @@ bool wxAnimationCtrl::Create(wxWindow *parent, wxWindowID id,
     m_useWinBackgroundColour = false;
     m_timer.SetOwner(this);
 
-    if (!wxControl::Create(parent, id, pos, size, style, wxDefaultValidator, name))
+    if (!base_type::Create(parent, id, pos, size, style, wxDefaultValidator, name))
         return false;
 
     // by default we get the same background colour of our parent
@@ -488,10 +498,11 @@ void wxAnimationCtrl::DrawCurrentFrame(wxDC& dc)
 }
 
 void wxAnimationCtrl::DisposeToBackground(wxDC& dc)
-{
-    wxBrush brush(IsUsingWindowBackgroundColour()
+{ 
+    wxColour col = IsUsingWindowBackgroundColour()
                     ? GetBackgroundColour()
-                    : m_animation.GetBackgroundColour());
+                    : m_animation.GetBackgroundColour() ;
+    wxBrush brush(col);
     dc.SetBackground(brush);
     dc.Clear();
 }