Menu system broken
Dependencies: ANSITermMenuSystem
Fork of menuSystemMbed by
menuItem.cpp
- Committer:
- Rybowonder
- Date:
- 2013-05-04
- Revision:
- 8:6ddb8c26387a
- Parent:
- 5:92389cf2106d
File content as of revision 8:6ddb8c26387a:
// // menuItem.cpp // menuSystem // // Created by BradDSmith on 2013-02-26. // Copyright (c) 2013 BradDSmith. All rights reserved. // #include "menuItem.h" #include "console.h" menuItem::menuItem():Text("EMPTY") { } void menuItem::initialize( int ID, const char * text, int x, int y) { menuID = ID; setText( (char *) text); setPosition(x,y); } void menuItem::setText( char * menuText) { Text.assign(menuText); } void menuItem::setPosition(int x, int y) { position.X = x; position.Y = y; } void menuItem::print() { const char * msg = Text.c_str(); printXY( (char *)msg, position.X, position.Y); } void menuItem::erase() { printXY (" ", position.X - 2, position.Y); } void menuItem::highlight() { // char check[] = "x"; // check[0] = 177; // printXY (check, position.X - 2, position.Y); printXY ("X", position.X - 2, position.Y); gotoxy( position.X - 2, position.Y); } void menuItem::removeHighLight() { printXY (" ", position.X - 2, position.Y); } void menuItem::showselect() { printXY (">", position.X - 1, position.Y); gotoxy( position.X, position.Y); } void menuItem::removeselect() { printXY (" ", position.X - 1, position.Y); } int menuItem::getMenuID() { return menuID; }