OpenXcom  1.0
Open-source clone of the original X-Com
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Bar.h
1 /*
2  * Copyright 2010-2014 OpenXcom Developers.
3  *
4  * This file is part of OpenXcom.
5  *
6  * OpenXcom is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * OpenXcom is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPENXCOM_BAR_H
20 #define OPENXCOM_BAR_H
21 
22 #include "../Engine/Surface.h"
23 
24 namespace OpenXcom
25 {
26 
33 class Bar : public Surface
34 {
35 private:
36  Uint8 _color, _color2;
37  double _scale, _max, _value, _value2;
38  bool _invert, _secondOnTop;
39 public:
41  Bar(int width, int height, int x = 0, int y = 0);
43  ~Bar();
45  void setColor(Uint8 color);
47  Uint8 getColor() const;
49  void setColor2(Uint8 color);
51  Uint8 getColor2() const;
53  void setScale(double scale);
55  double getScale() const;
57  void setMax(double max);
59  double getMax() const;
61  void setValue(double value);
63  double getValue() const;
65  void setValue2(double value);
67  double getValue2() const;
69  void setSecondValueOnTop(bool onTop);
71  void setInvert(bool invert);
73  void draw();
74 };
75 
76 }
77 
78 #endif
Uint8 getColor2() const
Gets the bar's second color.
Definition: Bar.cpp:78
void setValue2(double value)
Sets the bar's second current value.
Definition: Bar.cpp:144
double getValue() const
Gets the bar's current value.
Definition: Bar.cpp:135
void setScale(double scale)
Sets the bar's scale.
Definition: Bar.cpp:87
Uint8 getColor() const
Gets the bar's color.
Definition: Bar.cpp:59
void setMax(double max)
Sets the bar's maximum value.
Definition: Bar.cpp:106
Bar graphic that represents a certain value.
Definition: Bar.h:33
double getValue2() const
Gets the bar's second current value.
Definition: Bar.cpp:154
void setValue(double value)
Sets the bar's current value.
Definition: Bar.cpp:125
void setColor2(Uint8 color)
Sets the bar's second color.
Definition: Bar.cpp:68
void draw()
Draws the bar.
Definition: Bar.cpp:183
double getMax() const
Gets the bar's maximum value.
Definition: Bar.cpp:116
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
Bar(int width, int height, int x=0, int y=0)
Creates a new bar with the specified size and position.
Definition: Bar.cpp:33
void invert(Uint8 mid)
Inverts the surface's colors.
Definition: Surface.cpp:451
~Bar()
Cleans up the bar.
Definition: Bar.cpp:41
void setInvert(bool invert)
Sets the bar's color invert setting.
Definition: Bar.cpp:173
void setSecondValueOnTop(bool onTop)
Defines whether the second value should be drawn on top.
Definition: Bar.cpp:163
void setColor(Uint8 color)
Sets the bar's color.
Definition: Bar.cpp:49
double getScale() const
Gets the bar's scale.
Definition: Bar.cpp:97