summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Calculator.h
blob: 7b1e49bdb2114dafce342d05718409afeed7a0b1 (plain)
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

#pragma once


#include "Screen.h"
#include "components/motor/MotorController.h"
#include <array>
#include <string>

namespace Pinetime {
  namespace Applications {
    namespace Screens {

      class Calculator : public Screen {
      public:
        ~Calculator() override;

        Calculator(DisplayApp* app, Controllers::MotorController& motorController);

        void OnButtonEvent(lv_obj_t* obj, lv_event_t event);

        bool OnTouchEvent(Pinetime::Applications::TouchEvents event) override;

      private:
        lv_obj_t *result, *returnButton, *buttonMatrix;

        char text[31];
        uint8_t position = 0;

        void Eval();
        void Reset();

        Controllers::MotorController& motorController;
      };

    }
  }
}