Crazy Eddie's GUI System  0.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
widgets/ProgressBar.h
1 /***********************************************************************
2  filename: CEGUIProgressBar.h
3  created: 13/4/2004
4  author: Paul D Turner
5 
6  purpose: Interface to base class for ProgressBar widget
7 *************************************************************************/
8 /***************************************************************************
9  * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining
12  * a copy of this software and associated documentation files (the
13  * "Software"), to deal in the Software without restriction, including
14  * without limitation the rights to use, copy, modify, merge, publish,
15  * distribute, sublicense, and/or sell copies of the Software, and to
16  * permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be
20  * included in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  ***************************************************************************/
30 #ifndef _CEGUIProgressBar_h_
31 #define _CEGUIProgressBar_h_
32 
33 #include "../Base.h"
34 #include "../Window.h"
35 
36 
37 #if defined(_MSC_VER)
38 # pragma warning(push)
39 # pragma warning(disable : 4251)
40 #endif
41 
42 
43 // Start of CEGUI namespace section
44 namespace CEGUI
45 {
50 class CEGUIEXPORT ProgressBar : public Window
51 {
52 public:
53  static const String EventNamespace;
54  static const String WidgetTypeName;
55 
56  /*************************************************************************
57  Event name constants
58  *************************************************************************/
70  static const String EventProgressDone;
71 
72 
73  /************************************************************************
74  Accessor Functions
75  ************************************************************************/
80  float getProgress(void) const {return d_progress;}
81 
86  float getStepSize(void) const {return d_step;}
87 
88 
89  /*************************************************************************
90  Manipulator Functions
91  *************************************************************************/
102  void setProgress(float progress);
103 
104 
115  void setStepSize(float step_val) {d_step = step_val;}
116 
117 
128  void step(void) {setProgress(d_progress + d_step);}
129 
130 
142  void adjustProgress(float delta) {setProgress(d_progress + delta);}
143 
144 
145  /*************************************************************************
146  Construction / Destruction
147  *************************************************************************/
152  ProgressBar(const String& type, const String& name);
153 
154 
159  virtual ~ProgressBar(void);
160 
161 
162 protected:
163  /*************************************************************************
164  Event handlers for progress bar specific events
165  *************************************************************************/
170  virtual void onProgressChanged(WindowEventArgs& e);
171 
172 
177  virtual void onProgressDone(WindowEventArgs& e);
178 
179 
180  /*************************************************************************
181  Implementation Data
182  *************************************************************************/
183  float d_progress;
184  float d_step;
185 
186 
187 private:
188  /*************************************************************************
189  Private methods
190  *************************************************************************/
191  void addProgressBarProperties(void);
192 };
193 
194 } // End of CEGUI namespace section
195 
196 #if defined(_MSC_VER)
197 # pragma warning(pop)
198 #endif
199 
200 #endif // end of guard _CEGUIProgressBar_h_