C实现dos图文菜单程序实例

时间:2024-03-27 08:07:25

  前言

公司一台服务器是novell环境,文件管理是基于dos6.22的,客户端启动需要一个图文菜单。

  实现

   编程环境:汉化版TC2.0

菜单基本功能:显示提示项、显示dbf中的行情信息、跑马灯、时间提示。

主要模块:1.汉字的显示 2.dbf库的读取 3.跑马灯显示 4.中断处理

编码如下:

  /*
ver 2.1412051
Author :吴chunyuan
last edit time:2014-12-5
深圳显示行情指数,分 10000点以上Ver 2.1412051 一万点以下 Ver 2.1412052
未解决问题:
1 上海 4s 深圳 3s 行情同时刷新,SHARING_VIOLATION 错误,有待解决,没解决之前,hqsz=1 只刷新深圳行情 2.如行情库是和深圳卫星接收行情同路径,且运行卫星接收程序,则一运行就 提示SHARING_VIOLATION
*/
#include "graphics.h"
#include "stdlib.h"
#include "malloc.h"
#include "bios.h"
#include "stdio.h"
#include "dos.h"
#include "conio.h"
#include "Wumenu.h"
/*void *save;储存一块地方用的*/
void init()
{
int a,b;
/*unsigned size;*/
a=VGA;b=VGAHI;
initgraph(&a,&b,"");
gettime(&now);/*获取时间*/
old=now.ti_sec;
oldhq=old;
oldhq1=old;
/*size=imagesize(1,25,638,476);*/
/*save=malloc(size);开辟存储空间*/ setbkcolor();/*以下是开始界面初始化*/
rectangle(,,,); /*整个画面*/ rectangle(,,,); /* 第二层*/ rectangle(,,,);/* 上海指数*/ rectangle(,,,); /* 深圳指数*/ rectangle(,,,);/*跑马灯,后显示制作人*/ rectangle(,,,);/* 第一层 */
/* rectangle(1,435,565,455);电话输出 */
} main() { char strzt[],strts[],strts1[],strts2[],strts3[],strts4[],c,cshzs[];
/*char strsm1[50],strsm2[50],strsm3[50],strsm4[50],strsm5[50],strsm6[50];*/
char * strsm[];
char * strxm[]={"","","","","",""} ;
/*char * strsm[7]={"111111111111111111111111111110","111111111111111111111111111211","111111111111111111111111111311","111111111111111111111111111411","1111111111111111111111151111111","111111111111111116111111111111"} ;
*/
char * strt1[]={""};
char * strt2[]={""};
char * color[]={"","","","","","","",""} ; /* 主题,菜单字,菜单底色,菜单说明,电话标题,屏幕底色,跑马灯,制作人*/
char * hq[]={""};/*行情设置*/
char * pm[]={""};/*跑马设置*/
char * hqtime[]={""};/*行情刷新时间*/
char * Line;
int a,i,j,LEN,cl,hqsz,hqtimesz,pmsz; FILE *fppy;
init();
i=;
Line=(char *)malloc(); /*值不够大客户端会出现死机*/ if((fppy=fopen("./WucyM1.cfg","rb"))==NULL){
printf("not find file WucyM.cfg ,QQ:41850709 \n");
exit();} fseek(fppy,0L,);
fgets(Line,,fppy);
field(,Line,strzt); /*提取主题*/ fgets(Line,,fppy); for(i=;i<;i++)
{
field(i+,Line,strxm[i]); /*提取菜单项目*/
LEN=i;
if (strlen(strxm[i])<) {strxm[i]='\0';LEN=i- ; break;} } fgets(Line,,fppy); for(i=;i<LEN+;i++)
{
strsm[i]=(char *)malloc();
field(i+,Line,strsm[i]);
} /*提取菜单说明*/ fgets(Line,,fppy);
field(,Line,strt1[]); /*提取电话1*/ fgets(Line,,fppy);
field(,Line,strt2[]); /*提取电话2*/ fgets(Line,,fppy);
field(,Line,strts); /*提取提示*/ field(,Line,strts1); /*提取提示1*/ field(,Line,strts3); /*提取提示3*/ field(,Line,strts4); /*提取提示4*/ field(,Line,strts2); /*提取提示2,服务器名*/ fgets(Line,,fppy);
for(i=;i<;i++)
{
field(i+,Line, shqlj[i]); /*提取行情路径*/
} fgets(Line,,fppy);
for(i=;i<;i++)
{
field(i+,Line, color[i]); /*提取颜色设置*/
} fgets(Line,,fppy);
field(,Line,hq[]); /*提取行情设置*/
field(,Line,pm[]); /*提取跑马*/ fgets(Line,,fppy);
field(,Line,hqtime[]); /*提取行情刷新设置*/
fclose(fppy); hz24(,,,,atoi(color[]),"..证券"); /* 输出主题*/
hz24(,,,,atoi(color[]),strzt); /* 输出主题*/ /*hz24(155,30,1,1,12,"滨海证券滨海营业部客户终端"); */
cl=atoi(color[]); for(i=;i<LEN+;i++)
{hz24(,+i*,,,cl,strsm[i]); free(strsm[i]);
} /* 输出菜单说明*/ cl=atoi(color[]);
hz16(,,cl,"客服电话",);
setcolor();
settextstyle(,HORIZ_DIR,);
outtextxy(,,strt1[]); hz16(,,cl,"故障报修",);
setcolor();
settextstyle(,HORIZ_DIR,);
outtextxy(,,strt2[]); cl=atoi(color[]);
setcolor();
settextstyle(,HORIZ_DIR,);
outtextxy(,,power);/*制作人*/
cl=atoi(color[]);
setcolor(cl);
/*跑马灯*/ /* hz16(284,458,cl,strts,2);
settextstyle(4,HORIZ_DIR,1);
outtextxy(376,463,strts3); hz16(410,458,cl,strts1,2);
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(500,463,strts4);
*/ /*
while(1){
hz16(410,458,cl,strts1,2);
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(500,463,strts4);
sleep(1);
x=x-1;
if (x<=0) x=60;
}
*/ setcolor(); hz16(,,,"沪",);
prhq();
/* 深圳不显示 2014-12-5*/
hz16(,,,"深",);
prhq1(); prtime(); i=; hqtimesz=;
cl=atoi(color[]); /* 菜单字的颜色*/
hqsz=atoi(hq[]); /* 行情设置*/
pmsz=atoi(pm[]); /* 跑马设置*/
hqtimesz=atoi(hqtime[]); /* 行情设置*/ g_pmx=;
new_g_pmx=g_pmx;
setfillstyle(SOLID_FILL,);/*把原来的老时间给去除*/
bar(,,,);
rectangle(,,,);
if (pmsz==)
prpaoma(strts);
else
hz16(,,,strts,); if (hqtimesz==) hqtimesz=; prmenutxt(); for(;;){ i=menu(,,,strxm,cl,,hqsz,hqtimesz,strts2,strts,pmsz);
switch(i){
case : closegraph(); exit();
case :closegraph(); exit();
case :closegraph(); exit();
case :closegraph(); exit();
case :closegraph(); exit();
case :closegraph(); exit();
case :closegraph(); exit(); }
} /* closegraph();*/ /* free(save);*/
}

wumenu.h

 /*
ver 2.131016
Author :吴chunyuan
last: 2014-12-5
版本提示 键F1 或PAGEDOWN
menu 增加hqsz 参数, 0-不更新 1-更新深圳 2-更新上海 3 -深圳上海都更新 4- 15:00后更新
解决上海深圳行情更新问题: outzs 等变量char * 改为 char outzs[ ]-20130115
2013-11-13 实现跑马灯prpaoma()
2013-11-21 增加跑马灯是否滚动设置
*/
char power[]="Author Wuchunyuan" ;/*Author*/
struct time now;/*这里的变量都是时间有关*/
int g_pmx,old_g_pmx,new_g_pmx,old,new1,oldhq,newhq,oldhq1,newhq1; char ss[],sssh[],sssz[]; /*输出时间 行情*/
char outzs1[];
char outdq1[] ; /* sh */
char outkp1[]; /* sh */
char outzs[];
char outdq[] ;
char outkp[];
float fshzs,fszzs,shzf,szzf;
char * shqlj[]={"",""} ;
FILE *fppy1;
char * Line1;
char strt1[] ;
char strt2[] ;
FILE *fpsh;
char *strsh;
char fnamesh[];
FILE *fp1;
char *str1;
char fname1[];
FILE *fprd;
char *strrd;
static void forcefloat(float * p) /* 解决atof () floating point formats not linked错误*/
{
float f =*p;
forcefloat(&f);
}
int prtime()/*输出时间的函数*/
{
gettime(&now);
new1=now.ti_sec;
if(abs(new1-old)>=)
{
setfillstyle(SOLID_FILL,);/*把原来的老时间给去除*/
bar(,,,);
old=new1;
sprintf(ss,"%02d:%02d:%02d",now.ti_hour,now.ti_min,now.ti_sec);
setcolor();
settextstyle(DEFAULT_FONT,HORIZ_DIR,);
outtextxy(,,ss);
if (strcmp(ss,"15:00:00")<) return ;
else return ;
}
} void cut(char buf[]) /*去掉串中非数字字符*/
{
int j,i;
char s[];
i=;
j=;
while(buf[i] )
{ if ( buf[i]=='' || buf[i]=='' ||buf[i]=='' || buf[i]=='' ||buf[i]=='' || buf[i]=='' ||buf[i]=='' || buf[i]==''||buf[i]=='' || buf[i]=='' ||buf[i]=='.' )
s[j++]=buf[i++]; else{
s[j]='\0';
strcpy(buf,s);
return;}
}
} int foutzs1() /*上海行情*/ {
unsigned int recno, headlength,reclength;
/*unsigned long recnumber;*/
unsigned char t1,t2,t3,t4;
/*outzs=(char *)malloc(8);
outkp=(char *)malloc(8);
outdq=(char *)malloc(8);*/
strsh=(char *)malloc(); /*show2003-265*/
strcpy(fnamesh,shqlj[]);
if((fpsh=fopen(fnamesh,"rb"))==NULL){
/*printf("Open File error:%s\n",fnamesh);*/
setfillstyle(SOLID_FILL,);/*把原来的老行情给去除*/ bar(,,,);
outtextxy(,,"not file"); return -;} fseek(fpsh, 4L,);/*计算记录个数 recnumber */ fscanf(fpsh, "%c%c%c%c", &t1,&t2,&t3,&t4);
/*recnumber=t1+t2*0x100+t3*0x10000+t4*0x1000000;*/ fseek(fpsh, 8L, ); /*计算文件头长度 headlength */ fscanf(fpsh, "%c%c", &t1,&t2);
headlength=t1+t2*0x100;
fseek(fpsh,10L,); /*计算记录长度 reclength */ fscanf(fpsh, "%c%c", &t1,&t2);
reclength=t1+t2*0x100; fseek(fpsh,headlength+reclength, );/*将文件指针定位到第二记录开始处*/ fgets(strsh, reclength+, fpsh);/*取第二行*/
/*rewind(fpsh);*/
strncpy(outzs,strsh+,); strncpy(outkp,strsh+,); strncpy(outdq,strsh+,); /*cut(outkp);
cut(outzs);
cut(outdq);*/
free(strsh);
fclose(fpsh);
return ; } int foutzs2() /*深圳行情*/ {
unsigned int recno, headlength,reclength;
/*unsigned long recnumber;*/
unsigned char t1,t2,t3,t4; str1=(char *)malloc(); strcpy(fname1,shqlj[]);
/* outzs1=(char *)malloc(12);
outkp1=(char *)malloc(12);
outdq1=(char *)malloc(12);*/ if((fp1=fopen(fname1,"rb"))==NULL){
/*if((fp1=fopen("n:\\/vsat/SJSZS.DBF","rb"))==NULL){
/* printf("Open File error\n");*/ setfillstyle(SOLID_FILL,);/*把原来的老行情给去除*/ bar(,,,);
outtextxy(,,"not file"); return -;} fseek(fp1, 4L,) ; fscanf(fp1, "%c%c%c%c", &t1,&t2,&t3,&t4);
/*recnumber=t1+t2*0x100+t3*0x10000+t4*0x1000000;*/
fseek(fp1, 8L, );/*计算文件头长度 headlength*/
fscanf(fp1, "%c%c", &t1,&t2);
headlength=t1+t2*0x100;
fseek(fp1,10L,); /*计算记录长度 reclength*/
fscanf(fp1, "%c%c", &t1,&t2);
reclength=t1+t2*0x100;
fseek(fp1,headlength, );/*将文件指针定位到第一记录开始处*/ fgets(str1, reclength+, fp1);
/* rewind(fp1);*/
strncpy(outzs1,str1+,); strncpy(outkp1,str1+,);
strncpy(outdq1,str1+,);
/*cut(outdq1);
cut(outzs1);
cut(outkp1); */
free(str1);
fclose(fp1);
return ;
} void prhq(int n)/*输出上海实时行情的函数*/
{
gettime(&now);
newhq=now.ti_sec; if(abs(newhq-oldhq)>=n)/*刷新间隔n秒*/
{
oldhq=newhq;
if (foutzs1()==) { if (strcmp(outdq,outzs)>)
setcolor(); else
setcolor(); fshzs=atof(outdq)-atof(outzs);
shzf=(fshzs/atof(outzs))*;
sprintf(sssh,"%4.2f%s",shzf,"%");
setfillstyle(SOLID_FILL,);/*把原来的老行情给去除*/
bar(,,,);
bar(,,,);
outtextxy(,,outdq);
outtextxy(,,sssh);}
setcolor();
/*free(outzs);
free(outkp);
free(outdq); */
} ; } void prhq1(int n)/*输出实时深圳行情的函数*/
{
gettime(&now);
newhq1=now.ti_sec;
if(abs(newhq1-oldhq1)>=n)/*刷新间隔n秒*/
{
oldhq1=newhq1;
if (foutzs2()==) { setfillstyle(SOLID_FILL,);/*把原来的老行情给去除*/
bar(,,,);
bar(,,,);
if (strcmp(outdq1,outzs1)==)
setcolor();
if (strcmp(outdq1,outzs1)>)
setcolor();
if (strcmp(outdq1,outzs1)<)
setcolor();
fszzs=atof(outdq1)-atof(outzs1);
szzf=(fszzs/atof(outzs1))*;
sprintf(sssz,"%4.2f%s",szzf,"%");
outtextxy(,,outdq1);
outtextxy(,,sssz);
/* free(outzs1);
free(outkp1);
free(outdq1);*/
setcolor();
} ;
}
} int counttab(char tab,char s[]) /*计算字符串中分符数量*/
{
int i,num;
char c; i=;num=;
while((c=s[i++])!='\0'){ if (c==tab) num++;
} return num; } void getoneline(char Line[]) /*读文本1行*/
{
int i;
i=;
while(Line[i]!='\n') i++;
Line[i]='\0';
} void field(int n,char buf[],char s[]) {
int i,j;
i=;
while(n> && buf[i]!='\n' &&buf[i]!='\t' && buf[i]!=){
if(buf[i]==',' || buf[i]=='|') n--;
i++;
}
j=;
while(buf[i] && buf[i]!=',' && buf[i]!='\t' && buf[i]!='|' && buf[i]!='\n') s[j++]=buf[i++];
s[j]='\0';
} void hz16(int x,int y,int color,char *s,int bit)
{
FILE *fp;
char buffer[];/*buffer用来存储一个汉字 */
char q[];
register m,n,i,j,k;
unsigned char qh,wh;
unsigned long offset;
int ROW,COL;
/*#define ROW 1/*纵坐标放大倍数*
#define COL 2/*横坐标放大倍数*/ ROW=;
COL=; if ((fp=fopen("./HZK16","rb"))==NULL){
printf("Can't open hzk16\n");
return;
} while(*s)
{
qh=*(s)-0xa0;/*汉字区位码 */
wh=*(s+)-0xa0;
if( qh>= && qh<=0x5e&& qh!=0x08) {
offset=(*(qh-)+(wh-))*32l ; /*计算该汉字在字库中偏移量 */
fseek(fp,offset,SEEK_SET);
fread(buffer,,,fp);/*取出汉字32字节的点阵字模存入buffer中(一个汉字)*/
for (i=;i<;i++) /*将32位字节的点阵按位在屏幕上打印出来(1:打印,0:不打印),显示汉字 */
for(n=;n<ROW;n++)
for(j=;j<;j++)
for(k=;k<;k++)
for(m=;m<COL;m++)
if (((buffer[i*+j]>>(-k))&0x1)!=NULL)
putpixel(x+*j*COL+k*COL+m,y+i*ROW+n,color);
s+=; /*因为一个汉字内码占用两个字节,所以s必须加2 */
x+=; /*字间隔*/
} else{
moveto(x,y);
*q=*s; *(q+)='\0';
settextstyle(DEFAULT_FONT,HORIZ_DIR,bit);
setcolor(color);
if(bit==){
outtextxy(x,y+,q);
x+=;
}
if(bit==){
outtextxy(x,y+,q);
x+=;
}
s++;
settextstyle(DEFAULT_FONT,HORIZ_DIR,);
}
} fclose(fp);
} void prpaoma(char ss[])/*跑马*/
{
/* char outss[150];
int sslen,fontss;
sslen=strlen(ss);
fontss=sslen/2-g_pmx/20 ;
strncpy(outss,ss,fontss);*/ /* hz16(410,458,cl,strts1,2);
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(500,463,strts4);*/
setfillstyle(SOLID_FILL,);/*把原来的老时间给去除*/
bar(,,,); /*sprintf(ss,"13822527544");
sprintf(outss,"%03d-%03d",g_pmx,sslen);
outtextxy(500,63,outss);
hz16(410,458,cl,strts1,2); /*跑马灯*/ settextstyle(DEFAULT_FONT,HORIZ_DIR,);
if (new_g_pmx>=) {
hz16(,,,ss,);
delay();
}else
hz16(+new_g_pmx,,,ss,); settextstyle(DEFAULT_FONT,HORIZ_DIR,); rectangle(,,,);
delay();
/*sleep(1);*/
} void init1()/*按F1时*/
{ setfillstyle(SOLID_FILL,);/*把原来的给去除*/
bar(,,,); setcolor();
outtextxy(,,"Author:WuChunYuan ver2.131121");/*制作人*/
hz16(,,,"深",);
hz16(,,,"沪",);
rectangle(,,,); /*整个画面*/ rectangle(,,,); /* 第二层*/ rectangle(,,,);/* 上海指数*/ rectangle(,,,); /* 深圳指数*/ rectangle(,,,);/*跑马灯,后显示制作人*/ setfillstyle(SOLID_FILL,);/* F1给去除*/
bar(,,,); setfillstyle(SOLID_FILL,);/*把主题去除*/
bar(,,,); setfillstyle(SOLID_FILL,);/*把 给去除*/
bar(,,,); } void reader()
{ int i; unsigned char t1,t2,t3,t4; init1(); if ((fprd=fopen("./wucym.txt","r"))==NULL){
printf("Can't open \n");
return;
} strrd=(char *)malloc();
fseek(fprd,0L,);
for (i=;i<;i++){
fgets(strrd,,fprd); hz16(,+i*,,strrd,); }
free(strrd);
fclose(fprd);
} void hz24(int x0,int y0,int tx,int ty,int color,char *str)
{
FILE *fp;
int j,k,a,b;
long int num_bytes;
char qm,wm;
char q[];
int t;
int bit=;
int x,y,m;
char ch;
char *data; if ((fp=fopen("./HZK24K","rb"))==NULL){
printf("Can't open hzk24\n");
return;
} x=x0;
y=y0;
while(*str)
{k=-;x=x+; qm=*str-0xa0; wm= *(str+)-0xa0;
if( qm>= && qm<=0x5e) /* && wm>=0x5e*/
{
data=(char *)malloc();
num_bytes=((long)((qm)-)*+(wm)-)*; fseek(fp,num_bytes,SEEK_SET);
fgets(data,,fp); do{
k=k+; for(t=;t<tx;t++){
for(a=;a<;a++,k=k+){
for(j=;j<;j++){
data[k]=data[k]&;
ch=data[k]&(char)bit;
for(b=;b<ty;b++){
if (ch) putpixel(x,y,color);
y++;
bit>>=;
}
}
bit=0x80;
}
x=x+;y=y0;k=k-;}
}while(k<);
str+=;
free(data);
}
else{
moveto(x,y);
*q=*str; *(q+)='\0';
setcolor(color);
settextstyle(DEFAULT_FONT,HORIZ_DIR,);
outtextxy(x,y+,q);
x+=;str++;
settextstyle(DEFAULT_FONT,HORIZ_DIR,);
}
}
fclose(fp); } void prver(int n)/*输出版本号*/
{
setfillstyle(SOLID_FILL,);/*把原来的给去除*/
bar(,,,); if (n==){
hz16(,,,"Ver2.1412051 吴春源编写,SVN:",);
}
if (n==)
{
hz16(,,,"最新编译时间:20141205,吴春源编写",);
}
} void boxb(int sx,int sy,int ex,int ey,int color,int style)
{
setcolor(color);
line(sx,sy,ex,sy);
line(ex,sy,ex,ey);
line(ex,ey,sx,ey);
line(sx,ey,sx,sy);
setfillstyle(style,color);
floodfill(sx+,sy+,color);
} void butt2(x,y,c,k,str,cailenth,color,w)
int x,y,c,k,cailenth,color,w;
char *str;
{int ex;
int ey;
int *p,*p1;
if(w<)w=;
ey=y+w;
ex=x+cailenth;
boxb(x,y,ex,ey,,);
boxb(x+,y+,ex-,ey-,,);
boxb(x+,y+,ex-,ey-,c,);
setcolor();
rectangle(x+,y+,ex-,ey-);
setcolor();/**/
setlinestyle(,,);
rectangle(x+,y+,ex-,ey-);
line(x+,y+,x+,y+);
line(x+,ey-,x+,ey-);
line(ex-,ey-,ex-,ey-);
line(ex-,y+,ex-,y+);
if (*str<&&*str>-)
hz24(x+,y+,,,color,str);
else
outtextxy(x+cailenth/,y+,str);
if(k!=){
p=(int *) malloc(imagesize(x+,y+,ex-,ey-));
getimage(x+,y+,ex-,ey-,p);
p1=(int *) malloc(imagesize(x+,y+,ex-,ey-));
getimage(x+,y+,ex-,ey-,p1);
putimage(x+,y+,p,XOR_PUT);
putimage(x+,y+,p1,COPY_PUT);
delay();
putimage(x+,y+,p,COPY_PUT); free(p); free(p1);}
} void prmenutxt(int n)
{
int i ;
Line1=(char *)malloc(); /*值不够大客户端会出现死机*/ if((fppy1=fopen("./WuMtxt.cfg","rb"))==NULL){
printf("not find file WuMtxt.cfg ,QQ:41850709 \n");
exit();} fseek(fppy1,0L,); for(i=;i<n;i++)
fgets(Line1,,fppy1); field(,Line1,strt1); /*提取说明1*/
field(,Line1,strt2); /*提取说明1*/
setfillstyle(SOLID_FILL,);
bar(,,,);
bar(,,,);
/*把原来的给去除 SOLID_FILL 1 EMPTY_FILL 0 以背景颜色填充 */
hz16(,,,strt1,);
hz16(,,,strt2,);
free(Line1);
fclose(fppy1);
} int menu(int x0,int y0,int n,char **str,int color,int w,int hq,int hqtimesz,char servts[],char pmd[],int pmsz1)
{
int ifhq,i,x,y,m1,m0=;
int ex,ey,k,j,pmi;
union{
int i;
char ch[];
}c;
x=x0;y=y0; for(k=;str[k]!=NULL;k++){
m1=strlen(str[k])/;
if(m1>m0) m0=m1;} m0=m0*+; for(k=;str[k]!=NULL;k++)
if(n==)
butt2(x+k*m0,y,,,str[k],m0,color,w);
else
butt2(x,y+k*(w+),,,str[k],m0,color,w); if(n==&&m0*k+x-k>){
hz24(,,,,,"menu item too many");
return -;} j=i=;c.i=; for(;c.ch[]!=;){ /* 28=1c 回车*/
if (n==){
butt2(x+j*m0,y,,,str[j],m0,color,w);
butt2(x+i*m0,y,,,str[i],m0,color,w);
}
else {
butt2(x,y+j*(w+),,,str[j],m0,color,w);
butt2(x,y+i*(w+),,,str[i],m0,color,w);
} j=i; while(!kbhit()) /* 输出时间行情*/ /*功 能及返回值: 检查当前是否有键盘输入,若有则返回一个非0值,否则返回0*/
{
/* qh=1-只更新深圳 行情 2 -只更新上海 3-两市场行情都更新 4- 15:00后更新 */ new_g_pmx=new_g_pmx-;
old_g_pmx=new_g_pmx;
if(pmsz1==)
prpaoma(pmd);
if (new_g_pmx<= ) new_g_pmx=; ifhq=prtime();
if (hq==)
prhq1(hqtimesz);
if (hq==)
prhq(hqtimesz);
if (hq==) {
prhq1(hqtimesz);
prhq(hqtimesz);
} if (hq== && ifhq==) {
prhq1(hqtimesz);
prhq(hqtimesz);
} } /* int bioskey(int cmd);
当cmd为1时,bioskey()检测是否有键按下。没有键按下时返回0;有键按下时返回按键码(
任何按键码都不为0),但此时并不将检测到的按键码从键盘缓冲队列中清除。 是非阻塞参数。
当cmd为0时,bioskey()返回键盘缓冲队列中的按键码,并将此按键码从键盘缓冲队列中清
除。如果键盘缓冲队列为空,则一直等到有键按下,才将得到的按键码返回。是阻塞调用。 */
c.i=bioskey(); switch(c.ch[]){
case : /*左箭头*/ prver();
hz16(,,,servts,); if(n==) i--; break;
case : /*右箭头*/ if(n==) i++; break;
case : /*上键*/ if(n!=) i--;
if(i>=)
prmenutxt(i+); break; case : /*下键*/ if(n!=) i++;
if(i<)
prmenutxt(i+); break; case :return ; case : /*PageDown*/ prver(); hz16(,,,servts,);
break; case : /*F1*/ reader();
prver();
break; default: prmenutxt(i+); break;} if(i<) i=;
if(j<) j=;
if(i>=k) i=k-;} /* for /* 28=1c 回车 -end */ outtextxy(,,""); if(n==)
butt2(x+i*m0,y,,,str[i],m0,color,w); else
butt2(x,y+(w+)*i,,,str[i],m0,color,w);
outtextxy(,,""); return i+; }

相关文章