My final year project

Dependencies:   BSP_DISCO_F746NG F746_GUI LCD_DISCO_F746NG SDFileSystem TS_DISCO_F746NG ResistiveTouchController Map CYS8218Controller MedianFilter

Committer:
Generic
Date:
Sun Oct 02 09:54:14 2016 +0000
Revision:
15:bc63b55a426d
Parent:
10:cd8b61305ad6
Fixed compile errors and Layout of AutomaticControlScreen

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kerneels Bezuidenhout 1:43fb2d03c36f 1 #include "MainMenuScreen.hpp"
Kerneels Bezuidenhout 1:43fb2d03c36f 2
Kerneels Bezuidenhout 1:43fb2d03c36f 3 MainMenuScreen::MainMenuScreen(int *nextScreen) :
Kerneels Bezuidenhout 1:43fb2d03c36f 4 Screen(),
Kerneels Bezuidenhout 10:cd8b61305ad6 5 _lbTitle( SCREEN_W/2, 0, "Main Menu", Label::CENTER, Font24),
Kerneels Bezuidenhout 10:cd8b61305ad6 6 _btAutomatic( 0, 27,((SCREEN_W)/2)-5, SCREEN_H-67, "Automatic", Font20),
Kerneels Bezuidenhout 10:cd8b61305ad6 7 _btManual( (SCREEN_W/2)+5, 27, (SCREEN_W/2)-5, SCREEN_H-67, "Manual", Font20),
Kerneels Bezuidenhout 10:cd8b61305ad6 8 _btSettings( 0, SCREEN_H-30, SCREEN_W,30, "Settings", Font20)
Kerneels Bezuidenhout 1:43fb2d03c36f 9 {
Kerneels Bezuidenhout 1:43fb2d03c36f 10 _nextScreen = nextScreen;
Kerneels Bezuidenhout 1:43fb2d03c36f 11 }
Kerneels Bezuidenhout 1:43fb2d03c36f 12
Kerneels Bezuidenhout 1:43fb2d03c36f 13 void MainMenuScreen::Draw()
Kerneels Bezuidenhout 1:43fb2d03c36f 14 {
Generic 15:bc63b55a426d 15 Clear();
Kerneels Bezuidenhout 1:43fb2d03c36f 16 _lbTitle.Draw();
Kerneels Bezuidenhout 1:43fb2d03c36f 17 _btAutomatic.Draw();
Kerneels Bezuidenhout 1:43fb2d03c36f 18 _btManual.Draw();
Kerneels Bezuidenhout 1:43fb2d03c36f 19 _btSettings.Draw();
Kerneels Bezuidenhout 1:43fb2d03c36f 20 }
Kerneels Bezuidenhout 1:43fb2d03c36f 21
Kerneels Bezuidenhout 1:43fb2d03c36f 22 void MainMenuScreen::Process()
Kerneels Bezuidenhout 1:43fb2d03c36f 23 {
Kerneels Bezuidenhout 3:37f3d9c1eae3 24 if( _btSettings.Touched() )
Kerneels Bezuidenhout 3:37f3d9c1eae3 25 *_nextScreen = MAIN_SETTINGS_SCREEN;
Kerneels Bezuidenhout 10:cd8b61305ad6 26
Kerneels Bezuidenhout 10:cd8b61305ad6 27 if( _btManual.Touched() )
Kerneels Bezuidenhout 10:cd8b61305ad6 28 *_nextScreen = MANUAL_CONTROL_SCREEN;
Kerneels Bezuidenhout 10:cd8b61305ad6 29
Generic 15:bc63b55a426d 30 if( _btAutomatic.Touched() )
Generic 15:bc63b55a426d 31 *_nextScreen = AUTOMATIC_CONTROL_SCREEN;
Generic 15:bc63b55a426d 32
Kerneels Bezuidenhout 1:43fb2d03c36f 33 }