⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 etgbrow.c

📁 以前做的泰国瓦楞纸板生产线监控系统
💻 C
字号:
#include "svgacc.h"
#include <dos.h>
#include <bios.h>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <io.h>
#include <time.h>
#include <string.h>

#define enter 13
#define esc 27
#define ESC 27
#define BACKSPACE 8
#define ENTER 13
#define kbF1 187
#define kbF2 188
#define kbF3 189
#define kbF4 190
#define kbF5 191
#define kbF6 192
#define kbF7 193

#define kbUp 200
#define kbDn 208
#define kbCtrlE 5
#define kbCtrlZ 26

#define BLACK 0
#define lBLUE 1
#define lGREEN 2
#define lCYAN 3
#define lRED 4
#define lPINK 5
#define lYELLOW 6
#define lWHITE 7
#define GRAY 8
#define BLUE 9
#define GREEN 10
#define CYAN 11
#define RED 12
#define PINK 13
#define YELLOW 14
#define WHITE 15

static char ASCbuf[4096];
static char buf11[80];
static char buf12[80];
FILE *fpHZ;

void drwstr(char *s,int x,int y,int m,int n,unsigned char col,PixelMode mode);
void drwbutton(char *phstr,char *str,int x,int y,PixelMode i,int col11);

int getkey(void);
void main(void)
{ 
 int ok;
 int j;
 char fname[8];
 char bufg[8];
 FILE *fp;

 if ((fpHZ=fopen("hzk16","rb"))==NULL)
   { printf("open hzk16 error\n");
    exit(0);
    }
 if ((fp=fopen("asc16","rb"))==NULL)
    { printf("open file error");
    exit(1);
    }
 if (fgets(ASCbuf,4096,fp)==NULL)
    {
      printf("error");
      exit(1);
    }
 whichvga();
 res800();
 ok=0;
/* windows(0,0,800,600); */
/* ͼͷ */
   
   drwbox(SET,lPINK,0,0,800,600);
   drwfillbox(SET,GRAY,1,1,799,599);
   drwline(SET,RED,1,70,799,70);

   strcpy(buf11,"Browse of finished orders");
   drwstr(buf11,200,18,2,2,RED,SET);
   drwstr(buf11,202,19,2,2,BLACK,SET);

   strcpy(buf11," SN ");
   drwfillbox(SET,CYAN,1,71,36,90);
   drwstr(buf11,5,73,1,1,lPINK,SET);
   strcpy(buf11," OrdID");
   drwfillbox(SET,CYAN,38,71,89,90);
   drwstr(buf11,40,73,1,1,lPINK,SET);
 
 
 
   strcpy(buf11,"Paper");
   drwfillbox(SET,CYAN,91,71,428,90);
   drwstr(buf11,223,73,1,1,lPINK,SET);

   strcpy(buf11,"W");
   drwfillbox(SET,CYAN,430,71,465,90);
   drwstr(buf11,444,73,1,1,lPINK,SET);

   strcpy(buf11,"Sec.");
   drwfillbox(SET,CYAN,467,71,502,90);
   drwstr(buf11,469,73,1,1,lPINK,SET);

   strcpy(buf11,"L");
   drwfillbox(SET,CYAN,504,71,539,90);
   drwstr(buf11,520,73,1,1,lPINK,SET);

   strcpy(buf11,"Qty");
   drwfillbox(SET,CYAN,541,71,592,90);
   drwstr(buf11,555,73,1,1,lPINK,SET);

   strcpy(buf11,"Date");
   drwfillbox(SET,CYAN,594,71,661,90);
   drwstr(buf11,612,73,1,1,lPINK,SET);

   strcpy(buf11,"Time");
   drwfillbox(SET,CYAN,663,71,730,90);
   drwstr(buf11,681,73,1,1,lPINK,SET);

   strcpy(buf11,"Finished");
   drwfillbox(SET,CYAN,732,71,799,90);
   drwstr(buf11,734,73,1,1,lPINK,SET);

   drwfillbox(SET,RED,1,509,799,510);

   strcpy(buf12,"Home");
   strcpy(buf11,"  First  ");
   drwbutton(buf12,buf11,23,530,SET,44);
   strcpy(buf12,"End");
   strcpy(buf11,"  Last   ");
   drwbutton(buf12,buf11,134,530,SET,44);
   strcpy(buf12,"PgUp");
   strcpy(buf11," Up-Page ");
   drwbutton(buf12,buf11,245,530,SET,44);
   strcpy(buf12,"PgDn");
   strcpy(buf11,"Down-Page");
   drwbutton(buf12,buf11,356,530,SET,44);
   strcpy(buf12,"Up");
   strcpy(buf11," Previous");

   drwbutton(buf12,buf11,467,530,SET,44);
   strcpy(buf12,"Dn");
   strcpy(buf11,"  Next  ");
  
   drwbutton(buf12,buf11,578,530,SET,44);

   strcpy(buf12,"ESC");
   strcpy(buf11,"  EXIT  ");
   drwbutton(buf12,buf11,683,530,SET,44);


    strcpy(fname,"ebrow.pcx");
    pcxmake(0,0,799,599,fname);

 while(!ok)
  {  
  while (kbhit())
     {j=getkey();
      switch (j)
       {case esc:
             {ok=1;
              break;
             }
        case enter:
            ok=0;     
       }
     }
     sdelay(60);  
     _strtime(bufg);
   } 
  
  fclose(fpHZ);
 
  restext();
  }
int getkey(void)
{ union REGS in,out;
  in.h.ah=0x8;
  int86(0x21,&in,&out);
  if(out.h.al==0)
   return getkey()+128;
  else
   return out.h.al;
}
void drwstr(char *s,int x,int y,int m,int n,
          unsigned char col,PixelMode mode)
 { unsigned char dot[16][2];
   long offset1;
   register i,j,k,mm,nn,mask;

    while(*s)
     { offset1=(long)(*s)*16;
       s+=1;
       j=0;
       for(i=0;i<=15;i++)
         { dot[i][j]=ASCbuf[offset1+i];
           mask=0x80;
           for(k=0;k<=7;k++)
             {if (dot[i][j]&mask)
               {for(nn=0;nn<n;nn++)
                 {for(mm=0;mm<m;mm++)
                  drwpoint(mode,col,x+(j*8+k)*n+nn,y+i*m+mm);
                 }
               }
               mask=mask>>1;
              }
         }
       x+=8*n;
     }
}


void drwbutton(char *phstr,char *str,int x,int y,PixelMode i,int col11)
{
  int k,j;
  int xn,yn;
  k=strlen(phstr);
  j=strlen(str);
  xn=x+j*8+26;
  yn=y+2+16+14+16+2;
  
drwline(i,7,x,y,xn,y);
drwline(i,7,x,y-1,xn+1,y-1);
drwline(i,7,x,y-2,xn+2,y-2);
drwline(i,7,x,y-2,x,yn);
drwline(i,7,x-1,y-2,x-1,yn+1);
drwline(i,7,x-2,y-2,x-2,yn+2);
drwline(i,0,xn+2,y-1,xn+2,yn+2);
drwline(i,0,xn+1,y,xn+1,yn+2);
drwline(i,0,xn,y+1,xn,yn+2);
drwline(i,0,x-1,yn+2,xn+2,yn+2);
drwline(i,0,x,yn+1,xn+2,yn+1);
drwline(i,0,x+1,yn,xn+2,yn);
drwfillbox(i,col11,x+1,y+1,xn-1,yn-1);
drwstr(phstr,x+(xn-x)/2-k*16/2+3,y+4,1,2,BLACK,i);                 /*x+(j*16)/2-(8*k)/2,y+2,1,1,0,i);*/
/*drwstring(i,5,8,text7,732,554); */
drwstr(str,x+2+11,y+2+16+14,1,1,RED,i);
}
void drwhz24str(char *s,int x,int y,int m,int n,
             int col,int mode)
 { unsigned char dot[24][3],qm,wm;
   long offset1;
   register i,j,k,mm,nn,mask;
   FILE *fpHZ;

   if((fpHZ=fopen("hzk24k","rb"))==0)
     {printf("Error: HZK24K can't open.\n");
      exit(0);
     }
   while(*s)
     { qm=(unsigned char)(s[0]-0xa0);
       s+=1;
       wm=(unsigned char)(s[0]-0xa0);

       offset1=((long)(qm-16)*94+(long)(wm-1))*72L;
       s+=1;
       fseek(fpHZ,offset1,SEEK_SET);
       for(i=0;i<24;i++)
        {for(j=0;j<3;j++)
         { dot[i][j]=(unsigned char)(fgetc(fpHZ));
           mask=0x80;
           for(k=0;k<=7;k++)
             {if (dot[i][j]&mask)
               {for(nn=0;nn<n;nn++)
                 {for(mm=0;mm<m;mm++)   
                 drwpoint(mode,col,x+i*2,y+(j*8+k));

                 }    
               }  
               mask=mask>>1;
              }
         }
        }
       x+=48;
     }
 fclose(fpHZ);
}           

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -