InfiniTime/src/displayapp/widgets/Counter.h

43 lines
831 B
C
Raw Normal View History

2022-04-21 10:17:49 -04:00
#pragma once
#include <lvgl/lvgl.h>
namespace Pinetime {
namespace Applications {
namespace Widgets {
class Counter {
public:
Counter(int min, int max);
void Create();
void Increment();
void Decrement();
void SetValue(int newValue);
void HideControls();
void ShowControls();
2022-04-21 10:17:49 -04:00
int GetValue() const {
return value;
}
lv_obj_t* GetObject() const {
return counterContainer;
};
private:
void UpdateLabel();
lv_obj_t* counterContainer;
lv_obj_t* upBtn;
lv_obj_t* downBtn;
lv_obj_t* number;
lv_obj_t* upperLine;
lv_obj_t* lowerLine;
2022-05-18 16:16:00 -04:00
lv_point_t linePoints[2];
2022-04-21 10:17:49 -04:00
int value = 0;
int min;
int max;
};
}
}
}