prima versione

Dependencies:   BSP_DISCO_F746NG F746_GUI LCD_DISCO_F746NG TS_DISCO_F746NG mbed

geco/page.cpp

Committer:
geco300
Date:
2016-06-29
Revision:
0:6ed610929e7f

File content as of revision 0:6ed610929e7f:

#include "page.h"
#define LCD_COLOR_DARKBLUE      ((uint32_t)0xFF000080)

Page::Page(LCD_DISCO_F746NG* lcd){
    
    setHeaderColor(LCD_COLOR_BLUE);
    setFooterColor(LCD_COLOR_BLUE);
    //setFontHeaderColor(uint32_t color);    
    //setFontFooterColor(uint32_t color);
    //setHeaderText(string text);
    //setFooterText(string text);
    setHeaderThickness(40);
    setFooterThickness(40);
    ptrLCD = lcd;

 }
 
 void Page::show(){
    ptrLCD ->Clear(LCD_COLOR_WHITE);
    drawHeader();
    drawFooter();
}

void Page::drawHeader(){
    ptrLCD->SetTextColor(headerColor);
    ptrLCD->FillRect(0,0,480,headerThickness);
    //wait(0.1);
    ptrLCD->SetTextColor(LCD_COLOR_WHITE);
    ptrLCD->SetFont(&Font16);
    ptrLCD->DisplayStringAt(0, LINE(1), (uint8_t *)"MAIN PAGE", CENTER_MODE);
    //wait(0.1);
}

void Page::drawFooter(){
    ptrLCD->SetTextColor(footerColor);
    ptrLCD->FillRect(0,232,480,footerThickness);
    //wait(0.1);
    
    ptrLCD->SetTextColor(LCD_COLOR_WHITE);
    ptrLCD->SetFont(&Font16);
    ptrLCD->DisplayStringAt(0, LINE(15), (uint8_t *)"powered by UNINA CORSE", CENTER_MODE);
    //wait(0.1);
}