]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/animate/animate.cpp
Restored the accidentally deleted "return true;" at the end of the Show method from...
[wxWidgets.git] / contrib / src / animate / animate.cpp
index 5c687f927a0f9c85ba257f2d1e18e3eadfffa4b2..97bf282767319b159a471c01c652706548601cb4 100644 (file)
@@ -9,10 +9,6 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
-    #pragma implementation "animate.h"
-#endif
-
 #include "wx/wxprec.h"
 
 #ifdef    __BORLANDC__
@@ -270,7 +266,11 @@ bool wxAnimationPlayer::PlayFrame()
     PlayFrame(GetCurrentFrame(), * GetWindow(), GetPosition());
 
     // Set the timer for the next frame
-    m_timer.Start(GetDelay(GetCurrentFrame()));
+    int delay = GetDelay(GetCurrentFrame());
+    if (delay == 0)
+        delay = 1;      // 0 is invalid timeout for wxTimer.
+    
+    m_timer.Start(delay);
 
     m_currentFrame ++;
 
@@ -572,6 +572,8 @@ bool wxAnimationCtrlBase::Create(wxWindow *parent, wxWindowID id,
     m_animationPlayer.SetPosition(wxPoint(0, 0));
     m_animationPlayer.SetDestroyAnimation(FALSE);
 
+    LoadFile(filename);
+    
     return TRUE;
 }