My final year project

Dependencies:   BSP_DISCO_F746NG F746_GUI LCD_DISCO_F746NG SDFileSystem TS_DISCO_F746NG ResistiveTouchController Map CYS8218Controller MedianFilter

Screens/MainMenuScreen.cpp

Committer:
Generic
Date:
2016-10-26
Revision:
62:58e846621435
Parent:
15:bc63b55a426d

File content as of revision 62:58e846621435:

#include "MainMenuScreen.hpp"

MainMenuScreen::MainMenuScreen(int *nextScreen) :
  Screen(),
  _lbTitle( SCREEN_W/2, 0, "Main Menu", Label::CENTER, Font24),
  _btAutomatic( 0, 27,((SCREEN_W)/2)-5, SCREEN_H-67, "Automatic", Font20),
  _btManual( (SCREEN_W/2)+5, 27, (SCREEN_W/2)-5, SCREEN_H-67, "Manual", Font20),
  _btSettings( 0, SCREEN_H-30, SCREEN_W,30, "Settings", Font20)
{
  _nextScreen = nextScreen;
}

void MainMenuScreen::Draw()
{
  Clear();
  _lbTitle.Draw();
  _btAutomatic.Draw();
  _btManual.Draw();
  _btSettings.Draw();
}

void MainMenuScreen::Process()
{
  if( _btSettings.Touched() )
    *_nextScreen = MAIN_SETTINGS_SCREEN;

  if( _btManual.Touched() )
    *_nextScreen = MANUAL_CONTROL_SCREEN;

  if( _btAutomatic.Touched() )
    *_nextScreen = AUTOMATIC_CONTROL_SCREEN;

}