Crazy Eddie's GUI System
0.8.4
|
00001 /*********************************************************************** 00002 created: 13/4/2004 00003 author: Paul D Turner 00004 00005 purpose: Interface to base class for ProgressBar widget 00006 *************************************************************************/ 00007 /*************************************************************************** 00008 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team 00009 * 00010 * Permission is hereby granted, free of charge, to any person obtaining 00011 * a copy of this software and associated documentation files (the 00012 * "Software"), to deal in the Software without restriction, including 00013 * without limitation the rights to use, copy, modify, merge, publish, 00014 * distribute, sublicense, and/or sell copies of the Software, and to 00015 * permit persons to whom the Software is furnished to do so, subject to 00016 * the following conditions: 00017 * 00018 * The above copyright notice and this permission notice shall be 00019 * included in all copies or substantial portions of the Software. 00020 * 00021 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00022 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00023 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00024 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 00025 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00026 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00027 * OTHER DEALINGS IN THE SOFTWARE. 00028 ***************************************************************************/ 00029 #ifndef _CEGUIProgressBar_h_ 00030 #define _CEGUIProgressBar_h_ 00031 00032 #include "../Base.h" 00033 #include "../Window.h" 00034 00035 00036 #if defined(_MSC_VER) 00037 # pragma warning(push) 00038 # pragma warning(disable : 4251) 00039 #endif 00040 00041 00042 // Start of CEGUI namespace section 00043 namespace CEGUI 00044 { 00049 class CEGUIEXPORT ProgressBar : public Window 00050 { 00051 public: 00052 static const String EventNamespace; 00053 static const String WidgetTypeName; 00054 00055 /************************************************************************* 00056 Event name constants 00057 *************************************************************************/ 00063 static const String EventProgressChanged; 00069 static const String EventProgressDone; 00070 00071 00072 /************************************************************************ 00073 Accessor Functions 00074 ************************************************************************/ 00079 float getProgress(void) const {return d_progress;} 00080 00085 float getStepSize(void) const {return d_step;} 00086 00087 00088 /************************************************************************* 00089 Manipulator Functions 00090 *************************************************************************/ 00101 void setProgress(float progress); 00102 00103 00114 void setStepSize(float step_val) {d_step = step_val;} 00115 00116 00127 void step(void) {setProgress(d_progress + d_step);} 00128 00129 00141 void adjustProgress(float delta) {setProgress(d_progress + delta);} 00142 00143 00144 /************************************************************************* 00145 Construction / Destruction 00146 *************************************************************************/ 00151 ProgressBar(const String& type, const String& name); 00152 00153 00158 virtual ~ProgressBar(void); 00159 00160 00161 protected: 00162 /************************************************************************* 00163 Event handlers for progress bar specific events 00164 *************************************************************************/ 00169 virtual void onProgressChanged(WindowEventArgs& e); 00170 00171 00176 virtual void onProgressDone(WindowEventArgs& e); 00177 00178 00179 /************************************************************************* 00180 Implementation Data 00181 *************************************************************************/ 00182 float d_progress; 00183 float d_step; 00184 00185 00186 private: 00187 /************************************************************************* 00188 Private methods 00189 *************************************************************************/ 00190 void addProgressBarProperties(void); 00191 }; 00192 00193 } // End of CEGUI namespace section 00194 00195 #if defined(_MSC_VER) 00196 # pragma warning(pop) 00197 #endif 00198 00199 #endif // end of guard _CEGUIProgressBar_h_