#include #include #include #include #include #include #include #include #include #include "d:\program\src_dos\libs\bdatos\bdatos.hh" #include "mail_.h" CONFIG Config = { 1, BLUE, RED, WHITE, BLACK, BLACK, WHITE, WHITE, BLACK, 0, { "PrnFile.out" } }; #define OFF 0 #define ON 1 #ifdef __cplusplus #define __CPPARGS ... #else #define __CPPARGS #endif #define GESTION_DE_SOCIOS 1 #define LISTA_DE_PRECIOS 2 #define GASTOS_INTERNOS 3 #define SALIR 4 int MenuPrincipal(void); void Mailings(void); void PideAnoActual(void); void DibujaPantallaGastosInt(void); int boton_izq; int boton_der; int x_raton, y_raton, RATON = 1; int main(void) { int ok; inicializa_raton_texto(); if( RATON ) desactiva_raton(); ok = 0; MenuPrincipal(); sleep( 5 ); Mailings(); clrscr(); printf( "\nJos‚ David Guill‚n || _-ùFuTuRe ViSiOnù-_ || 1996 (c)" ); printf( "\nJoshua G¢mez Garcia | Spiral Software || 1996 (c)" ); printf( "\n " ); printf( "\n e-mail: Jose-David.Guill‚n@cs.us.es " ); printf( "\n infomundo@arrakis.es " ); printf( "\n " ); printf( "\n " ); printf( "\n Ü ÜÄÄ Ü Ü ³ ÚÄÄÄ¿ " ); printf( "\n Û ÜÄ¿ÛÄÄ ÜÄÄ¿Û\\/Û Ü ÜÄ¿ÜÄ´ ÜÄ¿ ³ þ ³ " ); printf( "\n Û Û ³Û Û__³Û Û Û_³ Û ³Û_³ Û_³ ÀßßßÙ " ); printf( "\n" ); _setcursortype(_NORMALCURSOR); return 0; } int MenuPrincipal(void) { _setcursortype(_NOCURSOR); textcolor( WHITE ); textbackground( BLACK ); clrscr(); cprintf(" ÜÄÄÄ Ü \n\r"); cprintf(" Û Û \n\r"); cprintf(" ÛÄÄÄ ÜÄÄÄ¿ Û ³ ß ÜÄÄÄ¿ ÜÄÄ¿ Û ÚÄÄÜ ÜÄÄ¿ \n\r"); cprintf(" Û Û ³ Û ³ Û Û ³ ÜÄÄ´ Û ÀÄÄ¿ ÜÄÄ´ \n\r"); cprintf(" ßÄÄÄ ßÄÄÄ´ ßÄÄÄÙ ß ÛÄÄÄÙ ßÄÄÙ ßÄÄÄ ßÄÄÙ ßÄÄÙ \n\r"); cprintf(" Å Û \n\r"); cprintf(" ³ Û \n\r"); cprintf(" \n\r"); textcolor( RED ); cprintf(" ßÜ ÜÜ \n\r"); cprintf(" ßß ßÜ ÛÜ ÜÛ ßßßÛ ß Û ß ÛÜ Û ÛßßÛ ÛßßÛ \n\r"); cprintf(" ÜÜßßÜßÜ ß Û ß Û ÜÜÜÛ Û Û Û Û Û Û Û ÜÜ ßÜ \n\r"); cprintf(" Ü Ü Û Û ÛÜÜÛ Û ÛÜÜ Û Û Û ÛÜÜÛ ÛÜÜÛ \n\r"); cprintf(" ßß ÜÜß \n\r"); cprintf(" ÜÜßß \n\r"); cprintf(" \n\r"); cprintf(" \n\r"); cprintf(" \n\r"); cprintf(" \n\r"); textcolor( LIGHTGRAY ); cprintf(" ³ ³ ³\\ ³ ³ ÚÄÄ¿ ÜÜ ÜÜ ÜÜÜ ÜÜÜ Ü |> | _ Å\n\r"); cprintf(" ³ ³ ³ \\³ ÚÄÄ´ ³ÄÄÙ Û ß Û ÛÜÛ Û ÛßÛ Ûß ÛßÛ |> () |> ( |-| |\n\r"); cprintf(" ÀÄÄ Á Á Á ÀÄÄÙ ÀÄÄÙ ß ß ß ß ß ßßß ß ßßß \n\r"); cprintf(" \n\r"); cprintf(" \n\r"); textcolor( RED ); cprintf(" \n\r"); return 0; } int Funcion_Botones(int Funcion, int nBotones, struct Boton_Texto *Boton_Texto) { char i; int DEVOLVER = -1; int longitud, key, key2; switch( Funcion ) { case DIBUJA: highvideo(); textcolor(BLACK); textbackground(11); gotoxy(Boton_Texto[nBotones].x, Boton_Texto[nBotones].y); DEVOLVER = 0; longitud = strlen( Boton_Texto[nBotones].Texto ); while( DEVOLVER <= longitud ) { if( Boton_Texto[nBotones].Texto[DEVOLVER] == '&' ) { DEVOLVER ++; textcolor(RED); cprintf("%c", Boton_Texto[nBotones].Texto[DEVOLVER]); textcolor(BLACK); } else cprintf("%c", Boton_Texto[nBotones].Texto[DEVOLVER]); DEVOLVER ++; } // cprintf("%s", Texto); textbackground(7); // ±SALIR±Ü cprintf("ß"); // ßßßßßßß gotoxy(Boton_Texto[nBotones].x+1, Boton_Texto[nBotones].y+1); for(i = 0; i < longitud; i ++ ) // ±±±±±±±Ü cprintf("Ü"); // ßßßßßßß break; case DEPRIME: highvideo(); textcolor(BLACK); textbackground(11); gotoxy(Boton_Texto[nBotones].x, Boton_Texto[nBotones].y); DEVOLVER = 0; longitud = strlen( Boton_Texto[nBotones].Texto ); //////////////// textbackground(BLACK); while( DEVOLVER <= (longitud+1) ) { if( Boton_Texto[nBotones].Texto[DEVOLVER] == '&' ) { DEVOLVER ++; } cprintf(" "); DEVOLVER ++; } textbackground(11); gotoxy(Boton_Texto[nBotones].x+1, Boton_Texto[nBotones].y+1); DEVOLVER = 0; while( DEVOLVER <= longitud ) { if( Boton_Texto[nBotones].Texto[DEVOLVER] == '&' ) { DEVOLVER ++; textcolor(RED); cprintf("%c", Boton_Texto[nBotones].Texto[DEVOLVER]); textcolor(BLACK); } else cprintf("%c", Boton_Texto[nBotones].Texto[DEVOLVER]); DEVOLVER ++; } // cprintf("%s", Texto); // // ±±±±±±± break; case Dibuja_Todos: for( i=0; i < nBotones; i++) Funcion_Botones( DIBUJA, i, Boton_Texto); break; case COMPRUEBA: if( bioskey(1)!=0 ) { key = toupper( getch() ); DEVOLVER = -2; if ( key == 0 ) { key2 = toupper( getch() ); DEVOLVER = -1; } for( i=0; i < nBotones && DEVOLVER <= -1; i++){ if( key == Boton_Texto[i].ID_T1 ) { if( key == 0 ) { if( key2 == Boton_Texto[i].ID_T2 ){ DEVOLVER = (i + 1); Funcion_Botones( DEPRIME, (DEVOLVER-1), Boton_Texto); delay(150); //sleep(1); Funcion_Botones( DIBUJA, (DEVOLVER-1), Boton_Texto); } } else { DEVOLVER = (i + 1); Funcion_Botones( DEPRIME, (DEVOLVER-1), Boton_Texto); delay(150); //sleep(1); Funcion_Botones( DIBUJA, (DEVOLVER-1), Boton_Texto); } } } if( DEVOLVER == -2 ) { ungetch(key); } if( DEVOLVER == -1 ) { ungetch(key2); } } else if( RATON ) { DEVOLVER = 0; for( i=0; i < nBotones && DEVOLVER == 0; i++) { longitud = strlen( Boton_Texto[i].Texto ); if ( (x_raton+1) >= Boton_Texto[i].x && (x_raton+1) <= ( Boton_Texto[i].x + longitud -1) && y_raton == (Boton_Texto[i].y-1) ) { DEVOLVER = (i + 1); Funcion_Botones( DEPRIME, (DEVOLVER-1), Boton_Texto); if( RATON ) activa_raton(); espera_soltar(); if( RATON ) desactiva_raton(); // delay(150); Funcion_Botones( DIBUJA, (DEVOLVER-1), Boton_Texto); } } } break; case STD_BY: Funcion_Botones(Dibuja_Todos, nBotones, Boton_Texto); do{ if( RATON ) activa_raton(); if( RATON ) espera_pulsar(); else while( bioskey(1)==0 ); if( RATON ) desactiva_raton(); DEVOLVER = Funcion_Botones(COMPRUEBA, nBotones, Boton_Texto); }while(DEVOLVER==0 && bioskey(1)==0 ); } return DEVOLVER; } void inicializa_raton_texto(void) { union REGS ent, sal; ent.x.ax = 0; int86(0x33, &ent, &sal); /* averigua si hay rat¢n conectado */ if(sal.x.ax==0) { RATON = 0; return; } ent.x.ax = 15; ent.x.cx = 8; ent.x.dx = 16; int86(0x33, &ent, &sal); /* fija la raz¢n mickey/pixel */ ent.x.ax = 7; ent.x.cx = 0; ent.x.dx = 639; int86(0x33, &ent, &sal); /* fija la posici¢n m x. y m¡n. horizontal */ ent.x.ax = 8; ent.x.cx = 0; ent.x.dx = 199; int86(0x33, &ent, &sal); /* fija la posici¢n m x. y m¡n. vertical */ ent.x.ax = 4; ent.x.cx = 320; ent.x.dx = 100; int86(0x33, &ent, &sal); /* fija la posici¢n del rat¢n */ ent.x.ax = 1; int86(0x33, &ent, &sal); /* muestra el puntero del rat¢n */ } void activa_raton(void) { union REGS ent, sal; ent.x.ax = 1; int86(0x33, &ent, &sal); } void desactiva_raton(void) { union REGS ent, sal; ent.x.ax = 2; int86(0x33, &ent, &sal); } void espera_pulsar(void) { union REGS ent, sal; do{ if(bioskey(1)!=0) break; ent.x.ax = 3; int86(0x33, &ent, &sal); /* lee posici¢n y estados del bot¢n */ }while((sal.x.bx & 3)==0); boton_izq=sal.x.bx & 1; boton_der=(sal.x.bx >> 1) & 1; x_raton= (sal.x.cx >> 1) / 4; // / 8 y_raton= (sal.x.dx)/8; // /8 } void espera_soltar(void) { union REGS ent, sal; do{ ent.x.ax = 3; int86(0x33, &ent, &sal); /* lee posici¢n y estados del bot¢n */ }while((sal.x.bx & 3)!=0); boton_izq=sal.x.bx & 1; boton_der=(sal.x.bx >> 1) & 1; x_raton=sal.x.cx >> 1; y_raton=sal.x.dx; }