Plutonium framework API  0.3
Simple UI framework for libnx and SDL2
elm_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
16 
17 namespace pu::ui::elm
18 {
19  class ProgressBar : public Element
20  {
21  public:
22  ProgressBar(i32 X, i32 Y, i32 Width, i32 Height, double MaxValue);
24 
25  i32 GetX();
26  void SetX(i32 X);
27  i32 GetY();
28  void SetY(i32 Y);
29  i32 GetWidth();
30  void SetWidth(i32 Width);
31  i32 GetHeight();
32  void SetHeight(i32 Height);
33  Color GetColor();
34  void SetColor(Color Color);
35  Color GetProgressColor();
36  void SetProgressColor(Color Color);
37  double GetProgress();
38  void SetProgress(double Progress);
39  void IncrementProgress(double Progress);
40  void DecrementProgress(double Progress);
41  void SetMaxValue(double Max);
42  double GetMaxValue();
43  void FillProgress();
44  void ClearProgress();
45  bool IsCompleted();
46  void OnRender(render::Renderer::Ref &Drawer, i32 X, i32 Y);
47  void OnInput(u64 Down, u64 Up, u64 Held, Touch Pos);
48  private:
49  i32 x;
50  i32 y;
51  i32 w;
52  i32 h;
53  double val;
54  double maxval;
55  Color clr;
56  Color oclr;
57  };
58 }
Definition: elm_Button.hpp:19
void OnRender(render::Renderer::Ref &Drawer, i32 X, i32 Y)
Definition: ui_Types.hpp:24
ProgressBar(i32 X, i32 Y, i32 Width, i32 Height, double MaxValue)
void SetProgress(double Progress)
void OnInput(u64 Down, u64 Up, u64 Held, Touch Pos)
void SetColor(Color Color)
Definition: ui_Types.hpp:38
Definition: elm_ProgressBar.hpp:19
void SetProgressColor(Color Color)
void SetHeight(i32 Height)
s32 i32
Definition: pu_Macros.hpp:17
#define PU_SMART_CTOR(type)
Definition: pu_Macros.hpp:8
void IncrementProgress(double Progress)
void SetWidth(i32 Width)
void SetMaxValue(double Max)
Definition: elm_Element.hpp:34
void DecrementProgress(double Progress)