Numworks Epsilon  1.4.1
Graphing Calculator Operating System
gauge_view.h
Go to the documentation of this file.
1 #ifndef ESCHER_GAUGE_VIEW_H
2 #define ESCHER_GAUGE_VIEW_H
3 
4 #include <escher/view.h>
5 
6 class GaugeView : public View {
7 public:
8  GaugeView();
9  float level();
10  void setLevel(float level);
11  void setBackgroundColor(KDColor color);
12  void drawRect(KDContext * ctx, KDRect rect) const override;
13  KDSize minimalSizeForOptimalDisplay() const override;
14  constexpr static KDCoordinate k_indicatorDiameter = 10;
15 private:
16  constexpr static KDCoordinate k_thickness = 2;
17  float m_level;
18  KDColor m_backgroundColor;
19 };
20 
21 #endif
void setBackgroundColor(KDColor color)
Definition: gauge_view.cpp:37
int16_t KDCoordinate
Definition: coordinate.h:6
static constexpr KDCoordinate k_indicatorDiameter
Definition: gauge_view.h:14
void drawRect(KDContext *ctx, KDRect rect) const override
Definition: gauge_view.cpp:46
Definition: size.h:6
KDSize minimalSizeForOptimalDisplay() const override
Definition: gauge_view.cpp:58
Definition: rect.h:26
Definition: color.h:6
Definition: view.h:23
void setLevel(float level)
Definition: gauge_view.cpp:28
float level()
Definition: gauge_view.cpp:24