diff options
| author | JF <jf@codingfield.com> | 2020-02-26 19:49:26 (GMT) |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-02-26 19:49:26 (GMT) |
| commit | 179b14f48c2c7506d1a7832899e134cc3868a41c (patch) | |
| tree | 117e1b9a52d917052810e868ea0194bc12a941d9 /src/DisplayApp/Screens/Tile.cpp | |
| parent | 0aa1803ea22b119401bcd2e4d9d5278e8386f151 (diff) | |
Add new Screens (gauge, meter,...)
Diffstat (limited to 'src/DisplayApp/Screens/Tile.cpp')
| -rw-r--r-- | src/DisplayApp/Screens/Tile.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/DisplayApp/Screens/Tile.cpp b/src/DisplayApp/Screens/Tile.cpp index 6ee677d..1c85aa1 100644 --- a/src/DisplayApp/Screens/Tile.cpp +++ b/src/DisplayApp/Screens/Tile.cpp @@ -16,9 +16,11 @@ static void event_handler(lv_obj_t * obj, lv_event_t event) { screen->OnObjectEvent(obj, event, eventData); } -static const char * btnm_map1[] = {"App1", "App2", "App3", "\n", "App4", "App5", "App11", ""}; +static const char * btnm_map1[] = {"Meter", "Gauge", "Clock", "\n", "App4", "App5", "App11", ""}; Tile::Tile(DisplayApp* app) : Screen(app) { + modal.reset(new Modal(app)); + static lv_point_t valid_pos[] = {{0,0}, {LV_COORD_MIN, LV_COORD_MIN}}; tileview = lv_tileview_create(lv_scr_act(), NULL); lv_tileview_set_valid_positions(tileview, valid_pos, 1); @@ -109,11 +111,17 @@ void Tile::OnObjectEvent(lv_obj_t *obj, lv_event_t event, uint32_t buttonId) { if(event == LV_EVENT_VALUE_CHANGED) { switch(buttonId) { case 0: + tile->StartMeterApp(); + break; case 1: + tile->StartGaugeApp(); + break; case 2: tile->StartClockApp(); break; case 3: + modal->Show(); + break; case 4: case 5: tile->StartTestApp(); @@ -139,3 +147,14 @@ void Tile::StartTestApp() { app->StartApp(DisplayApp::Apps::Test); running = false; } + +void Tile::StartMeterApp() { + app->StartApp(DisplayApp::Apps::Meter); + running = false; +} + +void Tile::StartGaugeApp() { + app->StartApp(DisplayApp::Apps::Gauge); + running = false; +} + |
