Planeshift
eeditfpstoolbox.h
Go to the documentation of this file.
1 /*
2  * Author: Andrew Robberts
3  *
4  * Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 
21 
22 #ifndef EEDIT_FPS_TOOLBOX_WINDOW_HEADER
23 #define EEDIT_FPS_TOOLBOX_WINDOW_HEADER
24 
25 
26 
27 #include "eedittoolbox.h"
28 
29 #include "paws/pawswidget.h"
30 
31 
32 
33 class pawsTextBox;
34 
35 class pawsSpinBox;
36 
37 
38 
46 class EEditFPSToolbox : public EEditToolbox, public pawsWidget, public scfImplementation0<EEditFPSToolbox>
47 {
48 public:
50 
51  virtual ~EEditFPSToolbox();
52 
53 
54 
60  float GetFPS() const;
61 
67  float GetTargetFPS() const;
68 
69  // inheritted from EEditToolbox
70  virtual void Update(unsigned int elapsed);
71 
72  virtual size_t GetType() const;
73 
74  virtual const char * GetName() const;
75 
76 
77 
78  // inheritted from pawsWidget
79  virtual bool PostSetup();
80 
81  virtual bool OnButtonPressed( int mouseButton, int keyModifier, pawsWidget* widget );
82 
83 private:
84 
85  pawsTextBox * fpsDisplay;
86 
87  pawsSpinBox * fpsTarget;
88 
89  float fps;
90 
91  unsigned int framesCount;
92 
93  unsigned int framesElapsed;
94 
95 };
96 
98 
101 #endif
102 
The main base widget that all other widgets should inherit from.
Definition: pawswidget.h:116
A combination widget that has up and down arrows and a text label.
Definition: pawsspinbox.h:56
This handles the displaying of FPS and controlling the cap.
virtual void Update(unsigned int elapsed)
Updates the toobox.
virtual bool PostSetup()
This is called after the widget and all of it&#39;s children have been created.
virtual size_t GetType() const
Gets the toolbox type.
float GetFPS() const
Retrieves the current FPS.
float GetTargetFPS() const
Retrieves the current target FPS.
A base class for all eedit toolbox windows.
Definition: eedittoolbox.h:26
CREATE_PAWS_FACTORY(EEditFPSToolbox)
virtual ~EEditFPSToolbox()
virtual const char * GetName() const
Gets the name of the toolbox.
virtual bool OnButtonPressed(int mouseButton, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
A basic text box widget.
Definition: pawstextbox.h:42