Blame view

build3/apps/shared/zoom_parameter_controller.h 1.58 KB
6663b6c9   adorian   projet complet av...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
  #ifndef SHARED_ZOOM_PARAMETER_CONTROLLER_H
  #define SHARED_ZOOM_PARAMETER_CONTROLLER_H
  
  #include <escher.h>
  #include "interactive_curve_view_range.h"
  #include "curve_view.h"
  #include "../i18n.h"
  
  namespace Shared {
  
  class ZoomParameterController : public ViewController {
  public:
    ZoomParameterController(Responder * parentResponder, InteractiveCurveViewRange * interactiveCurveViewRange, CurveView * curveView);
    const char * title() override;
    View * view() override;
    bool handleEvent(Ion::Events::Event event) override;
    void viewWillAppear() override;
    void didBecomeFirstResponder() override;
  private:
    class ContentView : public View {
    public:
      ContentView(CurveView * curveView);
      void layoutSubviews() override;
      CurveView * curveView();
    private:
      class LegendView : public View {
      public:
        LegendView();
        void drawRect(KDContext * ctx, KDRect rect) const override;
      private:
        constexpr static int k_numberOfLegends = 3;
        constexpr static int k_numberOfTokens = 6;
        constexpr static KDCoordinate k_tokenWidth = 10;
        void layoutSubviews() override;
        int numberOfSubviews() const override;
        View * subviewAtIndex(int index) override;
        MessageTextView m_legends[k_numberOfLegends];
        KeyView m_legendPictograms[k_numberOfTokens];
      };
      int numberOfSubviews() const override;
      View * subviewAtIndex(int index) override;
      CurveView * m_curveView;
      LegendView m_legendView;
      constexpr static KDCoordinate k_legendHeight = 30;
    };
    ContentView m_contentView;
    InteractiveCurveViewRange * m_interactiveRange;
  };
  
  }
  
  #endif