Plutonium framework API  0.1
Simple UI framework for libnx and SDL2
ProgressBar.hpp
Go to the documentation of this file.
1 
2 /*
3 
4  Plutonium library
5 
6  @file ProgressBar.hpp
7  @brief A ProgressBar is an Element which represents a progress (a percentage) by filling a bar.
8  @author XorTroll
9 
10  @copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
11 
12 */
13 
14 #pragma once
15 #include <pu/element/Element.hpp>
16 
17 namespace pu::element
18 {
19  class ProgressBar : public Element
20  {
21  public:
22  ProgressBar(u32 X, u32 Y, u32 Width, u32 Height);
23  u32 GetX();
24  void SetX(u32 X);
25  u32 GetY();
26  void SetY(u32 Y);
27  u32 GetWidth();
28  void SetWidth(u32 Width);
29  u32 GetHeight();
30  void SetHeight(u32 Height);
32  void SetColor(draw::Color Color);
34  void SetProgressColor(draw::Color Color);
35  u8 GetProgress();
36  void SetProgress(u8 Percentage);
37  void IncrementProgress(u8 Percentage);
38  void DecrementProgress(u8 Percentage);
39  void FillProgress();
40  void ClearProgress();
41  bool IsCompleted();
42  void OnRender(render::Renderer *Drawer);
43  void OnInput(u64 Down, u64 Up, u64 Held, bool Touch, bool Focus);
44  private:
45  u32 x;
46  u32 y;
47  u32 w;
48  u32 h;
49  u8 perc;
50  draw::Color clr;
51  draw::Color oclr;
52  };
53 }
Definition: Renderer.hpp:22
void SetProgressColor(draw::Color Color)
void DecrementProgress(u8 Percentage)
void OnRender(render::Renderer *Drawer)
Definition: Button.hpp:18
Definition: ProgressBar.hpp:19
Definition: Element.hpp:27
void OnInput(u64 Down, u64 Up, u64 Held, bool Touch, bool Focus)
void SetWidth(u32 Width)
ProgressBar(u32 X, u32 Y, u32 Width, u32 Height)
void SetColor(draw::Color Color)
draw::Color GetProgressColor()
void SetProgress(u8 Percentage)
void SetHeight(u32 Height)
Definition: Color.hpp:19
void IncrementProgress(u8 Percentage)