c语言文本编辑器源代码 含窗口,关于文本编辑器

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

#include

#include

#include

#include

#include

#include

#define DOWN     0x5000

#define UP       0x4800

#define ESC      0x011b

#define ALT_F    0x2100

#define ALT_X    0x2d00

#define ENTER    0x1c0d

void box(int startx,int starty,int high,int width);

main()

{

int i,key,x,y,l;

char *menu[]={"File","Edit","Run","Compile","Project","Options","Window","Help"};

char *red[]={"F","E","R","C","P","O","W","H"};

char *f[]={"New file","Load file","Save","Save as...","Quit      Alt_x"};

char buf[16*8*2],buf1[16*2];

while(1)

{

textmode(C80);

textbackground(BLUE);

clrscr();

window(1,1,80,1);

textbackground(LIGHTGRAY);

textcolor(BLACK);

clrscr();

gotoxy(5,1);

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+2;

gotoxy(x,y);

textcolor(BLACK);

}

gotoxy(5,1);

key=bioskey(0);

switch(key){

case ALT_X:

exit(0);

case ALT_F:

{

textbackground(BLACK);

textcolor(WHITE);

gotoxy(5,1);

cprintf("%s",menu[0]);

gettext(4,2,19,9,buf);

window(4,2,19,9);

textbackground(CYAN);

textcolor(BLACK);

clrscr();

box(1,3,9,16);

for(i=2;i<7;i++)

{

gotoxy(2,i);

cprintf("%s",f[i-2]);

}

gettext(4,3,19,3,buf1);

textbackground(BLACK);

textcolor(WHITE);

gotoxy(2,2);

cprintf("%s",f[0]);

gotoxy(2,2);

y=2;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值