void splashscreen( void ) { extern char prog_date[]; extern char prog_time[]; #ifdef EDA_VERSION framebox( 17 + center_factor, 5, ( 17 + center_factor ) + 46, 11, REVERSEATTR ); dispstrhgc( "CU WRITER", ( 19 + center_factor ) + 12, 6, REVERSEATTR ); dispstrhgc( "Version 1.2", ( 19 + center_factor ) + 15, 7, REVERSEATTR ); dispstrhgc( "EDA version", ( 19 + center_factor ) + 15, 8, REVERSEATTR ); dispstrhgc( "ÍÀԹѹ·¹Ò¡Òèҡ ¨ØÌÒŧ¡Ã³ìÁËÒÇÔ·ÂÒÅÑÂ", ( 19 + center_factor ) + 6, 9, REVERSEATTR ); dispstrhgc( "Áͺá´è ¡ÃзÃǧµèÒ§»ÃÐà·È", ( 19 + center_factor ) + 10, 10, REVERSEATTR ); #else #ifdef CW_VERSION framebox( 17 + center_factor, 5, ( 17 + center_factor ) + 46, 13, REVERSEATTR ); /* framebox( 17 + center_factor, 5, ( 17 + center_factor ) + 46, 14, REVERSEATTR ); */ dispstrhgc( "CU WRITER", ( 19 + center_factor ) + 12, 6, REVERSEATTR ); dispstrhgc( "Version 1.41", ( 19 + center_factor ) + 15, 7, REVERSEATTR ); dispprintf( ( 19 + center_factor ) + 10, 8, REVERSEATTR, "%11s %8s", prog_date, prog_time ); dispstrhgc( "Hercules/EGA/VGA/MCGA/AT&T", ( 19 + center_factor ) + 8, 9, REVERSEATTR ); dispstrhgc( "¾Ñ²¹Òâ´Â ʶҺѹºÃÔ¡ÒäÍÁ¾ÔÇàµÍÃì ÃèÇÁ¡Ñº", ( 19 + center_factor ) + 5, 10, REVERSEATTR ); dispstrhgc( "ÀÒ¤ÇÔªÒÇÔÈÇ¡ÃÃÁ¤ÍÁ¾ÔÇàµÍÃì ¤³ÐÇÔÈÇ¡ÃÃÁÈÒʵÃì", ( 19 + center_factor ) + 2, 11, REVERSEATTR ); /* dispstrhgc( "áÅÐ ªÁÃÁ¤ÍÁ¾ÔÇàµÍÃì ͺ¨.", ( 19 + center_factor ) + 10, 12, REVERSEATTR ); dispstrhgc("¨ØÌÒŧ¡Ã³ìÁËÒÇÔ·ÂÒÅÑÂ", ( 19 + center_factor ) + 12, 13, REVERSEATTR ); */ dispstrhgc( "¨ØÌÒŧ¡Ã³ìÁËÒÇÔ·ÂÒÅÑÂ", ( 19 + center_factor ) + 12, 12, REVERSEATTR ); #else framebox( ( 17 + center_factor ), 5, ( 17 + center_factor ) + 46, 14, REVERSEATTR ); dispstrhgc( "THAI WRITE", ( 19 + center_factor ) + 11, 6, REVERSEATTR ); dispstrhgc( "Version 1.0.0", ( 19 + center_factor ) + 14, 7, REVERSEATTR ); dispprintf( ( 19 + center_factor ) + 11, 8, REVERSEATTR, "%11s %8s", prog_date, prog_time ); dispstrhgc( "Hercules/EGA/VGA/MCGA/AT&T", ( 19 + center_factor ) + 8, 9, REVERSEATTR ); dispstrhgc( "Khral Steelforge", ( 19 + center_factor ) + 13, 10, REVERSEATTR ); dispstrhgc( "The Forge Warband, Iron Legion", ( 19 + center_factor ) + 6, 11, REVERSEATTR ); dispstrhgc( "¾Ñ²¹Ò¨Ò¡ àÇÔÃì´¨ØÌÒ â´Â ÁËÒÇÔ·ÂÒÅѨØÌÒŧ¡Ã³ì", ( 19 + center_factor ) + 3, 13, REVERSEATTR ); #endif #endif if ( cu_song ) { cusong( ); } ebioskey( 0 ); cls( ); }
void set_all_lineperpage(set_linespace_mode mode) { char *find_lineperinch(void); static char m1[] = "¨Ó¹Ç¹ºÃ÷ѴµèÍ˹éÒäÁè¾Í " "à¤Ã×èͧ¨Ðà»ÅÕè¹ãËéà»ç¹¨Ó¹Ç¹ÊÙ§ÊØ´à·èÒ·Õè¨ÐÂÍÁä´é"; static char m2[] = "¡´»ØèÁ ESC à¾×èÍ·Ó§Ò¹µèÍä»"; if (userlineperpage > find_max_userline_perpage()) { userlineperpage = find_max_userline_perpage(); if (mode == INTERACTIVE) { savepic(); framebox(10, 8, 10+thaistrlen(m1)+4, 11, REVERSEATTR); dispstrhgc(m1, 10+2, 9, REVERSEATTR); dispstrhgc(m2, 10+ (thaistrlen(m1)+4 - thaistrlen(m2)) / 2, 10, REVERSEATTR); while (ebioskey(0) != ESCKEY) ; retpic(); writemenu(0, 1, 0); /* show new userline per page */ } } lineperpage = find_line_perpage(); if (mode == INTERACTIVE) { savepic(); /*" "*/ dispprintf(19,12,0, "¨Ó¹Ç¹ºÃ÷ѴµèÍ¡ÃдÒÉ 1 ¹ÔéÇ ¤×Í : %s ºÃ÷Ѵ/¹ÔéÇ", find_lineperinch()); ebioskey(0); retpic(); } }
int searchreplaceinfo( void ) { int i; int j; framebox( 4 + center_factor, 4, ( 7 + center_factor ) + 69, 12, REVERSEATTR ); dispstrhgc( "ãÊè¤Ó·Õèµéͧ¡Òäé¹ËÒ :", ( 7 + center_factor ), 5, REVERSEATTR ); dispstrhgc( "ãÊè¤Ó·Õèµéͧ¡ÒÃá·¹·Õè :", ( 7 + center_factor ), 6, REVERSEATTR ); dispstrhgc( "¤é¹ËÒẺä˹ (ãÊèµÑÇÍÑ¡ÉâͧµÑÇàÅ×Í¡·Õèµéͧ¡ÒÃ) :", ( 7 + center_factor ), 7, REVERSEATTR ); dispstrhgc( "µÑÇàÅ×Í¡ : G = àÃÔèÁ¤é¹ËÒµÑé§áµèµé¹á¿éÁ¢éÍÁÙÅ", ( 7 + center_factor ), 8, REVERSEATTR ); dispstrhgc( "U = äÁèʹ㨵ÑÇàÅç¡ËÃ×͵ÑÇãËè (àªè¹ a ¡Ñº A)", ( 7 + center_factor ), 9, REVERSEATTR ); dispstrhgc( "W = ¤é¹ËÒà»ç¹¤Ó (ËÃ×Íà»ç¹»ÃÐâ¤ã¹ÀÒÉÒä·Â)", ( 7 + center_factor ), 10, REVERSEATTR ); dispstrhgc( "N = äÁèµéͧËÂØ´¶ÒÁÇèÒ¨Ðá·¹·ÕèËÃ×ÍäÁè", ( 7 + center_factor ), 11, REVERSEATTR ); dispstrhgc( "<ESC> ¡àÅÔ¡", ( 7 + center_factor ), 12, REVERSEATTR ); dispstrhgc( source, ( 7 + center_factor ), 5, REVERSEATTR ); dispstrhgc( replace, ( 7 + center_factor ), 6, REVERSEATTR ); dispstrhgc( option, ( 7 + center_factor ), 7, REVERSEATTR ); pagecomplete = NO; for ( ;; ) { i = getstring( source, ( 7 + center_factor ) + 18, 5, 49, REVERSEATTR, THAIENG ); switch ( i ) { case ESCKEY: return( ESCKEY ); case DNKEY: case YES: do { i = getstring( replace, ( 7 + center_factor ) + 18, 6, 49, REVERSEATTR, THAIENG ); switch ( i ) { case ESCKEY: return( ESCKEY ); case DNKEY: case YES: do { j = getstring( option, ( 7 + center_factor ) + 40, 7, 3, REVERSEATTR, ENGLISH ); switch ( j ) { case ESCKEY: return( ESCKEY ); case YES: strupr( option ); return( YES ); } } while ( j != UPKEY ); break; } } while ( i != UPKEY ); break; } } }
void gotoline( void ) { char st[5]; register int linetogo; st[0] = '\0'; framebox( 22 - CENTER_FACTOR, 4, 22 - CENTER_FACTOR + 49, 6, 2 ); dispstrhgc( " – µéͧ¡ÒÃä»·ÕèºÃ÷Ѵ·Õèà·èÒäà ? (¹Ñº¨Ò¡µé¹á¿éÁ¢éÍÁÙÅ)", 22 - CENTER_FACTOR, 5, 2 ); if ( getstring( st, 65 - CENTER_FACTOR, 5, 4, 2, NUMBER ) ) { linetogo = atoi( st ); if ( linetogo >= 1 ) { goline( linetogo ); } } pagecomplete = NO; }
void gotopage( void ) { char st[4]; int linetogo; st[0] = '\0'; framebox( 30 - CENTER_FACTOR, 4, 30 - CENTER_FACTOR + 29, 6, 2 ); dispstrhgc( "µéͧ¡ÒÃä»·Õè˹éÒ·Õèà·èÒäà ? ", 30 - CENTER_FACTOR + 3, 5, 2 ); if ( getstring( st, 54 - CENTER_FACTOR, 5, 3, 2, NUMBER ) ) { linetogo = ( atoi( st ) * lineperpage ) - lineperpage + 1; if ( linetogo >= 1 ) { goline( linetogo ); } } pagecomplete = NO; }
void showerrno( void ) { errorsound( ); blockmsg( 5 ); switch ( errno ) { case ENOENT: dispstrhgc( "ËÒá¿éÁ¢éÍÁÙÅäÁ辺 ! ¡´»ØèÁã´æà¾×èÍ·Ó§Ò¹µèÍ...", ( 7 + center_factor ) + 15, 5, REVERSEATTR ); break; case ENOMEM: dispstrhgc( "˹èǤÇÒÁ¨ÓäÁè¾Í ! ¡´»ØèÁã´æà¾×èÍ·Ó§Ò¹µèÍ...", ( 14 + center_factor ) + 8, 6, REVERSEATTR ); break; default: framebox( 13 + center_factor, 4, ( 13 + center_factor ) + 54, 7, REVERSEATTR ); dispstrhgc( "à¡Ô´¤ÇÒÁ¼Ô´¾ÅÒ´ÀÒÂã¹Ãкº !", ( 14 + center_factor ) + 15, 5, REVERSEATTR ); dispstrhgc( sys_errlist[errno], ( 14 + center_factor ) + 15, 6, REVERSEATTR ); } ebioskey( 0 ); }
void doonscrn(register unsigned key,unsigned x,unsigned y) { register int j; char st[4],invmsg[60]; key &= 0xff; if (!isalpha(key) && !iscntrl(key)) return; key &= 0x1f; switch(key) { case 'l' - 'a' + 1 : itoa(leftmar,st,10); framebox(25-CENTER_FACTOR, 4, 25-CENTER_FACTOR+39, 6,REVERSEATTR); dispstrhgc("µйЌІ°“√µ—йІ°—麀铬Ј’и§Ќ≈—ЅємЈ’иаЈи“дЋ√и ?",25-CENTER_FACTOR+4,5,REVERSEATTR); if (getstring(st,58-CENTER_FACTOR,5,3,2,NUMBER)) { j = atoi(st); if ((j < rightmar) && (j > 0)) { leftmar = j; } else { /* Invalid Left Margin */ if (j<1) strcpy(invmsg,"°—麀铬єйЌ¬°«и“ 1 !"); else strcpy(invmsg,"°—麀铬Ѕ“°°«и“°—йє¢«“ !"); strcat(invmsg," °іїЎиЅгіжаЊ„иЌЈ”І“єµиЌ ..."); blockmsg(10); dispstrhgc(invmsg,25-CENTER_FACTOR,10,REVERSEATTR); errorsound(); ebioskey(0); } } break; case 'r' -'a' + 1 : itoa(rightmar,st,10); framebox(25-CENTER_FACTOR, 4, 25-CENTER_FACTOR+39, 6, 2); dispstrhgc("µйЌІ°“√µ—йІ°—йє¢«“Ј’и§Ќ≈—ЅємЈ’иаЈи“дЋ√и ?",25-CENTER_FACTOR+4,5,2); if (getstring(st,58-CENTER_FACTOR,5,3,2,NUMBER)) { j = atoi(st); if ((j > leftmar) && (j <= MAXRMAR)) { rightmar = j; } else { /* Invalid Right Margin */ if (j<=leftmar) strcpy(invmsg,"°—йє¢«“єйЌ¬°«и“°—麀铬 !"); else sprintf(invmsg,"°—йє¢«“ ўІ ЎідЅиа°‘є %d !",MAXRMAR); strcat(invmsg," °іїЎиЅгіжаЊ„иЌЈ”І“єµиЌ ..."); blockmsg(10); dispstrhgc(invmsg,25-CENTER_FACTOR,10,REVERSEATTR); errorsound(); ebioskey(0); } } break; case 'i' -'a' + 1: itoa(x+1,st,10); framebox(25-CENTER_FACTOR, 4, 25-CENTER_FACTOR+39, 6, 2); dispstrhgc("µйЌІ°“√µ—йІ TAB Ј’и§Ќ≈—ЅємЈ’иаЈи“дЋ√и ?",25-CENTER_FACTOR+4,5,2); if (getstring(st,58-CENTER_FACTOR,5,3,2,NUMBER)) { j = atoi(st); if ((j <= MAXCOL) && (j > 0)) tab[j - 1]=YES; } break; case 'n' - 'a' + 1 : strcpy(st,"ALL"); framebox(25-CENTER_FACTOR, 4, 25-CENTER_FACTOR+39, 6, 2); dispstrhgc("µйЌІ°“√≈Ї TAB Ј’и§Ќ≈—ЅємЈ’иаЈи“дЋ√и ?",25-CENTER_FACTOR+4,5,2); if (getstring(st,58-CENTER_FACTOR,5,3,2,NUMBER)) { if (strcmp(st,"ALL") == 0) { for (j=0;j < MAXCOL;++j) tab[j] = NO; } else { j = atoi(st); if ((j <= MAXCOL) && (j > 0)) tab[j - 1] = NO; } } break; case 'p' - 'a' + 1 : itoa(lineperpage,st,10); framebox(25-CENTER_FACTOR, 4, 25-CENTER_FACTOR+41, 6, 2); dispstrhgc("µйЌІ°“√µ—йІ®”є«єЇ√√Ј—іµиЌЋєй“аЈи“дЋ√и ?",25-CENTER_FACTOR+4,5,2); if (getstring(st,61-CENTER_FACTOR,5,3,2,NUMBER)) { if (atoi(st) > 0) { lineperpage = atoi(st); writepageline(); } } break; case 'c' - 'a' + 1 : centerline(y); break; case 'x' - 'a' + 1 : relmargin = !relmargin; relmarstatus(); break; } pagecomplete = NO; writestatus(x); }
void blockmsg( int p_linePos ) { framebox( 5, p_linePos - 1, ( 5 + 69 ) + shrink_factor, p_linePos + 1, REVERSEATTR ); }