diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-09-17 11:20:58 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-09-17 11:20:58 (GMT) |
| commit | 6e44ebc358d1206c147f514225373da07b43c015 (patch) | |
| tree | 35e97c28991c4aff46a9e5a4182b53dedb26e7ee /src/interface/ProgressBar.cpp | |
| parent | e52e9ce91ccca13115fec0fdb0111e7e5d39d10d (diff) | |
| download | powder-6e44ebc358d1206c147f514225373da07b43c015.zip powder-6e44ebc358d1206c147f514225373da07b43c015.tar.gz | |
Checkbox, Slider and ProgressBar components for ui API
Diffstat (limited to 'src/interface/ProgressBar.cpp')
| -rw-r--r-- | src/interface/ProgressBar.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/src/interface/ProgressBar.cpp b/src/interface/ProgressBar.cpp index a622bab..eda88f6 100644 --- a/src/interface/ProgressBar.cpp +++ b/src/interface/ProgressBar.cpp @@ -3,17 +3,26 @@ using namespace ui; -ProgressBar::ProgressBar(Point position, Point size): +ProgressBar::ProgressBar(Point position, Point size, int startProgress, std::string startStatus): Component(position, size), intermediatePos(0.0f), - progressStatus("") + progressStatus(""), + progress(0) { - progress = 0; + SetStatus(startStatus); + SetProgress(startProgress); } void ProgressBar::SetProgress(int progress) { this->progress = progress; + if(this->progress > 100) + this->progress = 100; +} + +int ProgressBar::GetProgress() +{ + return progress; } void ProgressBar::SetStatus(std::string status) @@ -21,6 +30,11 @@ void ProgressBar::SetStatus(std::string status) progressStatus = status; } +std::string ProgressBar::GetStatus() +{ + return progressStatus; +} + void ProgressBar::Draw(const Point & screenPos) { Graphics * g = ui::Engine::Ref().g; |
