000
23.09.2007, 21:02 Uhr
~STEINI
Gast
|
HI ich brauche dringen hilfe, denn ich proge gerade ein menue dass man mit den pfeilen bedienen kann.... aber es tut sich dabei nichts wenn man sie benutzt... hier der code:
C++: |
#include <stdio.h> #include <conio.h> #include <stdlib.h> #include <iostream.h>
#define Hoch 72 #define Runter 80 #define Esc 27 #define Enter 13
int test1() { cout<<"test1"; } ; int test2() { cout<<"test2"; } ;
bool Menue() {
int x,y; int iPos = 1; char cCommand; bool bEingabe = true;
textbackground(WHITE); textcolor(BLACK); clrscr();
gotoxy(8,7); textbackground(LIGHTGREEN); cout << ">"; textbackground(WHITE); cout << " TEST1";
gotoxy(8,9); textbackground(WHITE); cout << ">"; textbackground(WHITE); cout << "TEST2";
gotoxy(8,11); textbackground(WHITE); cout << ">"; textbackground(WHITE); cout << " Beenden";
_setcursortype(_NOCURSOR);
while(bEingabe) {
cCommand = getch();
if(cCommand == 0) {
cCommand = getch();
if(cCommand == 72) {
if(iPos > 1) { gotoxy(8, (iPos * 2) + 5); textbackground(WHITE); cout << ">";
iPos--; gotoxy(8, (iPos * 2) + 5); textbackground(LIGHTGREEN); cout << ">"; } } else if(cCommand == 80) {
if(iPos < 3) { gotoxy(8, (iPos * 2) + 5); textbackground(WHITE); cout << ">";
iPos++; gotoxy(8, (iPos * 2) + 5); textbackground(LIGHTGREEN); cout << ">"; } } } else if(cCommand == 13) { bEingabe = false; } }
switch(iPos) { case 1: test1(); return true;
case 2: ; test2(); return true;
case 3: //beenden; return false; }
}
int main(int argc, char *argv[]) { Menue(); }
|
please help
mfg STEINI |