From: b Date: Tue, 9 Jul 2013 12:39:00 +0000 (+0200) Subject: - Added mouse support X-Git-Tag: v1.2a X-Git-Url: http://bicyclesonthemoon.info/git-projects/?a=commitdiff_plain;h=563e907817ab91b466b837af017c15545e45cdda;p=cpied - Added mouse support --- diff --git a/NAPISY.CPP b/CPIED.CPP similarity index 52% rename from NAPISY.CPP rename to CPIED.CPP index 4ccbf74..b729702 100644 --- a/NAPISY.CPP +++ b/CPIED.CPP @@ -7,6 +7,9 @@ #include #include +#define resetMaus setMaus + +//Strustures in the CPI file format struct FontFileHeader { unsigned char id0; @@ -102,6 +105,7 @@ struct ScreenFontBitmap8 int byo14[16]; int byo16[16]; int wys=8; + int prew; int cp=0; int lit=0x42; int pre; @@ -111,8 +115,118 @@ struct ScreenFontBitmap8 int prey; int key; int tab=0; + int pret; int any=0; char abc[17]="0123456789ABCDEF"; + REGS iR; + REGS oR; + SREGS sR; + int maus=0; + int mausv=1; + int mausx; + int mausy; + //int premx; + //int premy; + int klik; + int prek; + + +void showMaus(); +void hideMaus(); +int setMaus(); +void getMaus(int *x,int *y,int *k); + +void nullpointers(); +void offset(); + +void new8 (); +void menu8(); +void cpwys(); + +void displayDialog(int color, char *text, int type=0); +int message (char *text, char *value, int type=1); +void question (char *text, char *result); +unsigned question (char *text); + +void ramka8 (); +void ramka14(); +void ramka16(); +void lin8 (int mode=0); +void lin14(int mode=0); +void lin16(int mode=0); +void lit8 (int mode=0); +void lit14(int mode=0); +void lit16(int mode=0); + +void spc8 (); +void spc14(); +void spc16(); +void bsp8 (); +void bsp14(); +void bsp16(); +void ent8 (); +void ent14(); +void ent16(); + +int otw(); +int otw2(); + +int zap(); +int zap2(); + +int zmn(); + +int newCPI (); +int newCPI2(short CP, short h); + +void deleteCPI(short st=6,short a=0,short b=0); + +int newCP (); +int newCP2(short CP,short h); + +int delCP(); + +int newF (); +int newF2 (short h); +int newF8 (short CP); +int newF14(short CP); +int newF16(short CP); + +int delF (); +int delF8 (short h); +int delF14(short h); +int delF16(short h); + +int main(int argc,char* argv[]); + +void showMaus() +{ + iR.x.ax=0x0001; + int86(0x33,&iR,&oR); +} + +void hideMaus() +{ + iR.x.ax=0x0002; + int86(0x33,&iR,&oR); +} + +int setMaus() +{ + iR.x.ax=0x0000; + oR.x.ax=0x0000; + int86(0x33,&iR,&oR); + return oR.x.ax; +} + +void getMaus(int *x,int *y,int *k) +{ + iR.x.ax=0x0003; + int86(0x33,&iR,&oR); + *y=oR.x.dx; + *x=oR.x.cx; + *k=oR.x.bx; +} void nullpointers() { @@ -163,7 +277,7 @@ void offset() } } -void deleteCPI(short st=6,short a=0,short b=0) +void deleteCPI(short st,short a,short b) { short i,j; switch(st) @@ -274,9 +388,9 @@ void new8() cleardevice(); setcolor(GREEN); - outtextxy(0,0, "Edytor napis¢w±"); + outtextxy(0,0, "CPI editor 1.2±"); outtextxy(0,8, "±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±"); - outtextxy(600,16,"v1.1b"); + //outtextxy(600,16,"v1.2a"); } void menu8() { @@ -296,10 +410,30 @@ void cpwys() outtextxy(0x78,0,"ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ"); if(any) { - if(strlen(nazwap)<52) - sprintf(cpw,"°cp%03u°8x%02d°%s°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°",CPEH[cp]->codepage,wys,nazwap); + if((unsigned)(CPEH[cp]->codepage)>=1000) + { + if((unsigned)(CPEH[cp]->codepage)>=10000) + { + if(strlen(nazwap)<52) + sprintf(cpw,"°cp%03u°8x%02d°%s°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°",CPEH[cp]->codepage,wys,nazwap); + else + sprintf(cpw,"°cp%03u°8x%02d°path too long°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°",CPEH[cp]->codepage,wys); + } + else + { + if(strlen(nazwap)<52) + sprintf(cpw,"°°cp%03u°8x%02d°%s°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°",CPEH[cp]->codepage,wys,nazwap); + else + sprintf(cpw,"°°cp%03u°8x%02d°path too long°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°",CPEH[cp]->codepage,wys); + } + } else - sprintf(cpw,"°cp%03u°8x%02d°path too long°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°",CPEH[cp]->codepage,wys); + { + if(strlen(nazwap)<52) + sprintf(cpw,"°°°cp%03u°8x%02d°%s°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°",CPEH[cp]->codepage,wys,nazwap); + else + sprintf(cpw,"°°°cp%03u°8x%02d°path too long°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°",CPEH[cp]->codepage,wys); + } } else strcpy(cpw, "°No CPI open°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"); @@ -353,7 +487,7 @@ void ramka16() setcolor(RED); rectangle(495,110,624,367); } -void lin14(int mode=0) +void lin14(int mode) { if(!any) return; @@ -468,7 +602,7 @@ void lin14(int mode=0) break; } } -void lin8(int mode=0) +void lin8(int mode) { if(!any) return; @@ -583,7 +717,7 @@ void lin8(int mode=0) break; } } -void lin16(int mode=0) +void lin16(int mode) { if(!any) return; @@ -698,7 +832,7 @@ void lin16(int mode=0) break; } } -void lit8(int mode=0) +void lit8(int mode) { if(!any) return; @@ -747,25 +881,28 @@ void lit8(int mode=0) setcolor(color); ab[0]=abc[curx]; outtextxy(20+16*curx,24,ab); - ab[0]=abc[cury]; - outtextxy(8,36+16*cury,ab); - if(SFB8[cp]->lit[lit].lin[cury]&(0x80>>curx)) - { - setcolor(BROWN); - setfillstyle(SOLID_FILL,BROWN); - } - else - { - setcolor(BLACK); - setfillstyle(SOLID_FILL,BLACK); - } - bar(0x10+curx*0x10,0x20+cury*0x10,0x1f+curx*0x10,0x2f+cury*0x10); - if(wys==8) - { - setcolor(GREEN); - rectangle(0x10 + curx*0x10, 0x20 + cury*0x10 ,0x1f + curx*0x10, 0x2f + cury*0x10); - setcolor(BLACK); - rectangle(0x11 + curx*0x10, 0x21 + cury*0x10, 0x1e + curx*0x10, 0x2e + cury*0x10); + if(cury<8) + { + ab[0]=abc[cury]; + outtextxy(8,36+16*cury,ab); + if(SFB8[cp]->lit[lit].lin[cury]&(0x80>>curx)) + { + setcolor(BROWN); + setfillstyle(SOLID_FILL,BROWN); + } + else + { + setcolor(BLACK); + setfillstyle(SOLID_FILL,BLACK); + } + bar(0x10+curx*0x10,0x20+cury*0x10,0x1f+curx*0x10,0x2f+cury*0x10); + if(wys==8) + { + setcolor(GREEN); + rectangle(0x10 + curx*0x10, 0x20 + cury*0x10 ,0x1f + curx*0x10, 0x2f + cury*0x10); + setcolor(BLACK); + rectangle(0x11 + curx*0x10, 0x21 + cury*0x10, 0x1e + curx*0x10, 0x2e + cury*0x10); + } } break; case 0: @@ -813,7 +950,7 @@ void lit8(int mode=0) break; } } -void lit14(int mode=0) +void lit14(int mode) { if(!any) return; @@ -862,25 +999,28 @@ void lit14(int mode=0) setcolor(color); ab[0]=abc[curx]; outtextxy(20+16*curx,215,ab); - ab[0]=abc[cury]; - outtextxy(8,227+16*cury,ab); - if(SFB14[cp]->lit[lit].lin[cury]&(0x80>>curx)) - { - setcolor(BROWN); - setfillstyle(SOLID_FILL,BROWN); - } - else - { - setcolor(BLACK); - setfillstyle(SOLID_FILL,BLACK); - } - bar(16+curx*16,223+cury*16,31+curx*16,238+cury*16); - if(wys==14) + if(cury<14) { - setcolor(GREEN); - rectangle(16+curx*16,223+cury*16,31+curx*16,238+cury*16); - setcolor(BLACK); - rectangle(17+curx*16,224+cury*16,30+curx*16,237+cury*16); + ab[0]=abc[cury]; + outtextxy(8,227+16*cury,ab); + if(SFB14[cp]->lit[lit].lin[cury]&(0x80>>curx)) + { + setcolor(BROWN); + setfillstyle(SOLID_FILL,BROWN); + } + else + { + setcolor(BLACK); + setfillstyle(SOLID_FILL,BLACK); + } + bar(16+curx*16,223+cury*16,31+curx*16,238+cury*16); + if(wys==14) + { + setcolor(GREEN); + rectangle(16+curx*16,223+cury*16,31+curx*16,238+cury*16); + setcolor(BLACK); + rectangle(17+curx*16,224+cury*16,30+curx*16,237+cury*16); + } } break; case 0: @@ -928,7 +1068,7 @@ void lit14(int mode=0) break; } } -void lit16(int mode=0) +void lit16(int mode) { if(!any) return; @@ -1085,7 +1225,7 @@ int otw2() int c; int d; int NT; - + CPI=fopen(nazwap,"rb"); @@ -1395,7 +1535,7 @@ int zap2() } } - fprintf(CPI,"\r\nTen plik zostaˆ wygenerowany za pomoc¥ Edytora napis¢w, wersja 1.1b\r\n autor programu: Balthasar Szczepaäski%c",0x1a); + fprintf(CPI,"\r\nTen plik zostaˆ wygenerowany za pomoc¥ Edytora napis¢w, wersja 1.2a\r\n autor programu: Balthasar Szczepaäski%c",0x1a); fclose(CPI); return 0; @@ -1611,7 +1751,7 @@ int delCP() byo16[FIH->num_codepages] = 0; byo14[FIH->num_codepages] = 0; byo8[FIH->num_codepages] = 0; - + sprintf(err,"0:OK"); return 0; } @@ -1758,7 +1898,7 @@ int newCPI2(short CP, short h) return 0; } -void displayDialog(int color,char *text,int type=0) +void displayDialog(int color,char *text,int type) { gotoxy(21,13); char t1[43]="±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±"; @@ -1788,7 +1928,7 @@ void displayDialog(int color,char *text,int type=0) } } -int message(char *text, char *value, int type=1) +int message(char *text, char *value, int type) { if (type!=2) { @@ -1922,7 +2062,7 @@ int main(int argc,char* argv[]) } else any=0; - + status=registerbgidriver(EGAVGA_driver); if (status < 0) { @@ -1943,7 +2083,7 @@ int main(int argc,char* argv[]) wys=16; else if(byo14[0]) wys=14; - + new8(); menu8(); @@ -1958,518 +2098,1553 @@ int main(int argc,char* argv[]) lin14(); lin16(); + //iR.x.ax=0x1; + //int86(0x33,&iR,&oR); + //iR.x.cx=0x01; + //iR.x.ax=0x0c; + //iR.x.dx=FP_OFF(inth); + //sR.es=FP_SEG(inth); + //int86x(0x33,&iR,&oR,&sR); + maus=setMaus(); + if(maus) + showMaus(); for(;;) { - key=bioskey(_KEYBRD_READ); - if(tab==0) + if(bioskey(_KEYBRD_READY)) { - if((key&0xFF00)==0x4800&&any) + key=bioskey(_KEYBRD_READ); + if(maus) + hideMaus(); + if(tab==0) { - //w g¢r© - prey=cury; - prex=curx; - cury+=wys-1; - cury%=wys; - switch(wys) + if((key&0xFF00)==0x4800&&any) { - case 8: - lit8(2); - break; - case 14: - lit14(2); - break; - case 16: - lit16(2); - break; + //w g¢r© + prey=cury; + prex=curx; + cury+=wys-1; + cury%=wys; + switch(wys) + { + case 8: + lit8(2); + break; + case 14: + lit14(2); + break; + case 16: + lit16(2); + break; + } + } + if((key&0xFF00)==0x5000&&any) + { + //w d¢ˆ + prey=cury; + prex=curx; + ++cury; + cury%=wys; + switch(wys) + { + case 8: + lit8(2); + break; + case 14: + lit14(2); + break; + case 16: + lit16(2); + break; + } + } + if((key&0xFF00)==0x4b00&&any) + { + //w lewo + prey=cury; + prex=curx; + --curx; + curx&=0x7; + switch(wys) + { + case 8: + lit8(2); + break; + case 14: + lit14(2); + break; + case 16: + lit16(2); + break; + } + } + if((key&0xFF00)==0x4d00&&any) + { + //w prawo + prey=cury; + prex=curx; + ++curx; + curx&=0x7; + switch(wys) + { + case 8: + lit8(2); + break; + case 14: + lit14(2); + break; + case 16: + lit16(2); + break; + } + } + if ((key&0xFF00)==0x3900&&any) + { + //spacja + switch(wys) + { + case 8: + spc8(); + lit8(1); + lin8(3); + break; + case 14: + spc14(); + lit14(1); + lin14(3); + break; + case 16: + spc16(); + lit16(1); + lin16(3); + break; + } + } + if ((key&0xFF00)==0x0e00&&any) + { + //backspace + switch(wys) + { + case 8: + bsp8(); + lit8(1); + lin8(3); + break; + case 14: + bsp14(); + lit14(1); + lin14(3); + break; + case 16: + bsp16(); + lit16(1); + lin16(3); + break; + } + } + if ((key&0xFF00)==0x1c00&&any) + { + //enter + switch(wys) + { + case 8: + ent8(); + lit8(1); + lin8(3); + break; + case 14: + ent14(); + lit14(1); + lin14(3); + break; + case 16: + ent16(); + lit16(1); + lin16(3); + break; + } } } - if((key&0xFF00)==0x5000&&any) + else { - //w d¢ˆ - prey=cury; - prex=curx; - ++cury; - cury%=wys; + if((key&0xFF00)==0x4800&&any) + { + //w g¢r© l + pre=lit; + lit-=16; + lit&=0xFF; + lit8(); + lit14(); + lit16(); + switch(wys) + { + case 8: + lin8(2); + break; + case 14: + lin14(2); + break; + case 16: + lin16(2); + break; + } + } + if((key&0xFF00)==0x5000&&any) + { + //w d¢ˆ l + pre=lit; + lit+=16; + lit&=0xFF; + lit8(); + lit14(); + lit16(); + switch(wys) + { + case 8: + lin8(2); + break; + case 14: + lin14(2); + break; + case 16: + lin16(2); + break; + } + } + if((key&0xFF00)==0x4b00&&any) + { + //w lewo l + pre=lit; + --lit; + lit&=0xFF; + lit8(); + lit14(); + lit16(); + switch(wys) + { + case 8: + lin8(2); + break; + case 14: + lin14(2); + break; + case 16: + lin16(2); + break; + } + } + if((key&0xFF00)==0x4d00&&any) + { + //w prawo l + pre=lit; + ++lit; + lit&=0xFF; + lit8(); + lit14(); + lit16(); + switch(wys) + { + case 8: + lin8(2); + break; + case 14: + lin14(2); + break; + case 16: + lin16(2); + break; + } + } + } + if ((key&0xFF00)==0x0f00&&any) + { + //tab + if(!tab) + tab=1; + else + tab=0; switch(wys) { case 8: - lit8(2); + ramka8(); break; case 14: - lit14(2); + ramka14(); break; case 16: - lit16(2); + ramka16(); break; } } - if((key&0xFF00)==0x4b00&&any) + if ((key&0xFF00)==0x5100&&any) { - //w lewo + //cp++ + ++cp; + cp%=FIH->num_codepages; + prex=curx; prey=cury; + if(wys==8&&byo8[cp]==0) + { + if(byo14[cp]!=0) + wys=14; + else if(byo16[cp]!=0) + wys=16; + } + + else if(wys==14&&byo14[cp]==0) + { + if(byo16[cp]!=0) + wys=16; + else if(byo8[cp]!=0) + wys=8; + } + + else if(wys==16&&byo16[cp]==0) + { + if(byo8[cp]!=0) + wys=8; + else if(byo14[cp]!=0) + wys=14; + } + cury&=0x7; + ramka8(); + ramka14(); + ramka16(); + cpwys(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); + + } + if ((key&0xFF00)==0x4900&&any) + { + //cp-- + cp+=FIH->num_codepages-1; + cp%=FIH->num_codepages; + + if(wys==8&&byo8[cp]==0) + { + if(byo14[cp]!=0) + wys=14; + else if(byo16[cp]!=0) + wys=16; + } + + else if(wys==14&&byo14[cp]==0) + { + if(byo16[cp]!=0) + wys=16; + else if(byo8[cp]!=0) + wys=8; + } + + else if(wys==16&&byo16[cp]==0) + { + if(byo8[cp]!=0) + wys=8; + else if(byo14[cp]!=0) + wys=14; + } + cury&=0x7; + ramka8(); + ramka14(); + ramka16(); + cpwys(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); + + } + if ((key&0xFF00)==0x4700&&any) + { + //wys-- prex=curx; - --curx; - curx&=0x7; + prey=cury; switch(wys) { case 8: - lit8(2); + if (byo16[cp]!=0) + { + wys=16; + lin16(1); + lit16(1); + ramka16(); + } + else if(byo14[cp]!=0) + { + wys=14; + lin14(1); + lit14(1); + ramka14(); + } + lin8(1); + lit8(1); + ramka8(); break; case 14: + if (byo8[cp]!=0) + { + wys=8; + cury%=8; + lin8(1); + lit8(2); + ramka8(); + } + else if(byo16[cp]!=0) + { + wys=16; + lin16(1); + lit16(1); + ramka16(); + } + lin14(1); lit14(2); + ramka14(); break; case 16: + if (byo14[cp]!=0) + { + wys=14; + cury%=14; + lin14(1); + lit14(2); + ramka14(); + } + else if(byo8[cp]!=0) + { + wys=8; + cury%=8; + lin8(1); + lit8(2); + ramka8(); + } + lin16(1); lit16(2); + ramka16(); break; } + cpwys(); } - if((key&0xFF00)==0x4d00&&any) + if ((key&0xFF00)==0x4f00&&any) { - //w prawo - prey=cury; + //wys++ prex=curx; - ++curx; - curx&=0x7; + prey=cury; switch(wys) { case 8: - lit8(2); + if(byo14[cp]!=0) + { + wys=14; + lin14(1); + lit14(1); + ramka14(); + } + else if (byo16[cp]!=0) + { + wys=16; + lin16(1); + lit16(1); + ramka16(); + } + lin8(1); + lit8(1); + ramka8(); break; case 14: + if(byo16[cp]!=0) + { + wys=16; + lin16(1); + lit16(1); + ramka16(); + } + else if (byo8[cp]!=0) + { + wys=8; + cury%=8; + lin8(1); + lit8(2); + ramka8(); + } + lin14(1); lit14(2); + ramka14(); break; case 16: + if(byo8[cp]!=0) + { + wys=8; + cury%=8; + lin8(1); + lit8(2); + ramka8(); + } + else if (byo14[cp]!=0) + { + wys=14; + cury%=14; + lin14(1); + lit14(2); + ramka14(); + } + lin16(1); lit16(2); + ramka16(); break; } + cpwys(); } - if ((key&0xFF00)==0x3900&&any) + + if ((key&0xFF00)==0x3b00) { - //spacja - switch(wys) + //new CPI + setcolor(RED); + outtextxy(16,472,"new"); + deleteCPI(); + status=newCPI(); + while(status!=0) { - case 8: - spc8(); - lit8(1); - lin8(3); - break; - case 14: - spc14(); - lit14(1); - lin14(3); - break; - case 16: - spc16(); - lit16(1); - lin16(3); - break; + if (message("CPI not created",err,2)==0) + status=newCPI(); + else + { + break; + //closegraph(); + //deleteCPI(); + //return status; + } } - } - if ((key&0xFF00)==0x0e00&&any) - { - //backspace - switch(wys) + any=!status; + if(any) { - case 8: - bsp8(); - lit8(1); - lin8(3); - break; - case 14: - bsp14(); - lit14(1); - lin14(3); - break; - case 16: - bsp16(); - lit16(1); - lin16(3); - break; + strcpy(nazwap,"new CPI"); + cp=0; + if(byo8[0]) + wys=8; + else if(byo16[0]) + wys=16; + else if(byo14[0]) + wys=14; + cury%=8; } + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); + } - if ((key&0xFF00)==0x1c00&&any) + if ((key&0xFF00)==0x3c00&&any) { - //enter - switch(wys) + //zapisz + setcolor(RED); + outtextxy(72,472,"save"); + status=zap(); + while(status!=0) { - case 8: - ent8(); - lit8(1); - lin8(3); - break; - case 14: - ent14(); - lit14(1); - lin14(3); - break; - case 16: - ent16(); - lit16(1); - lin16(3); - break; + if (message("CPI file not saved",err,2)==0) + status=zap(); + else + break; } + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); + cury%=8; + + } - } - else - { - if((key&0xFF00)==0x4800&&any) + + + if ((key&0xFF00)==0x3d00) { - //w g¢r© l - pre=lit; - lit-=16; - lit&=0xFF; + //wczytaj + setcolor(RED); + outtextxy(136,472,"load"); + deleteCPI(); + status=otw(); + while(status!=0) + { + if (message("CPI file not loaded",err,2)==0) + status=otw(); + else + break; + } + any=!status; + cp=0; + if(byo8[0]) + wys=8; + else if(byo16[0]) + wys=16; + else if(byo14[0]) + wys=14; + cury%=8; + + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); lit8(); lit14(); lit16(); - switch(wys) + + } + if((key&0xFF00)==0x3e00&&any) + { + + //zapisz+system + setcolor(RED); + outtextxy(72,472,"save use"); + status=zap(); + while(status!=0) { - case 8: - lin8(2); - break; - case 14: - lin14(2); - break; - case 16: - lin16(2); - break; + if (message("CPI file not saved",err,2)==0) + status=zap(); + else + break; + } + if(status==0) + { + sprintf(err,"mode con:cp prep=((%u) %s)",CPEH[cp]->codepage,nazwap); + puts(err); + system(err); + sprintf(err,"mode con:cp sel=%u",CPEH[cp]->codepage); + puts(err); + system(err); + delay(5000); + closegraph(); + initgraph(&kart16,&tryb16,""); + } + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); + cury%=8; + } - if((key&0xFF00)==0x5000&&any) + if ((key&0xFF00)==0x3f00&&any) { - //w d¢ˆ l - pre=lit; - lit+=16; - lit&=0xFF; + //zmiana numeru + setcolor(RED); + outtextxy(256,472,"number"); + status=zmn(); + if(status!=0) + message("Number not changed",err); + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); lit8(); lit14(); lit16(); - switch(wys) - { - case 8: - lin8(2); - break; - case 14: - lin14(2); - break; - case 16: - lin16(2); - break; - } } - if((key&0xFF00)==0x4b00&&any) + if ((key&0xFF00)==0x4000&&any) { - //w lewo l - pre=lit; - --lit; - lit&=0xFF; + //new font + setcolor(RED); + outtextxy(336,472,"newF"); + status=newF(); + if(status!=0) + message("Fonr not created",err); + offset(); + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); lit8(); lit14(); lit16(); - switch(wys) - { - case 8: - lin8(2); - break; - case 14: - lin14(2); - break; - case 16: - lin16(2); - break; - } + } - if((key&0xFF00)==0x4d00&&any) + if ((key&0xFF00)==0x4100&&any) { - //w prawo l - pre=lit; - ++lit; - lit&=0xFF; + //new CP + setcolor(RED); + outtextxy(400,472,"newCP"); + status=newCP(); + if(status!=0) + message("Codepage not created",err); + else + cp=FIH->num_codepages-1; + if(wys==8&&byo8[cp]==0) + { + if(byo14[cp]!=0) + wys=14; + else if(byo16[cp]!=0) + wys=16; + } + + else if(wys==14&&byo14[cp]==0) + { + if(byo16[cp]!=0) + wys=16; + else if(byo8[cp]!=0) + wys=8; + } + + else if(wys==16&&byo16[cp]==0) + { + if(byo8[cp]!=0) + wys=8; + else if(byo14[cp]!=0) + wys=14; + } + cury&=0x7; + offset(); + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); lit8(); lit14(); lit16(); - switch(wys) + + } + if ((key&0xFF00)==0x4200&&any) + { + //delete font + setcolor(RED); + outtextxy(472,472,"delF"); + status=delF(); + if(status!=0) + message("Font not deleted",err); + offset(); + + if(wys==8&&byo8[cp]==0) { - case 8: - lin8(2); - break; - case 14: - lin14(2); - break; - case 16: - lin16(2); - break; + if(byo14[cp]!=0) + wys=14; + else if(byo16[cp]!=0) + wys=16; } + + else if(wys==14&&byo14[cp]==0) + { + if(byo16[cp]!=0) + wys=16; + else if(byo8[cp]!=0) + wys=8; + } + + else if(wys==16&&byo16[cp]==0) + { + if(byo8[cp]!=0) + wys=8; + else if(byo14[cp]!=0) + wys=14; + } + cury&=0x7; + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); + } - } - if ((key&0xFF00)==0x0f00&&any) - { - //tab - if(!tab) - tab=1; - else - tab=0; - switch(wys) + if ((key&0xFF00)==0x4300&&any) { - case 8: + //delete CP + setcolor(RED); + outtextxy(536,472,"delCP"); + status=delCP(); + if(status!=0) + message("Codepage not deleted",err); + offset(); + + cp%=FIH->num_codepages; + + if(wys==8&&byo8[cp]==0) + { + if(byo14[cp]!=0) + wys=14; + else if(byo16[cp]!=0) + wys=16; + } + + else if(wys==14&&byo14[cp]==0) + { + if(byo16[cp]!=0) + wys=16; + else if(byo8[cp]!=0) + wys=8; + } + + else if(wys==16&&byo16[cp]==0) + { + if(byo8[cp]!=0) + wys=8; + else if(byo14[cp]!=0) + wys=14; + } + cury&=0x7; + new8(); + menu8(); + cpwys(); ramka8(); - break; - case 14: ramka14(); - break; - case 16: ramka16(); - break; + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); + } - } - if ((key&0xFF00)==0x5100&&any) - { - //cp++ - ++cp; - cp%=FIH->num_codepages; - prex=curx; - prey=cury; - if(wys==8&&byo8[cp]==0) + if ((key&0xFF00)==0x4400) { - if(byo14[cp]!=0) - wys=14; - else if(byo16[cp]!=0) - wys=16; + //koniec + setcolor(RED); + outtextxy(616,472,"end"); + if(maus) + resetMaus(); + break; } - - else if(wys==14&&byo14[cp]==0) + while(bioskey(_KEYBRD_READY)) { - if(byo16[cp]!=0) - wys=16; - else if(byo8[cp]!=0) - wys=8; + bioskey(_KEYBRD_READ); } + if(maus&&mausv) + showMaus(); + } + else if(maus) + { + prek=klik; + //premx=mausx; + //premy=mausy; + getMaus(&mausx,&mausy,&klik); - else if(wys==16&&byo16[cp]==0) + if(any&&mausx>=16&&mausx<144&&mausy>=32&&mausy<160&&byo8[cp]) { - if(byo8[cp]!=0) - wys=8; - else if(byo14[cp]!=0) - wys=14; + hideMaus(); + mausv=0; + pret=tab; + prew=wys; + prex=curx; + prey=cury; + curx=(mausx-16)/16; + cury=(mausy-32)/16; + wys=8; + tab=0; + if(klik) + { + if(klik&0x01) + ent8(); + else if(klik&0x2) + bsp8(); + else if(klik&0x4) + spc8(); + lin8(3); + } + if(prew!=wys||pret) + ramka8(); + if(prex==curx&&prey==cury) + { + switch(prew) + { + case 16: + lin16(1); + ramka16(); + lit8(1); + lit16(1); + lin8(1); + break; + case 14: + lin14(1); + ramka14(); + lit8(1); + lit14(1); + lin8(1); + break; + } + if(klik) + lit8(1); + } + else + { + switch(prew) + { + case 16: + lin16(2); + ramka16(); + lit8(1); + lit16(2); + lin8(1); + break; + case 14: + lin14(2); + ramka14(); + lit8(1); + lit14(2); + lin8(1); + break; + case 8: + lit8(2); + } + } } - cury&=0x7; - ramka8(); - ramka14(); - ramka16(); - cpwys(); - lin8(); - lin14(); - lin16(); - lit8(); - lit14(); - lit16(); - - } - if ((key&0xFF00)==0x4900&&any) - { - //cp-- - cp+=FIH->num_codepages-1; - cp%=FIH->num_codepages; - if(wys==8&&byo8[cp]==0) + else if(any&&mausx>=16&&mausx<144&&mausy>=223&&mausy<447&&byo14[cp]) { - if(byo14[cp]!=0) - wys=14; - else if(byo16[cp]!=0) - wys=16; + hideMaus(); + mausv=0; + pret=tab; + prew=wys; + prex=curx; + prey=cury; + curx=(mausx-16)/16; + cury=(mausy-223)/16; + wys=14; + tab=0; + if(klik) + { + if(klik&0x01) + ent14(); + else if(klik&0x2) + bsp14(); + else if(klik&0x4) + spc14(); + lin14(3); + } + if(prew!=wys||pret) + ramka14(); + if(prex==curx&&prey==cury) + { + switch(prew) + { + case 16: + lin16(1); + ramka16(); + lit14(1); + lit16(1); + lin14(1); + break; + case 8: + lin8(1); + ramka8(); + lit14(1); + lit8(1); + lin14(1); + break; + } + if(klik) + lit14(1); + } + else + { + switch(prew) + { + case 16: + lin16(2); + ramka16(); + lit14(1); + lit16(2); + lin14(1); + break; + case 8: + lin8(2); + ramka8(); + lit14(1); + lit8(2); + lin14(1); + break; + case 14: + lit14(2); + } + } } - else if(wys==14&&byo14[cp]==0) + else if(any&&mausx>=336&&mausx<464&&mausy>=111&&mausy<367&&byo16[cp]) { - if(byo16[cp]!=0) - wys=16; - else if(byo8[cp]!=0) - wys=8; + hideMaus(); + mausv=0; + pret=tab; + prew=wys; + prex=curx; + prey=cury; + curx=(mausx-336)/16; + cury=(mausy-111)/16; + wys=16; + tab=0; + if(klik) + { + if(klik&0x01) + ent16(); + else if(klik&0x2) + bsp16(); + else if(klik&0x4) + spc16(); + lin16(3); + } + if(prew!=wys||pret) + ramka16(); + if(prex==curx&&prey==cury) + { + switch(prew) + { + case 8: + lin8(1); + ramka8(); + lit16(1); + lit8(1); + lin16(1); + break; + case 14: + lin14(1); + ramka14(); + lit16(1); + lit14(1); + lin16(1); + break; + } + if(klik) + lit16(1); + } + else + { + switch(prew) + { + case 8: + lin8(2); + ramka8(); + lit16(1); + lit8(2); + lin16(1); + break; + case 14: + lin14(2); + ramka14(); + lit16(1); + lit14(2); + lin16(1); + break; + case 16: + lit16(2); + } + } } - else if(wys==16&&byo16[cp]==0) + else if(any&&klik&&mausx>=176&&mausx<304&&mausy>=32&&mausy<160&&byo8[cp]) { - if(byo8[cp]!=0) - wys=8; - else if(byo14[cp]!=0) - wys=14; + hideMaus(); + mausv=0; + prew=wys; + pre=lit; + pret=tab; + wys=8; + tab=1; + lit=((mausy-32)/8)*16+((mausx-176)/8); + if (pre==lit) + { + switch(prew) + { + case 16: + ramka16(); + ramka8(); + lin16(1); + lit16(1); + lin8(1); + lit8(1); + break; + case 14: + ramka14(); + ramka8(); + lin14(1); + lit14(1); + lin8(1); + lit8(1); + break; + case 8: + if(!pret) + ramka8(); + break; + } + } + else + { + lit8(); + lit14(); + lit16(); + switch(prew) + { + case 16: + lin16(2); + ramka16(); + ramka8(); + lin8(1); + break; + case 14: + lin14(2); + ramka14(); + ramka8(); + lin8(1); + break; + case 8: + lin8(2); + if(!pret) + ramka8(); + } + } } - cury&=0x7; - ramka8(); - ramka14(); - ramka16(); - cpwys(); - lin8(); - lin14(); - lin16(); - lit8(); - lit14(); - lit16(); - - } - if ((key&0xFF00)==0x4700&&any) - { - //wys-- - prex=curx; - prey=cury; - switch(wys) + + else if(any&&klik&&mausx>=176&&mausx<304&&mausy>=223&&mausy<447&&byo14[cp]) { - case 8: - if (byo16[cp]!=0) + hideMaus(); + mausv=0; + prew=wys; + pre=lit; + pret=tab; + wys=14; + tab=1; + lit=((mausy-223)/14)*16+((mausx-176)/8); + if (pre==lit) { - wys=16; - lin16(1); - lit16(1); - ramka16(); + switch(prew) + { + case 16: + ramka16(); + ramka14(); + lin16(1); + lit16(1); + lin14(1); + lit14(1); + break; + case 8: + ramka8(); + ramka14(); + lin8(1); + lit8(1); + lin14(1); + lit14(1); + break; + case 14: + if(!pret) + ramka14(); + break; + } } - else if(byo14[cp]!=0) + else { - wys=14; - lin14(1); - lit14(1); - ramka14(); + lit8(); + lit14(); + lit16(); + switch(prew) + { + case 16: + lin16(2); + ramka16(); + ramka14(); + lin14(1); + break; + case 8: + lin8(2); + ramka8(); + ramka14(); + lin14(1); + break; + case 14: + lin14(2); + if(!pret) + ramka14(); + } } - lin8(1); - lit8(1); - ramka8(); - break; - case 14: - if (byo8[cp]!=0) + } + + else if(any&&klik&&mausx>=496&&mausx<624&&mausy>=111&&mausy<367&&byo16[cp]) + { + hideMaus(); + mausv=0; + prew=wys; + pre=lit; + pret=tab; + wys=16; + tab=1; + lit=((mausy-111)/16)*16+((mausx-496)/8); + if (pre==lit) { - wys=8; - cury%=8; - lin8(1); - lit8(2); - ramka8(); + switch(prew) + { + case 8: + ramka8(); + ramka16(); + lin8(1); + lit8(1); + lin16(1); + lit16(1); + break; + case 14: + ramka14(); + ramka16(); + lin14(1); + lit14(1); + lin16(1); + lit16(1); + break; + case 16: + if(!pret) + ramka16(); + break; + } } - else if(byo16[cp]!=0) + else + { + lit8(); + lit14(); + lit16(); + switch(prew) + { + case 8: + lin8(2); + ramka8(); + ramka16(); + lin16(1); + break; + case 14: + lin14(2); + ramka14(); + ramka16(); + lin16(1); + break; + case 16: + lin16(2); + if(!pret) + ramka16(); + } + } + } + + else if(any&&klik&&!prek&&mausx>=128&&mausx<184&&mausy<8) + { + hideMaus(); + mausv=0; + //cp+- + if(klik&0x01) + ++cp; + else + cp+=FIH->num_codepages-1; + cp%=FIH->num_codepages; + prex=curx; + prey=cury; + if(wys==8&&byo8[cp]==0) { - wys=16; - lin16(1); - lit16(1); - ramka16(); + if(byo14[cp]!=0) + wys=14; + else if(byo16[cp]!=0) + wys=16; } - lin14(1); - lit14(2); - ramka14(); - break; - case 16: - if (byo14[cp]!=0) + + else if(wys==14&&byo14[cp]==0) { - wys=14; - cury%=14; - lin14(1); - lit14(2); - ramka14(); + if(byo16[cp]!=0) + wys=16; + else if(byo8[cp]!=0) + wys=8; } - else if(byo8[cp]!=0) + + else if(wys==16&&byo16[cp]==0) { - wys=8; - cury%=8; - lin8(1); - lit8(2); - ramka8(); + if(byo8[cp]!=0) + wys=8; + else if(byo14[cp]!=0) + wys=14; } - lin16(1); - lit16(2); + cury&=0x7; + ramka8(); + ramka14(); ramka16(); - break; + cpwys(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); } - cpwys(); - } - if ((key&0xFF00)==0x4f00&&any) - { - //wys++ - prex=curx; - prey=cury; - switch(wys) + + else if(any&&klik&&!prek&&mausx>=192&&mausx<224&&mausy<8) { - case 8: - if(byo14[cp]!=0) + hideMaus(); + mausv=0; + //wys+- + prex=curx; + prey=cury; + switch(wys) { - wys=14; + case 8: + if(klik&0x1) + { + if(byo14[cp]!=0) + { + wys=14; + lin14(1); + lit14(1); + ramka14(); + } + else if (byo16[cp]!=0) + { + wys=16; + lin16(1); + lit16(1); + ramka16(); + } + } + else + { + if (byo16[cp]!=0) + { + wys=16; + lin16(1); + lit16(1); + ramka16(); + } + else if(byo14[cp]!=0) + { + wys=14; + lin14(1); + lit14(1); + ramka14(); + } + } + lin8(1); + lit8(1); + ramka8(); + break; + case 14: + if(klik&0x1) + { + if(byo16[cp]!=0) + { + wys=16; + lin16(1); + lit16(1); + ramka16(); + } + else if (byo8[cp]!=0) + { + wys=8; + cury%=8; + lin8(1); + lit8(2); + ramka8(); + } + } + else + { + if (byo8[cp]!=0) + { + wys=8; + cury%=8; + lin8(1); + lit8(2); + ramka8(); + } + else if(byo16[cp]!=0) + { + wys=16; + lin16(1); + lit16(1); + ramka16(); + } + } lin14(1); - lit14(1); + lit14(2); ramka14(); - } - else if (byo16[cp]!=0) - { - wys=16; + break; + case 16: + if(klik&0x1) + { + if(byo8[cp]!=0) + { + wys=8; + cury%=8; + lin8(1); + lit8(2); + ramka8(); + } + else if (byo14[cp]!=0) + { + wys=14; + cury%=14; + lin14(1); + lit14(2); + ramka14(); + } + } + else + { + if (byo14[cp]!=0) + { + wys=14; + cury%=14; + lin14(1); + lit14(2); + ramka14(); + } + else if(byo8[cp]!=0) + { + wys=8; + cury%=8; + lin8(1); + lit8(2); + ramka8(); + } + } lin16(1); - lit16(1); + lit16(2); ramka16(); + break; } - lin8(1); - lit8(1); - ramka8(); - break; - case 14: - if(byo16[cp]!=0) + cpwys(); + } + + else if(klik&&!prek&&mausx<40&&mausy>=472) + { + hideMaus(); + mausv=0; + //new CPI + setcolor(RED); + outtextxy(16,472,"new"); + deleteCPI(); + status=newCPI(); + while(status!=0) { - wys=16; - lin16(1); - lit16(1); - ramka16(); + if (message("CPI not created",err,2)==0) + status=newCPI(); + else + break; } - else if (byo8[cp]!=0) + any=!status; + if(any) { - wys=8; + strcpy(nazwap,"new CPI"); + cp=0; + if(byo8[0]) + wys=8; + else if(byo16[0]) + wys=16; + else if(byo14[0]) + wys=14; cury%=8; - lin8(1); - lit8(2); - ramka8(); } - lin14(1); - lit14(2); + new8(); + menu8(); + cpwys(); + ramka8(); ramka14(); - break; - case 16: - if(byo8[cp]!=0) - { - wys=8; - cury%=8; - lin8(1); - lit8(2); - ramka8(); - } - else if (byo14[cp]!=0) - { - wys=14; - cury%=14; - lin14(1); - lit14(2); - ramka14(); - } - lin16(1); - lit16(2); ramka16(); - break; + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); } - cpwys(); - } - - if ((key&0xFF00)==0x3b00) - { - //new CPI - setcolor(RED); - outtextxy(16,472,"new"); - deleteCPI(); - status=newCPI(); - while(status!=0) + + else if(any&&klik&&!prek&&mausx>=56&&mausx<104&&mausy>=472) { - if (message("CPI not created",err,2)==0) - status=newCPI(); - else + hideMaus(); + mausv=0; + //save CPI + setcolor(RED); + outtextxy(72,472,"save"); + status=zap(); + while(status!=0) { - break; - //closegraph(); - //deleteCPI(); - //return status; + if (message("CPI file not saved",err,2)==0) + status=zap(); + else + break; } + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); + cury%=8; } - any=!status; - if(any) + + else if(klik&&!prek&&mausx>=120&&mausx<168&&mausy>=472) { - strcpy(nazwap,"new CPI"); + hideMaus(); + mausv=0; + //load CPI + setcolor(RED); + outtextxy(136,472,"load"); + deleteCPI(); + status=otw(); + while(status!=0) + { + if (message("CPI file not loaded",err,2)==0) + status=otw(); + else + break; + } + any=!status; cp=0; if(byo8[0]) wys=8; @@ -2478,333 +3653,283 @@ int main(int argc,char* argv[]) else if(byo14[0]) wys=14; cury%=8; + + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); } - new8(); - menu8(); - cpwys(); - ramka8(); - ramka14(); - ramka16(); - lin8(); - lin14(); - lin16(); - lit8(); - lit14(); - lit16(); - } - if ((key&0xFF00)==0x3c00&&any) - { - //zapisz - setcolor(RED); - outtextxy(72,472,"save"); - status=zap(); - while(status!=0) - { - if (message("CPI file not saved",err,2)==0) - status=zap(); - else - break; - } - new8(); - menu8(); - cpwys(); - ramka8(); - ramka14(); - ramka16(); - lin8(); - lin14(); - lin16(); - lit8(); - lit14(); - lit16(); - cury%=8; - - - } - - - if ((key&0xFF00)==0x3d00) - { - //wczytaj - setcolor(RED); - outtextxy(136,472,"load"); - deleteCPI(); - status=otw(); - while(status!=0) + else if(any&&klik&&!prek&&mausx>=184&&mausx<224&&mausy>=472) { - if (message("CPI file not loaded",err,2)==0) - status=otw(); - else - break; - } - any=!status; - cp=0; - if(byo8[0]) - wys=8; - else if(byo16[0]) - wys=16; - else if(byo14[0]) - wys=14; - cury%=8; + hideMaus(); + mausv=0; + //save & use CPI + setcolor(RED); + outtextxy(72,472,"save use"); + status=zap(); + while(status!=0) + { + if (message("CPI file not saved",err,2)==0) + status=zap(); + else + break; + } + if(status==0) + { + sprintf(err,"mode con:cp prep=((%u) %s)",CPEH[cp]->codepage,nazwap); + puts(err); + system(err); + sprintf(err,"mode con:cp sel=%u",CPEH[cp]->codepage); + puts(err); + system(err); + delay(5000); + closegraph(); + initgraph(&kart16,&tryb16,""); - new8(); - menu8(); - cpwys(); - ramka8(); - ramka14(); - ramka16(); - lin8(); - lin14(); - lin16(); - lit8(); - lit14(); - lit16(); + } + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); + cury%=8; - } - if((key&0xFF00)==0x3e00&&any) - { - - //zapisz+system - setcolor(RED); - outtextxy(72,472,"save use"); - status=zap(); - while(status!=0) - { - if (message("CPI file not saved",err,2)==0) - status=zap(); - else - break; - } - if(status==0) - { - sprintf(err,"mode con:cp prep=((%u) %s)",CPEH[cp]->codepage,nazwap); - puts(err); - system(err); - sprintf(err,"mode con:cp sel=%u",CPEH[cp]->codepage); - puts(err); - system(err); - delay(5000); - closegraph(); - initgraph(&kart16,&tryb16,""); - - } - new8(); - menu8(); - cpwys(); - ramka8(); - ramka14(); - ramka16(); - lin8(); - lin14(); - lin16(); - lit8(); - lit14(); - lit16(); - cury%=8; - - } - if ((key&0xFF00)==0x3f00&&any) - { - //zmiana numeru - setcolor(RED); - outtextxy(256,472,"number"); - status=zmn(); - if(status!=0) - message("Number not changed",err); - new8(); - menu8(); - cpwys(); - ramka8(); - ramka14(); - ramka16(); - lin8(); - lin14(); - lin16(); - lit8(); - lit14(); - lit16(); - } - if ((key&0xFF00)==0x4000&&any) - { - //new font - setcolor(RED); - outtextxy(336,472,"newF"); - status=newF(); - if(status!=0) - message("Fonr not created",err); - offset(); - new8(); - menu8(); - cpwys(); - ramka8(); - ramka14(); - ramka16(); - lin8(); - lin14(); - lin16(); - lit8(); - lit14(); - lit16(); - - } - if ((key&0xFF00)==0x4100&&any) - { - //new CP - setcolor(RED); - outtextxy(400,472,"newCP"); - status=newCP(); - if(status!=0) - message("Codepage not created",err); - else - cp=FIH->num_codepages-1; - if(wys==8&&byo8[cp]==0) - { - if(byo14[cp]!=0) - wys=14; - else if(byo16[cp]!=0) - wys=16; - } - - else if(wys==14&&byo14[cp]==0) - { - if(byo16[cp]!=0) - wys=16; - else if(byo8[cp]!=0) - wys=8; } - - else if(wys==16&&byo16[cp]==0) + + else if(any&&klik&&!prek&&mausx>=240&&mausx<304&&mausy>=472) { - if(byo8[cp]!=0) - wys=8; - else if(byo14[cp]!=0) - wys=14; + hideMaus(); + mausv=0; + //change CP # + setcolor(RED); + outtextxy(256,472,"number"); + status=zmn(); + if(status!=0) + message("Number not changed",err); + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); } - cury&=0x7; - offset(); - new8(); - menu8(); - cpwys(); - ramka8(); - ramka14(); - ramka16(); - lin8(); - lin14(); - lin16(); - lit8(); - lit14(); - lit16(); - } - if ((key&0xFF00)==0x4200&&any) - { - //delete font - setcolor(RED); - outtextxy(472,472,"delF"); - status=delF(); - if(status!=0) - message("Font not deleted",err); - offset(); - if(wys==8&&byo8[cp]==0) + else if(any&&klik&&!prek&&mausx>=320&&mausx<368&&mausy>=472) { - if(byo14[cp]!=0) - wys=14; - else if(byo16[cp]!=0) - wys=16; + hideMaus(); + mausv=0; + //new font + setcolor(RED); + outtextxy(336,472,"newF"); + status=newF(); + if(status!=0) + message("Fonr not created",err); + offset(); + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); } - else if(wys==14&&byo14[cp]==0) + else if(any&&klik&&!prek&&mausx>=384&&mausx<440&&mausy>=472) { - if(byo16[cp]!=0) - wys=16; - else if(byo8[cp]!=0) - wys=8; + hideMaus(); + mausv=0; + //new CP + setcolor(RED); + outtextxy(400,472,"newCP"); + status=newCP(); + if(status!=0) + message("Codepage not created",err); + else + cp=FIH->num_codepages-1; + if(wys==8&&byo8[cp]==0) + { + if(byo14[cp]!=0) + wys=14; + else if(byo16[cp]!=0) + wys=16; + } + + else if(wys==14&&byo14[cp]==0) + { + if(byo16[cp]!=0) + wys=16; + else if(byo8[cp]!=0) + wys=8; + } + + else if(wys==16&&byo16[cp]==0) + { + if(byo8[cp]!=0) + wys=8; + else if(byo14[cp]!=0) + wys=14; + } + cury&=0x7; + offset(); + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); } - else if(wys==16&&byo16[cp]==0) + else if(any&&klik&&!prek&&mausx>=456&&mausx<504&&mausy>=472) { - if(byo8[cp]!=0) - wys=8; - else if(byo14[cp]!=0) - wys=14; + hideMaus(); + mausv=0; + //delete font + setcolor(RED); + outtextxy(472,472,"delF"); + status=delF(); + if(status!=0) + message("Font not deleted",err); + offset(); + + if(wys==8&&byo8[cp]==0) + { + if(byo14[cp]!=0) + wys=14; + else if(byo16[cp]!=0) + wys=16; + } + + else if(wys==14&&byo14[cp]==0) + { + if(byo16[cp]!=0) + wys=16; + else if(byo8[cp]!=0) + wys=8; + } + + else if(wys==16&&byo16[cp]==0) + { + if(byo8[cp]!=0) + wys=8; + else if(byo14[cp]!=0) + wys=14; + } + cury&=0x7; + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); } - cury&=0x7; - new8(); - menu8(); - cpwys(); - ramka8(); - ramka14(); - ramka16(); - lin8(); - lin14(); - lin16(); - lit8(); - lit14(); - lit16(); - - } - if ((key&0xFF00)==0x4300&&any) - { - //delete CP - setcolor(RED); - outtextxy(536,472,"delCP"); - status=delCP(); - if(status!=0) - message("Codepage not deleted",err); - offset(); - - cp%=FIH->num_codepages; - if(wys==8&&byo8[cp]==0) + else if(any&&klik&&!prek&&mausx>=520&&mausx<576&&mausy>=472) { - if(byo14[cp]!=0) - wys=14; - else if(byo16[cp]!=0) - wys=16; + hideMaus(); + mausv=0; + //delete CP + setcolor(RED); + outtextxy(536,472,"delCP"); + status=delCP(); + if(status!=0) + message("Codepage not deleted",err); + offset(); + + cp%=FIH->num_codepages; + + if(wys==8&&byo8[cp]==0) + { + if(byo14[cp]!=0) + wys=14; + else if(byo16[cp]!=0) + wys=16; + } + + else if(wys==14&&byo14[cp]==0) + { + if(byo16[cp]!=0) + wys=16; + else if(byo8[cp]!=0) + wys=8; + } + + else if(wys==16&&byo16[cp]==0) + { + if(byo8[cp]!=0) + wys=8; + else if(byo14[cp]!=0) + wys=14; + } + cury&=0x7; + new8(); + menu8(); + cpwys(); + ramka8(); + ramka14(); + ramka16(); + lin8(); + lin14(); + lin16(); + lit8(); + lit14(); + lit16(); } - else if(wys==14&&byo14[cp]==0) + else if(klik&&!prek&&mausx>=592&&mausy>=472) { - if(byo16[cp]!=0) - wys=16; - else if(byo8[cp]!=0) - wys=8; + hideMaus(); + mausv=0; + setcolor(RED); + outtextxy(616,472,"end"); + resetMaus(); + break; } - else if(wys==16&&byo16[cp]==0) + else { - if(byo8[cp]!=0) - wys=8; - else if(byo14[cp]!=0) - wys=14; + mausv=1; + showMaus(); } - cury&=0x7; - new8(); - menu8(); - cpwys(); - ramka8(); - ramka14(); - ramka16(); - lin8(); - lin14(); - lin16(); - lit8(); - lit14(); - lit16(); - - } - if ((key&0xFF00)==0x4400) - { - //koniec - setcolor(RED); - outtextxy(616,472,"end"); - break; - } - while(bioskey(_KEYBRD_READY)) - { - bioskey(_KEYBRD_READ); } } diff --git a/NAPISY.PRJ b/CPIED.PRJ similarity index 80% rename from NAPISY.PRJ rename to CPIED.PRJ index 7085868..eb94ba3 100644 Binary files a/NAPISY.PRJ and b/CPIED.PRJ differ diff --git a/readthis.txt b/readthis.txt index 5992ee7..ab2d08c 100644 --- a/readthis.txt +++ b/readthis.txt @@ -9,7 +9,7 @@ # ## #### ### # # # # # # # # # # # # # ### ## # # Balthasar Szczepaäski -Edytor napis¢w 1.1b - the cpi editor +Edytor napis¢w 1.2a - the cpi editor ============================================================ @@ -121,29 +121,39 @@ The following actions can be performed: 4. Controls -create a new CPI - F1 -save a CPI file F2 -load a CPI file F3 -CP into VGA memory F4 -change CP number F5 -new font F6 -new codepage F7 -delete a font F8 -delete a codepage F9 -close the program F10 - -move the cursor arrow keys -set a pixel Enter -unset a pixel Backspace -change a pixel Space -switch edit/select Tab -next codepage PageDown -previous codepage PageUp -next font End -previous font Home +Everything can be controlled by the keyboard or mouse (if +there is a mouse installed). + +Action Keyboard Mouse + +create a new CPI F1 click the "1.new" text +save a CPI file F2 click the "2.save" text +load a CPI file F3 click the "3.load" text +CP into VGA memory F4 click the "4.use" text +change CP number F5 click the "5.number" text +new font F6 click the "6.newF" text +new codepage F7 click the "7.newCP" text +delete a font F8 click the "8.delF" text +delete a codepage F9 click the "9.delCP" text +close the program F10 click the "10.end" text + +move the cursor arrow keys move the mouse +select a character arrow keys* click the character +set a pixel Enter left click the pixel +unset a pixel Backspace right click the pixel +change a pixel Space middle click the pixel +switch edit/select Tab changes automatically +next codepage PageDown left click the "cp___" text +previous codepage PageUp right click the "cp___" text +next font End left click the "8x__" text +previous font Home right click the "8x__" text + +*The function of arrow keys is changed with Tab. A file can also be opened using it's name as a command line -parameter or by clicking its icon in Windows GUI. +parameter or by clicking its icon in Windows GUI. If a wrong +path is given the program closes without entering graphic +mode. ============================================================ @@ -159,7 +169,7 @@ beta: - Command line parameter support - Debug information removed from screen - Fixed Function keys -1.1 +1.1a - Full FONT flie format support - FONT.NT file format support (read only) - Codepage limit set from 6 to 16 @@ -179,6 +189,8 @@ beta: without entering graphic mode - Fixed a bug that crashed the program when loading a file from a long path +1.2 + - Added mouse support ============================================================ @@ -191,7 +203,6 @@ beta: - Exporting fonts to bitmaps - Importing fonts from bitmaps - Warnings - - Mouse support ============================================================ @@ -204,10 +215,10 @@ none. 8. Files EGAVGA .OBJ 5658 BGI driver compiled to OBJ -NAPISY .EXE 94468 The program -NAPISY .CPP 50905 Source for the program -NAPISY .PRJ 4605 Turbo C++ 3.0 project file -READTHIS.TXT 6875 This file +CPIED .EXE 107685 The program +CPIED .CPP 70458 Source for the program +CPIED .PRJ 4608 Turbo C++ 3.0 project file +READTHIS.TXT 7794 This file ============================================================