prima versione
Dependencies: BSP_DISCO_F746NG F746_GUI LCD_DISCO_F746NG TS_DISCO_F746NG mbed
Diff: geco/page.cpp
- Revision:
- 0:6ed610929e7f
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/geco/page.cpp Wed Jun 29 13:38:35 2016 +0000 @@ -0,0 +1,43 @@ +#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); +} \ No newline at end of file