#include<process.h>
#include<stdlib.h>
#include<stdio.h>
#include<dos.h>
#include<conio.h>
#define down 80
#define up 72
#define esc 1
#define xy 77
#define xz 75
#define xx 80
#define xs 72
#define altf 33
#define altx 45
#define alte 18
#define altr 19
#define alto 24
#define alth 35
#define alts 31
#define altz 44
#define altm 50
#define enter 28
#define af10 68
int get_key()
{
union REGS rg;
rg.h.ah=0;
int86(0x16,&rg,&rg);
return rg.h.ah;
}
void box(int startx,int starty,int high,int width)
{int i;
gotoxy(startx,starty);
putch(0xda);
for(i=startx+1;i<width;i++) putch(0xc4);
putch(0xbf);
for(i=starty+1;i<high;i++)
{
gotoxy(startx,i);putch(0xb3);
gotoxy(width,i);putch(0xb3);
}
gotoxy(startx+1,width);
putch(0xc0);
for(i=startx+1;i<width;i++) putch(0xc4);
putch(0xd9);
return;
}
main()
{
int i,key,x,y,l,lh,hzb,cx,jt,hqslh[8],f10,zcd=4,xsz,me;
char *zh="File";
char *lf[8];
char *menu[]={"File","Edit","Run","Options","Help","Setup","Zoom","Menu"};
char *red[]={"F","E","R","O","H","S","Z","M"};
char *f[]={"loand file","save file ","print ","modify ","quit alt_x","dfd"};
char *f1[]={"12345 file","save file ","print ","modify ","quit alt_x"};
char *f2[]={"loand file","save file ","print ","modify ","quit alt_x"};
char *f3[]={"loand file","save file ","print ","modify ","quit alt_x"};
char *f4[]={"loand file","save file ","print ","modify ","quit alt_x"};
char *f5[]={"loand file","save file ","print ","modify ","quit alt_x"};
char *f6[]={"loand file","save file ","print ","modify ","quit alt_x"};
char *f7[]={"loand file","save file ","print ","modify ","quit alt_x"};
char buf[16*10*2],buf1[16*2];
textbackground(1);
clrscr();
window(1,1,80,1);
textbackground(15);
textcolor(0);
clrscr();
window(1,1,80,2);
for(i=0,l=0;i<8;i++)
{
x=wherex();
y=wherey();
cprintf(" %s",menu[i]);
l=strlen(menu[i]);
gotoxy(x,y);
textcolor(RED);
cprintf(" %s",red[i]);
x=x+l+4;
gotoxy(x,y);
textcolor(BLACK);
}
hqslh[0]=4;
for(i=0;i<8;i++)
{
zcd=zcd+strlen(menu[i])+4;
hqslh[i+1]=zcd;
}
while(1)
{
f10=0;
key=0;
hzb=0;
lh=4;
cx=0;
while(bioskey(1)==0);
key=get_key();
while(key==af10)
{
while(!f10)
{
textbackground(0);
textcolor(15);
gotoxy(lh,1);
cprintf("%s",menu[hzb]);
key=get_key();
if(key==altx) exit(1);
if(key==xx) {f10=1;break;}
if(key==esc||key==altf||key==alte||key==altr||key==alto||key==alth||key==alts||key==altz||key==altm){cx=1;}
textbackground(15);
textcolor(0);
l=strlen(menu[hzb]);
gotoxy(lh,1);
cprintf("%s",menu[hzb]);
gotoxy(lh,1);
textcolor(RED);
cprintf("%s",red[hzb]);
if(cx) break;
if(key==xy) {lh=lh==63?4:lh+strlen(menu[hzb])+4;hzb=hzb==7?0:hzb+1;}
if(key==xz) {lh=lh==4?63:lh-strlen(menu[hzb-1])-4;hzb=hzb==0?7:hzb-1;}
}
}
xsz=0;
if(f10)
{
switch(hzb)
{
case 0: {for(i=0;i<=8;i++) lf[i]=f[i];lh=hqslh[0];xsz=1;me=0;break;}
case 1: {for(i=0;i<=8;i++) lf[i]=f1[i];lh=hqslh[1];xsz=1;me=1;break;}
case 2: {for(i=0;i<=8;i++) lf[i]=f1[i];lh=hqslh[2];xsz=1;me=2;break;}
case 3: {for(i=0;i<=8;i++) lf[i]=f1[i];lh=hqslh[3];xsz=1;me=3;break;}
case 4: {for(i=0;i<=8;i++) lf[i]=f1[i];lh=hqslh[4];xsz=1;me=4;break;}
case 5: {for(i=0;i<=8;i++) lf[i]=f1[i];lh=hqslh[5];xsz=1;me=5;break;}
case 6: {for(i=0;i<=8;i++) lf[i]=f1[i];lh=hqslh[6];xsz=1;me=6;break;}
case 7: {for(i=0;i<=8;i++) lf[i]=f1[i];lh=hqslh[7];xsz=1;me=7;break;}
}
}
else
{
switch(key)
{
case 33: {for(i=0;i<=8;i++) lf[i]=f[i];lh=hqslh[0];xsz=1;me=0;break;}
case 18: {for(i=0;i<=8;i++) lf[i]=f1[i];lh=hqslh[1];xsz=1;me=1;break;}
case 19: {for(i=0;i<=8;i++) lf[i]=f2[i];lh=hqslh[2];xsz=1;me=2;break;}
case 24: {for(i=0;i<=8;i++) lf[i]=f3[i];lh=hqslh[3];xsz=1;me=3;break;}
case 35: {for(i=0;i<=8;i++) lf[i]=f4[i];lh=hqslh[4];xsz=1;me=4;break;}
case 31: {for(i=0;i<=8;i++) lf[i]=f5[i];lh=hqslh[5];xsz=1;me=5;break;}
case 44: {for(i=0;i<=8;i++) lf[i]=f6[i];lh=hqslh[6];xsz=1;me=6;break;}
case 50: {for(i=0;i<=8;i++) lf[i]=f7[i];lh=hqslh[7];xsz=1;me=7;break;}
}
}
if(key==altx) exit(1);
if(xsz)
{
textbackground(0);
textcolor(15);
gotoxy(lh,1);
if(me==0) {menu[0]=zh;}
cprintf("%s",menu[me]);
gettext(lh,2,lh+15,8,buf);
window(lh,2,lh+15,8);
textbackground(15);
textcolor(0);
clrscr();
window(lh,2,lh+15,9);
box(1,1,7,16);
for(i=2;i<7;i++)
{
gotoxy(2,i);
cprintf("%s",lf[i-2]);
}
gettext(lh,2,lh+16,3,buf1);
textbackground(0);
textcolor(15);
gotoxy(2,2);
cprintf("%s",lf[0]);
y=2;
key=get_key();
while(key!=altx&&key!=enter&&key!=esc)
{
if(key==up||key==down)
{
puttext(lh,y,lh+16,y+1,buf1);
if(key==up) y=y==2?6:y-1;
if(key==down) y=y==6?2:y+1;
gettext(lh,y,lh+16,y+1,buf1);
textcolor(15);
textbackground(0);
gotoxy(2,y);
cprintf("%s",lf[y-2]);
}
key=get_key();
}
if(key==altx) exit(0);
if(key==enter) {printf("hello welcom ");exit(1);}
else
{
puttext(lh,2,lh+15,8,buf);
textbackground(15);
textcolor(0);
window(1,1,80,2);
gotoxy(lh,1);
cprintf("%s",menu[me]);
gotoxy(lh,1);
textcolor(RED);
cprintf("%s",red[me]);
menu[0]=zh;
}
}
}
}
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |