InfiniTime/src/displayapp/screens/CheckboxList.h

42 lines
1.3 KiB
C
Raw Normal View History

2022-03-04 19:12:44 -05:00
#pragma once
#include "displayapp/Apps.h"
#include "displayapp/screens/Screen.h"
#include <array>
2022-03-04 19:12:44 -05:00
#include <cstdint>
#include <functional>
#include <lvgl/lvgl.h>
2022-03-04 19:12:44 -05:00
#include <memory>
namespace Pinetime {
namespace Applications {
namespace Screens {
class CheckboxList : public Screen {
public:
static constexpr size_t MaxItems = 4;
2022-03-04 19:12:44 -05:00
CheckboxList(const uint8_t screenID,
const uint8_t numScreens,
DisplayApp* app,
const char* optionsTitle,
const char* optionsSymbol,
uint32_t originalValue,
std::function<void(uint32_t)>OnValueChanged,
std::array<const char*, MaxItems> options);
2022-03-04 19:12:44 -05:00
~CheckboxList() override;
void UpdateSelected(lv_obj_t* object, lv_event_t event);
private:
const uint8_t screenID;
std::function<void(uint32_t)>OnValueChanged;
std::array<const char*, MaxItems> options;
std::array<lv_obj_t*, MaxItems> cbOption;
std::array<lv_point_t, 2> pageIndicatorBasePoints;
std::array<lv_point_t, 2> pageIndicatorPoints;
2022-03-04 19:12:44 -05:00
lv_obj_t* pageIndicatorBase;
lv_obj_t* pageIndicator;
uint32_t newValue;
2022-03-04 19:12:44 -05:00
};
}
}
}