Menu system broken

Dependencies:   ANSITermMenuSystem

Fork of menuSystemMbed by Ryan Scott

Committer:
Rybowonder
Date:
Sun Apr 21 20:15:31 2013 +0000
Revision:
5:92389cf2106d
Child:
6:2f220f5d782d
Error off the hop

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rybowonder 5:92389cf2106d 1 //
Rybowonder 5:92389cf2106d 2 // menuItem.cpp
Rybowonder 5:92389cf2106d 3 // menuSystem
Rybowonder 5:92389cf2106d 4 //
Rybowonder 5:92389cf2106d 5 // Created by BradDSmith on 2013-02-26.
Rybowonder 5:92389cf2106d 6 // Copyright (c) 2013 BradDSmith. All rights reserved.
Rybowonder 5:92389cf2106d 7 //
Rybowonder 5:92389cf2106d 8
Rybowonder 5:92389cf2106d 9 #include "CdisplayItem.h"
Rybowonder 5:92389cf2106d 10 #include "console.h"
Rybowonder 5:92389cf2106d 11
Rybowonder 5:92389cf2106d 12 CdisplayItem::CdisplayItem():Text("EMPTY")
Rybowonder 5:92389cf2106d 13 {
Rybowonder 5:92389cf2106d 14
Rybowonder 5:92389cf2106d 15
Rybowonder 5:92389cf2106d 16 }
Rybowonder 5:92389cf2106d 17
Rybowonder 5:92389cf2106d 18 void CdisplayItem::initialize(const char * text, int x, int y,int x2, int y2)
Rybowonder 5:92389cf2106d 19 {
Rybowonder 5:92389cf2106d 20 setText( (char *) text);
Rybowonder 5:92389cf2106d 21 setPosition(x,y);
Rybowonder 5:92389cf2106d 22 value.X = x2;
Rybowonder 5:92389cf2106d 23 value.Y = y2;
Rybowonder 5:92389cf2106d 24 }
Rybowonder 5:92389cf2106d 25
Rybowonder 5:92389cf2106d 26 void CdisplayItem::setText( char * CdisplayText)
Rybowonder 5:92389cf2106d 27 {
Rybowonder 5:92389cf2106d 28 Text.assign(CdisplayText);
Rybowonder 5:92389cf2106d 29 }
Rybowonder 5:92389cf2106d 30
Rybowonder 5:92389cf2106d 31 void CdisplayItem::setPosition(int x, int y)
Rybowonder 5:92389cf2106d 32 {
Rybowonder 5:92389cf2106d 33 position.X = x;
Rybowonder 5:92389cf2106d 34 position.Y = y;
Rybowonder 5:92389cf2106d 35 }
Rybowonder 5:92389cf2106d 36
Rybowonder 5:92389cf2106d 37 void CdisplayItem::print()
Rybowonder 5:92389cf2106d 38 {
Rybowonder 5:92389cf2106d 39 const char * msg = Text.c_str();
Rybowonder 5:92389cf2106d 40 printXY( (char *)msg, position.X, position.Y);
Rybowonder 5:92389cf2106d 41
Rybowonder 5:92389cf2106d 42 }
Rybowonder 5:92389cf2106d 43 void CdisplayItem::erase()
Rybowonder 5:92389cf2106d 44 {
Rybowonder 5:92389cf2106d 45 printXY (" ", position.X - 2, position.Y);
Rybowonder 5:92389cf2106d 46 }
Rybowonder 5:92389cf2106d 47
Rybowonder 5:92389cf2106d 48 void CdisplayItem::setValue(char * newval)
Rybowonder 5:92389cf2106d 49 {
Rybowonder 5:92389cf2106d 50 printXY( (char *)newval, value.X, value.Y);
Rybowonder 5:92389cf2106d 51 }
Rybowonder 5:92389cf2106d 52
Rybowonder 5:92389cf2106d 53 void CdisplayItem::Crect(int x1, int y1, int x2, int y2)
Rybowonder 5:92389cf2106d 54 {
Rybowonder 5:92389cf2106d 55 printRec(x1, y1, x2, y2);
Rybowonder 5:92389cf2106d 56 }
Rybowonder 5:92389cf2106d 57
Rybowonder 5:92389cf2106d 58 void CdisplayItem::DeleteCrect(int x1, int y1, int x2, int y2)
Rybowonder 5:92389cf2106d 59 {
Rybowonder 5:92389cf2106d 60 eraseRec(x1, y1, x2, y2);
Rybowonder 5:92389cf2106d 61 }