Dual CANbus monitor and instrumentation cluster supporting ILI9341 display controller
Dependencies: SPI_TFTx2_ILI9341 TOUCH_TFTx2_ILI9341 TFT_fonts mbed
Fork of CANary by
Diff: displayModes.cpp
- Revision:
- 65:821fc79cd7fe
- Parent:
- 62:ffd15edb5431
- Child:
- 66:b7476ce7a59e
- Child:
- 67:2022fce701d0
--- a/displayModes.cpp Wed Apr 10 13:08:54 2013 +0000 +++ b/displayModes.cpp Wed Apr 10 15:08:38 2013 +0000 @@ -599,11 +599,20 @@ tt.background(DarkCyan); tt.set_font((unsigned char*) Arial12x12); + //-------- top row -------- showButton(0,0,"Calibrate"," Touch",4,4); // gg - 4x4 - showButton(1,0," Reset","",4,4); + showButton(2,0," Save"," Config",4,4); + + // a button to step to the next skin + unsigned int nextSkin = skin + 1 ; + if( nextSkin > maxSkin ) nextSkin = 0 ; - showButton(2,0," Save"," Config",4,4); + if( nextSkin == ttSkin ) sprintf(sTemp1,"Skin TT"); + else if( nextSkin == ggSkin ) sprintf(sTemp1,"Skin GG"); + else sprintf(sTemp1,"Skin %d",nextSkin); + + showButton(3,0," Use",sTemp1,4,4); //------- second row ----- if (logEn) { @@ -993,14 +1002,19 @@ x2=(column+1)*(320/columns)-btnGap/2; y1=row*(240/rows)+btnGap/2; y2=(row+1)*(240/rows)-btnGap/2; - /*if( tScn == 0 ) - // paint the whole button box - tt.fillrect(x1,y1,x2,y2,White); // DarkCyan); - else - tt.fillrect(x1,y1,x2,y2,Green); // DarkCyan);*/ + + tt.set_display(tScn); + + if( skin == ggSkin ){ + // paint the whole button box, for a better visual effect + // especially on a screen with a yellow background + if( tScn == 0 ) + tt.fillrect(x1,y1,x2,y2,White); // DarkCyan); + else + tt.fillrect(x1,y1,x2,y2,Green); // DarkCyan); + } // paint the outer pixel as a yellow frame - tt.set_display(tScn); tt.rect(x1,y1,x2,y2,Yellow) ; // DarkCyan); }