Line | |
---|
1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
4 | Copyright (C) 2004 orx |
---|
5 | |
---|
6 | This program 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 2, or (at your option) |
---|
9 | any later version. |
---|
10 | |
---|
11 | ### File Specific: |
---|
12 | main-programmer: ... |
---|
13 | co-programmer: ... |
---|
14 | */ |
---|
15 | |
---|
16 | //#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_ |
---|
17 | |
---|
18 | #include "glgui_energywidget.h" |
---|
19 | |
---|
20 | namespace OrxGui |
---|
21 | { |
---|
22 | /** |
---|
23 | * @brief standard constructor |
---|
24 | * @todo this constructor is not jet implemented - do it |
---|
25 | */ |
---|
26 | GLGuiEnergyWidget::GLGuiEnergyWidget () |
---|
27 | { |
---|
28 | // this->setClassID(CL_PROTO_ID, "GLGuiEnergyWidget"); |
---|
29 | |
---|
30 | this->pack(&this->name); |
---|
31 | this->pack(&this->text); |
---|
32 | this->pack(&this->bar); |
---|
33 | } |
---|
34 | |
---|
35 | |
---|
36 | /** |
---|
37 | * @brief standard deconstructor |
---|
38 | */ |
---|
39 | GLGuiEnergyWidget::~GLGuiEnergyWidget () |
---|
40 | { |
---|
41 | // delete what has to be deleted here |
---|
42 | } |
---|
43 | |
---|
44 | |
---|
45 | void GLGuiEnergyWidget::setDisplayedName(const std::string& name) |
---|
46 | { |
---|
47 | this->name.setText(name); |
---|
48 | } |
---|
49 | |
---|
50 | void GLGuiEnergyWidget::setMaximum(float max) |
---|
51 | { |
---|
52 | this->bar.setMaximum(max); |
---|
53 | } |
---|
54 | |
---|
55 | void GLGuiEnergyWidget::setValue(float value) |
---|
56 | { |
---|
57 | MultiType val(value); |
---|
58 | val.setType(MT_INT); |
---|
59 | |
---|
60 | this->bar.setValue(value); |
---|
61 | this->text.setText(val.getString()); |
---|
62 | } |
---|
63 | |
---|
64 | |
---|
65 | void GLGuiEnergyWidget::showing() |
---|
66 | { |
---|
67 | this->name.show(); |
---|
68 | this->text.show(); |
---|
69 | this->bar.show(); |
---|
70 | } |
---|
71 | |
---|
72 | void GLGuiEnergyWidget::hiding() |
---|
73 | { |
---|
74 | this->name.hide(); |
---|
75 | this->text.hide(); |
---|
76 | this->bar.hide(); |
---|
77 | } |
---|
78 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.