Numworks Epsilon  1.4.1
Graphing Calculator Operating System
scroll_view_indicator.h
Go to the documentation of this file.
1 #ifndef ESCHER_SCROLL_VIEW_INDICATOR_H
2 #define ESCHER_SCROLL_VIEW_INDICATOR_H
3 
4 #include <escher/view.h>
5 
6 class ScrollViewIndicator : public View {
7 public:
8  enum class Direction {
10  Vertical
11  };
12  ScrollViewIndicator(Direction direction);
13  void drawRect(KDContext * ctx, KDRect rect) const override;
14 
15  void setIndicatorColor(KDColor c) { m_indicatorColor = c; }
16  KDColor indicatorColor() const { return m_indicatorColor; }
17  void setBackgroundColor(KDColor c) { m_backgroundColor = c; }
18  KDColor backgroundColor() const { return m_backgroundColor; }
19  void setMargin(KDCoordinate m) { m_margin = m; }
20  KDCoordinate margin() const { return m_margin; }
21 
22  float start() const;
23  void setStart(float start);
24  float end() const;
25  void setEnd(float end);
26  KDRect frame();
27 protected:
28 #if ESCHER_VIEW_LOGGING
29  virtual const char * className() const override;
30  virtual void logAttributes(std::ostream &os) const override;
31 #endif
32 private:
33  constexpr static KDCoordinate k_indicatorThickness = 4;
34  Direction m_direction;
35  float m_start;
36  float m_end;
37  KDColor m_indicatorColor;
38  KDColor m_backgroundColor;
39  KDCoordinate m_margin;
40 };
41 
42 #endif
int16_t KDCoordinate
Definition: coordinate.h:6
void setIndicatorColor(KDColor c)
c(generic_all_nodes)
KDColor backgroundColor() const
void setMargin(KDCoordinate m)
KDCoordinate margin() const
ScrollViewIndicator(Direction direction)
Definition: rect.h:26
Definition: color.h:6
Definition: view.h:23
void setStart(float start)
KDColor indicatorColor() const
void drawRect(KDContext *ctx, KDRect rect) const override
void setBackgroundColor(KDColor c)