Version: 0.6.0
animation.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: wxGISAnimation class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009,2012,2014 Dmitry Baryshnikov
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 #pragma once
22 
23 #include "wxgis/framework/framework.h"
24 #include "wx/imaglist.h"
25 
33 class WXDLLIMPEXP_GIS_FRW wxGISAnimation :
34  public wxControl,
35  public IProgressor
36 {
37  DECLARE_CLASS(wxGISAnimation)
38  enum
39  {
40  ATIMER_ID = 1012,
41  START_ID,
42  STOP_ID,
43  SHOW_ID
44  };
45 
46 public:
47  wxGISAnimation(wxWindow * parent, wxWindowID id = wxID_ANY, const wxBitmap & bitmap = wxNullBitmap, const int bitmap_size = 16, const wxPoint & pos = wxDefaultPosition, const wxSize & size = wxDefaultSize, long style = wxNO_BORDER, const wxString name = wxT("Ani"));
48  virtual ~wxGISAnimation(void);
49  void OnPaint(wxPaintEvent & event);
50  void OnEraseBackground(wxEraseEvent & event);
51  void OnTimer( wxTimerEvent & event);
52  //IProgressor
53  virtual bool ShowProgress(bool bShow);
54  virtual void Play(void);
55  virtual void Stop(void);
56  virtual void SetRange(int range){};
57  virtual int GetRange() const {return 0;};
58  virtual void SetValue(int value){};
59  virtual int GetValue() const {return 0;};
60  virtual void SetYield(bool bYield = false);
61  //events
62  virtual void OnChangeState(wxCommandEvent &event);
63 protected:
64  wxImageList m_ImageList;
65  int m_nImgPos;
66  wxTimer m_timer;
67  bool m_bYield;
68 private:
69  DECLARE_EVENT_TABLE()
70 };
virtual int GetValue() const
Get progressor position.
Definition: animation.h:59
virtual void Stop(void)=0
Stop undefined progressor state.
virtual void SetYield(bool bYield=false)=0
SetYield Yields control to pending messages in the windowing system.
Definition: animation.h:33
virtual int GetRange() const
Set progressor range.
Definition: animation.h:57
virtual bool ShowProgress(bool bShow)=0
Show/hide progressor.
Definition: core.h:92
virtual void SetValue(int value)
Set progressor position.
Definition: animation.h:58
virtual void Play(void)=0
Start undefined progressor state.
Definition: core.h:86
virtual void SetRange(int range)
Set progressor range.
Definition: animation.h:56