OpenXcom  1.0
Open-source clone of the original X-Com
Bar.h
1 #pragma once
2 /*
3  * Copyright 2010-2016 OpenXcom Developers.
4  *
5  * This file is part of OpenXcom.
6  *
7  * OpenXcom is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * OpenXcom is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>.
19  */
20 #include "../Engine/Surface.h"
21 
22 namespace OpenXcom
23 {
24 
31 class Bar : public Surface
32 {
33 private:
34  Uint8 _color, _color2, _borderColor;
35  double _scale, _max, _value, _value2;
36  bool _secondOnTop;
37 public:
39  Bar(int width, int height, int x = 0, int y = 0);
41  ~Bar();
43  void setColor(Uint8 color);
45  Uint8 getColor() const;
47  void setSecondaryColor(Uint8 color);
49  Uint8 getSecondaryColor() const;
51  void setScale(double scale);
53  double getScale() const;
55  void setMax(double max);
57  double getMax() const;
59  void setValue(double value);
61  double getValue() const;
63  void setValue2(double value);
65  double getValue2() const;
67  void setSecondValueOnTop(bool onTop);
69  void draw();
71  void setBorderColor(Uint8 bc);
72 };
73 
74 }
void setValue2(double value)
Sets the bar&#39;s second current value.
Definition: Bar.cpp:143
void setScale(double scale)
Sets the bar&#39;s scale.
Definition: Bar.cpp:86
void setMax(double max)
Sets the bar&#39;s maximum value.
Definition: Bar.cpp:105
Bar graphic that represents a certain value.
Definition: Bar.h:31
Uint8 getColor() const
Gets the bar&#39;s color.
Definition: Bar.cpp:58
void setValue(double value)
Sets the bar&#39;s current value.
Definition: Bar.cpp:124
void setBorderColor(Uint8 bc)
set the outline color for the bar.
Definition: Bar.cpp:213
double getValue() const
Gets the bar&#39;s current value.
Definition: Bar.cpp:134
void draw()
Draws the bar.
Definition: Bar.cpp:171
Element that is blit (rendered) onto the screen.
Definition: Surface.h:38
Bar(int width, int height, int x=0, int y=0)
Creates a new bar with the specified size and position.
Definition: Bar.cpp:32
void setSecondaryColor(Uint8 color)
Sets the bar&#39;s second color.
Definition: Bar.cpp:67
~Bar()
Cleans up the bar.
Definition: Bar.cpp:40
double getMax() const
Gets the bar&#39;s maximum value.
Definition: Bar.cpp:115
Uint8 getSecondaryColor() const
Gets the bar&#39;s second color.
Definition: Bar.cpp:77
double getScale() const
Gets the bar&#39;s scale.
Definition: Bar.cpp:96
double getValue2() const
Gets the bar&#39;s second current value.
Definition: Bar.cpp:153
void setSecondValueOnTop(bool onTop)
Defines whether the second value should be drawn on top.
Definition: Bar.cpp:162
void setColor(Uint8 color)
Sets the bar&#39;s color.
Definition: Bar.cpp:48
Definition: BaseInfoState.cpp:40