Menu system broken

Dependencies:   ANSITermMenuSystem

Fork of menuSystemMbed by Ryan Scott

console.cpp

Committer:
Rybowonder
Date:
2013-04-21
Revision:
5:92389cf2106d
Parent:
4:1178a1905490
Child:
6:2f220f5d782d

File content as of revision 5:92389cf2106d:

// console.cpp
//

#include "console.h"
#include "SerialGraphicLCD.h"   // changed from "ANISTerm.h" April 2nd 2013

using namespace std;


extern SerialGraphicLCD lcd;  //Changed April 2nd 2013

//
// Clears the screen
//
void clrscr()
{
  lcd.clear();    //changed from pc.clear_screen(); April 2nd 2013
}

//
// Moves the cursor to x, y in console window
// ie x=left\right y=top\bottom
//
void gotoxy(int x, int y)
{
   lcd.pos(x, y);   //changed from pc.set_cursor_position(x,y); April 2nd 2013
}

void printXY( char * text, int x, int y)
{
    static bool runOnce = false;
    if (runOnce == false){
        clrscr();
        runOnce = true;
        }

    gotoxy( x, y);
    lcd.printf("%s", text);    //changed from pc.printf("%s", text); April 2nd 2013
}

void printRec(int x1, int y1, int x2, int y2)
{
    lcd.rect(x1, y1, x2, y2);
}

void eraseRec(int x1, int y1, int x2, int y2)
{
    lcd.erase(x1, y1, x2, y2);
}
//
// Set text and background colors
//
void setrgb(int color)
{
    switch (color)
    {
    case 0:    // White on Black
        
        break;
    case 1:    // Red on Black
      
        break;
    case 2:    // Green on Black
      
        break;
    case 3:    // Yellow on Black
        
        break;
    case 4:    // Blue on Black
       
        break;
    case 5:    // Magenta on Black
      
        break;
    case 6:    // Cyan on Black
        
        break;
    case 7:    // Black on Gray
        
        break;
    case 8:    // Black on White
        
        break;
    case 9:    // Red on White
       
        break;
    case 10: // Green on White
     
        break;
    case 11: // Yellow on White
       
        break;
    case 12: // Blue on White
      
        break;
    case 13: // Magenta on White
      
        break;
    case 14: // Cyan on White
       
        break;
    case 15: // White on White
       
        break;
    default : // White on Black
       
        break;
    }
}