menu system menus complete
Fork of menuSystemMbed by
console.cpp
- Committer:
- Rybowonder
- Date:
- 2013-03-08
- Revision:
- 3:bdf42b6c15f4
- Parent:
- 0:a5ece7312edc
File content as of revision 3:bdf42b6c15f4:
// console.cpp // #include "console.h" #include "ANSITerm.h" using namespace std; extern ANSITerm pc; // // Clears the screen // void clrscr() { pc.clear_screen(); } // // Moves the cursor to x, y in console window // ie x=left\right y=top\bottom // void gotoxy(int x, int y) { pc.set_cursor_position(x,y); } void printXY( char * text, int x, int y) { static bool runOnce = false; if (runOnce == false){ clrscr(); runOnce = true; } gotoxy( x, y); pc.printf("%s", text); } // // 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; } }