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
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
53
54
58
59
63
64
68
69
/* ... */
#include <gui/menu_screen/MenuView.hpp>
#include <BitmapDatabase.hpp>
#include <gui/common/FrontendApplication.hpp>
#include <touchgfx/Color.hpp>
MenuView::MenuView() :
onButtonPressed(this, &MenuView::buttonPressedhandler)
{
}{ ... }
void MenuView::setupScreen()
{
backgroundTop.setBitmap(Bitmap(BITMAP_BACKGROUND_TOP_ID));
backgroundTop.setXY(0, 0);
backgroundBottom.setBitmap(Bitmap(BITMAP_BACKGROUND_BOTTOM_ID));
backgroundBottom.setXY(0, HAL::DISPLAY_HEIGHT - backgroundBottom.getHeight());
liveDataDisplayTile.setXY(TILE_OFFSET, HAL::DISPLAY_HEIGHT - liveDataDisplayTile.getHeight() - TILE_OFFSET);
homeAutomationTile.setXY(TILE_OFFSET, TILE_OFFSET);
animatedGraphicsTile.setXY(TILE_OFFSET, homeAutomationTile.getY() + homeAutomationTile.getHeight() + TILE_OFFSET);
chromArtTile.setXY(animatedGraphicsTile.getX() + animatedGraphicsTile.getWidth() + TILE_OFFSET - 3, animatedGraphicsTile.getY());
add(backgroundTop);
add(liveDataDisplayTile);
add(homeAutomationTile);
add(animatedGraphicsTile);
add(chromArtTile);
add(backgroundBottom);
}{ ... }
void MenuView::tearDownScreen()
{
}{ ... }
void MenuView::buttonPressedhandler(const AbstractButton& button)
{
}{ ... }
void MenuView::addRoomToHomeAutomationTile(RoomTemperatureInfo& room)
{
homeAutomationTile.getTile().addRoom(room);
}{ ... }
void MenuView::initializeTiles()
{
homeAutomationTile.getTile().initialize();
}{ ... }