]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/generic/animate.h
Cast for argument to delete[] - VC6 doesn't want to delete a const pointer
[wxWidgets.git] / include / wx / generic / animate.h
index fd7ee2a8240b3bd240aeb2cc3c8113d46d5fcc19..883c8a5952aec692476ea9cf0c2741cd14d305d1 100644 (file)
@@ -23,12 +23,16 @@ WX_DECLARE_LIST_WITH_DECL(wxAnimationDecoder, wxAnimationDecoderList, class WXDL
 class WXDLLIMPEXP_ADV wxAnimation : public wxAnimationBase
 {
 public:
 class WXDLLIMPEXP_ADV wxAnimation : public wxAnimationBase
 {
 public:
+    wxAnimation() {}
+    wxAnimation(const wxString &name, wxAnimationType type = wxANIMATION_TYPE_ANY)
+        { LoadFile(name, type); }
+
     virtual bool IsOk() const
         { return m_refData != NULL; }
 
     virtual bool IsOk() const
         { return m_refData != NULL; }
 
-    virtual size_t GetFrameCount() const;
-    virtual int GetDelay(size_t i) const;
-    virtual wxImage GetFrame(size_t i) const;
+    virtual unsigned int GetFrameCount() const;
+    virtual int GetDelay(unsigned int i) const;
+    virtual wxImage GetFrame(unsigned int i) const;
     virtual wxSize GetSize() const;
 
     virtual bool LoadFile(const wxString& filename,
     virtual wxSize GetSize() const;
 
     virtual bool LoadFile(const wxString& filename,
@@ -36,12 +40,11 @@ public:
     virtual bool Load(wxInputStream& stream,
                       wxAnimationType type = wxANIMATION_TYPE_ANY);
 
     virtual bool Load(wxInputStream& stream,
                       wxAnimationType type = wxANIMATION_TYPE_ANY);
 
-public:     // extended interface used by the generic implementation of wxAnimationCtrl
-
-    wxPoint GetFramePosition(size_t frame) const;
-    wxSize GetFrameSize(size_t frame) const;
-    wxAnimationDisposal GetDisposalMethod(size_t frame) const;
-    wxColour GetTransparentColour(size_t frame) const;
+    // extended interface used by the generic implementation of wxAnimationCtrl
+    wxPoint GetFramePosition(unsigned int frame) const;
+    wxSize GetFrameSize(unsigned int frame) const;
+    wxAnimationDisposal GetDisposalMethod(unsigned int frame) const;
+    wxColour GetTransparentColour(unsigned int frame) const;
     wxColour GetBackgroundColour() const;
 
 protected:
     wxColour GetBackgroundColour() const;
 
 protected:
@@ -69,12 +72,12 @@ class WXDLLIMPEXP_ADV wxAnimationCtrl: public wxAnimationCtrlBase
 public:
     wxAnimationCtrl() { Init(); }
     wxAnimationCtrl(wxWindow *parent,
 public:
     wxAnimationCtrl() { Init(); }
     wxAnimationCtrl(wxWindow *parent,
-            wxWindowID id,
-            const wxAnimation& anim = wxNullAnimation,
-            const wxPoint& pos = wxDefaultPosition,
-            const wxSize& size = wxDefaultSize,
-            long style = wxAC_DEFAULT_STYLE,
-            const wxString& name = wxAnimationCtrlNameStr)
+                    wxWindowID id,
+                    const wxAnimation& anim = wxNullAnimation,
+                    const wxPoint& pos = wxDefaultPosition,
+                    const wxSize& size = wxDefaultSize,
+                    long style = wxAC_DEFAULT_STYLE,
+                    const wxString& name = wxAnimationCtrlNameStr)
     {
         Init();
 
     {
         Init();
 
@@ -105,7 +108,10 @@ public:
     wxAnimation GetAnimation() const
         { return m_animation; }
 
     wxAnimation GetAnimation() const
         { return m_animation; }
 
-    void SetInactiveBitmap(const wxBitmap &bmp);
+    virtual void SetInactiveBitmap(const wxBitmap &bmp);
+
+    // override base class method
+    virtual bool SetBackgroundColour(const wxColour& col);
 
 public:     // event handlers
 
 
 public:     // event handlers
 
@@ -143,15 +149,15 @@ protected:      // internal utilities
     void DisposeToBackground(wxDC& dc);
     void DisposeToBackground(wxDC& dc, const wxPoint &pos, const wxSize &sz);
 
     void DisposeToBackground(wxDC& dc);
     void DisposeToBackground(wxDC& dc, const wxPoint &pos, const wxSize &sz);
 
-    void UpdateBackingStoreWithStaticImage();
     void IncrementalUpdateBackingStore();
     void IncrementalUpdateBackingStore();
-    bool RebuildBackingStoreUpToFrame(size_t);
-    void DrawFrame(wxDC &dc, size_t);
+    bool RebuildBackingStoreUpToFrame(unsigned int);
+    void DrawFrame(wxDC &dc, unsigned int);
 
 
+    virtual void DisplayStaticImage();
     virtual wxSize DoGetBestSize() const;
 
 protected:
     virtual wxSize DoGetBestSize() const;
 
 protected:
-    size_t        m_currentFrame;     // Current frame
+    unsigned int  m_currentFrame;     // Current frame
     bool          m_looped;           // Looped, or not
     wxTimer       m_timer;            // The timer
     wxAnimation   m_animation;        // The animation
     bool          m_looped;           // Looped, or not
     wxTimer       m_timer;            // The timer
     wxAnimation   m_animation;        // The animation