First commit 07/10/1996
This commit is contained in:
334
MAIL_M.CPP
Normal file
334
MAIL_M.CPP
Normal file
@ -0,0 +1,334 @@
|
||||
#include <io.h>
|
||||
#include <dos.h>
|
||||
#include <conio.h>
|
||||
#include<bios.h>
|
||||
#include<dos.h>
|
||||
#include<stdlib.h>
|
||||
#include<conio.h>
|
||||
#include<string.h>
|
||||
#include<ctype.h>
|
||||
|
||||
#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<EFBFBD> David Guill<6C>n || _-<2D>FuTuRe ViSiOn<4F>-_ || 1996 (c)" );
|
||||
printf( "\nJoshua G<>mez Garcia | Spiral Software || 1996 (c)" );
|
||||
printf( "\n " );
|
||||
printf( "\n e-mail: Jose-David.Guill<6C>n@cs.us.es " );
|
||||
printf( "\n infomundo@arrakis.es " );
|
||||
printf( "\n " );
|
||||
printf( "\n " );
|
||||
printf( "\n <20> <20><><EFBFBD> <20> <20> <20> <20><><EFBFBD>Ŀ " );
|
||||
printf( "\n <20> <20>Ŀ<EFBFBD><C4BF><EFBFBD> <20><>Ŀ<EFBFBD>\\/<2F> <20> <20>Ŀ<EFBFBD>Ĵ <20>Ŀ <20> <20> <20> " );
|
||||
printf( "\n <20> <20> <20><> <20>__<5F><5F> <20> <20>_<EFBFBD> <20> <20><>_<EFBFBD> <20>_<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> " );
|
||||
printf( "\n" );
|
||||
|
||||
|
||||
_setcursortype(_NORMALCURSOR);
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int MenuPrincipal(void)
|
||||
{
|
||||
_setcursortype(_NOCURSOR);
|
||||
textcolor( WHITE );
|
||||
textbackground( BLACK );
|
||||
clrscr();
|
||||
|
||||
cprintf(" <20><><EFBFBD><EFBFBD> <20> \n\r");
|
||||
cprintf(" <20> <20> \n\r");
|
||||
cprintf(" <20><><EFBFBD><EFBFBD> <20><><EFBFBD>Ŀ <20> <20> <20> <20><><EFBFBD>Ŀ <20><>Ŀ <20> <20><><EFBFBD><EFBFBD> <20><>Ŀ \n\r");
|
||||
cprintf(" <20> <20> <20> <20> <20> <20> <20> <20> <20><>Ĵ <20> <20><>Ŀ <20><>Ĵ \n\r");
|
||||
cprintf(" <20><><EFBFBD><EFBFBD> <20><><EFBFBD>Ĵ <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> \n\r");
|
||||
cprintf(" <20> <20> \n\r");
|
||||
cprintf(" <20> <20> \n\r");
|
||||
cprintf(" \n\r");
|
||||
textcolor( RED );
|
||||
cprintf(" <20><> <20><> \n\r");
|
||||
cprintf(" <20><> <20><> <20><> <20><> <20><><EFBFBD><EFBFBD> <20> <20> <20> <20><> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> \n\r");
|
||||
cprintf(" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20> <20> <20> <20><><EFBFBD><EFBFBD> <20> <20> <20> <20> <20> <20> <20> <20><> <20><> \n\r");
|
||||
cprintf(" <20> <20> <20> <20> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD> <20> <20> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> \n\r");
|
||||
cprintf(" <20><> <20><><EFBFBD> \n\r");
|
||||
cprintf(" <20><><EFBFBD><EFBFBD> \n\r");
|
||||
cprintf(" \n\r");
|
||||
cprintf(" \n\r");
|
||||
cprintf(" \n\r");
|
||||
cprintf(" \n\r");
|
||||
textcolor( LIGHTGRAY );
|
||||
cprintf(" <20> <20> <20>\\ <20> <20> <20><>Ŀ <20><> <20><> <20><><EFBFBD> <20><><EFBFBD> <20> |> | _ <20>\n\r");
|
||||
cprintf(" <20> <20> <20> \\<EFBFBD> <20><>Ĵ <20><><EFBFBD><EFBFBD> <20> <20> <20> <20><><EFBFBD> <20> <20><><EFBFBD> <20><> <20><><EFBFBD> |> () |> ( |-| |\n\r");
|
||||
cprintf(" <20><><EFBFBD> <20> <20> <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20> <20> <20> <20> <20><><EFBFBD> <20> <20><><EFBFBD> \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); // <20>SALIR<49><52>
|
||||
cprintf("<EFBFBD>"); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
gotoxy(Boton_Texto[nBotones].x+1, Boton_Texto[nBotones].y+1);
|
||||
for(i = 0; i < longitud; i ++ ) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
cprintf("<EFBFBD>"); // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
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); //
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
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<61>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<61>n mickey/pixel */
|
||||
|
||||
ent.x.ax = 7;
|
||||
ent.x.cx = 0;
|
||||
ent.x.dx = 639;
|
||||
int86(0x33, &ent, &sal); /* fija la posici<63>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<63>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<63>n del rat<61>n */
|
||||
|
||||
ent.x.ax = 1;
|
||||
int86(0x33, &ent, &sal); /* muestra el puntero del rat<61>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<63>n y estados del bot<6F>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<63>n y estados del bot<6F>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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user