First commit 04/09/1996

This commit is contained in:
José David Guillén 2021-09-12 20:24:08 +02:00
commit 885bf44ba6
21 changed files with 4886 additions and 0 deletions

BIN
ARTICULO.DBF Normal file

Binary file not shown.

BIN
GASTOSI.000 Normal file

Binary file not shown.

BIN
GASTOSI.096 Normal file

Binary file not shown.

BIN
GASTOSI.097 Normal file

Binary file not shown.

BIN
P.EXE Normal file

Binary file not shown.

2
PRNFILE.OUT Normal file
View File

@ -0,0 +1,2 @@
C¢digo Proveedor Cant.Unt P.Costo P.Venta Combinado

1
R.BAT Normal file
View File

@ -0,0 +1 @@
edit zorr.img

9
README.md Normal file
View File

@ -0,0 +1,9 @@
#LosArcosChicos
*04/09/1996*
ToDo: wwtcf?
![screenshot](/LosArcosChicos.png "Screenshot")

BIN
SOCIOS.096 Normal file

Binary file not shown.

BIN
SOCIOS.097 Normal file

Binary file not shown.

933
TXT_LP.CPP Normal file
View File

@ -0,0 +1,933 @@
#include <alloc.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
#include "d:\program\src_dos\libs\bdatos\bdatos.hh"
#include "zorr.h"
#define NLINEAS_REF 18
BDatos BCompras; // Base de datos de Compraserencias
INFO_PRECIOS SCompras; // Estructura de referencias
int OrdenGestionInterna;
extern CONFIG Config;
void RastreaFicheroGastosi(void);
void Error( int code );
void MuestraDatosCompras( int RowStart );
int ComparaRegistros( const void *A, const void *B );
void EditItemCompras( char columna, int linea );
void ComprasNuevoRegistro( INFO_PRECIOS *MSCompras );
void MuestraCompras( char columna, int linea, char como );
void ObtenCoordenadasCompras( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 );
void OrdenarGastosi(void);
void ObtenCoordenadasMatch( char Row, int *X0, int *Y0, int *X1, int *Y1 );
void MatchDrawCompras( char Row, INFO_PRECIOS MCompras, char como );
void BuscaCompras( char TipoBusqueda, char *CurrRow, int *CurrCompras );
int Match_Compras( INFO_PRECIOS A, INFO_PRECIOS B );
void EditMatchCompras( char Row, INFO_PRECIOS * MCompras );
int ObtenMatchCompras( INFO_PRECIOS *MCompras );
void ImprimeCompraserencias( char como );
void ImprimeCabeceraCompras( char como, FILE *file_out );
void DibujaPantallaGastosInt( void );
// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
// Û Parte principal del m¢dulo Û
// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
/**************************************************************************\
|* *|
|* InfoProducto *|
|* *|
|* Descripci¢n: *|
|* Controla la introduccion de datos y muestreo asi como todo *|
|* el interfaz de usuario... *|
|* *|
|* Entradas: (ninguna) *|
|* Salidas: (ninguna) *|
|* *|
\**************************************************************************/
void GastosInternos(void)
{
struct Boton_Texto BT[6];
BT[0].x = 1; BT[0].y = 1; strcpy( BT[0].Texto, " &Men£ Principal "); BT[0].ID_T1 = 0; BT[0].ID_T2 = 50;
BT[1].x = 20; BT[1].y = 1; strcpy( BT[1].Texto, " &Ins. Art."); BT[1].ID_T1 = 0; BT[1].ID_T2 = 23;
BT[2].x = 33; BT[2].y = 1; strcpy( BT[2].Texto, " &Borr. Art."); BT[2].ID_T1 = 0; BT[2].ID_T2 = 48;
BT[3].x = 47; BT[3].y = 1; strcpy( BT[3].Texto, " &Ordenar"); BT[3].ID_T1 = 0; BT[3].ID_T2 = 24;
BT[4].x = 58; BT[4].y = 1; strcpy( BT[4].Texto, " &Gast.Prov."); BT[4].ID_T1 = 0; BT[4].ID_T2 = 0;
BT[5].x = 72; BT[5].y = 1; strcpy( BT[5].Texto, " Im&pr. "); BT[5].ID_T1 = 0; BT[5].ID_T2 = 25;
char buffer[100], ok = 0;
int BPush, key;
char oldCol;
char CurrRow; // Linea sobre la que estamos
char CurrCol; // Columna sobre la que estamos
long CurrCompras; // Producto sobre el que estamos posicionados a golpes
_setcursortype( _NOCURSOR );
DibujaPantallaGastosInt();
sprintf( buffer, "GastosI.%03d", AnoActual );
if ( BCompras.AbrirReg( buffer, sizeof( INFO_PRECIOS ) ) == ERROR )
Error(0x01);
// Si no hay registros, creamos uno almenos.
if ( BCompras.Registros() == 0 )
{
ComprasNuevoRegistro( &SCompras );
if ( BCompras.InsReg( (void *)&SCompras, BCompras.Registros(), ARRIBA ) == ERROR )
Error(0x02);
}
CurrCompras = 0; CurrRow = 0;
// Mostramos datos hasta que se nos acabe la pantalla
MuestraDatosCompras( CurrRow + CurrCompras );
if ( BCompras.LeeReg( (void *)&SCompras, 0 ) == ERROR )
Error(0x03);
CurrCol = 0; oldCol = -1;
do {
if ( CurrCol != oldCol )
{
oldCol = CurrCol;
}
MuestraCompras( CurrCol, CurrRow, INTENSO );
BPush = Funcion_Botones(STD_BY, 6, BT);
MuestraCompras( CurrCol, CurrRow, NORMAL );
switch ( BPush )
{
case 0: // No se pulso ningun BOTON
while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER
break;
case -2: // Hay una tecla normal en BUFFER
if ( ( key = getch() ) != 13 && key != 27 )
ungetch( key );
EditItemCompras( CurrCol, CurrRow );
_setcursortype( _NOCURSOR );
if ( BCompras.EscribeReg( (void *)&SCompras, (CurrRow + CurrCompras) ) == ERROR )
Error(0x04);
while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER
break;
case -1: // Hay una tecla especial en BUFFER
switch( getch() )
{
// Flecha Izquierda
case 75:
case 15:
CurrCol--; if ( CurrCol < 0 ) CurrCol = 5;
break;
// Flecha Derecha
case 77:
case 9:
CurrCol++; if ( CurrCol > 5 ) CurrCol = 0;
break;
// Flecha Arriba
case 72:
if ( (CurrRow + CurrCompras) > 0 )
{
if ( ( CurrRow ) <= 0 )
{
CurrRow = NLINEAS_REF - 1; CurrCompras -= NLINEAS_REF;
if ( CurrCompras < 0 ) CurrCompras = 0;
while( ( CurrRow + CurrCompras ) >= BCompras.Registros() && CurrRow > 0 ) CurrRow--;
while( ( CurrRow + CurrCompras ) >= BCompras.Registros() && CurrCompras > 0 ) CurrCompras++;
// Mostramos datos hasta que se nos acabe la pantalla
MuestraDatosCompras( CurrCompras );
} else {
CurrRow --; if ( CurrRow < 0 ) CurrRow = 0;
}
}
if ( BCompras.LeeReg( (void *)&SCompras, (CurrCompras + CurrRow) ) == ERROR )
Error(0x03);
break;
// Flecha Abajo
case 80:
if ( ( CurrRow + CurrCompras ) < BCompras.Registros() - 1 )
{
if ( ( CurrRow ) >= NLINEAS_REF - 1 )
{
CurrRow = 0; CurrCompras += NLINEAS_REF;
while ( (CurrCompras + CurrRow) >= BCompras.Registros() ) CurrCompras--;
// Mostramos datos hasta que se nos acabe la pantalla
MuestraDatosCompras( CurrCompras );
} else
CurrRow++;
}
if ( BCompras.LeeReg( (void *)&SCompras, (CurrCompras + CurrRow) ) == ERROR )
Error(0x03);
break;
// Inicio
case 71:
CurrRow = 0;
if ( CurrCompras != 0 )
{
CurrCompras = 0;
// Mostramos datos hasta que se nos acabe la pantalla
MuestraDatosCompras( CurrCompras );
}
if ( BCompras.LeeReg( (void *)&SCompras, (CurrCompras + CurrRow) ) == ERROR )
Error(0x03);
break;
// Fin
case 79:
CurrRow = 0;
if ( CurrCompras != BCompras.Registros() - NLINEAS_REF )
{
CurrCompras = BCompras.Registros() - NLINEAS_REF;
while( CurrCompras >= BCompras.Registros() ) CurrCompras--;
if ( CurrCompras < 0 ) {
CurrCompras = 0;
CurrRow = BCompras.Registros()-1;
}
// Mostramos datos hasta que se nos acabe la pantalla
MuestraDatosCompras( CurrCompras );
}
if ( BCompras.LeeReg( (void *)&SCompras, (CurrCompras + CurrRow) ) == ERROR )
Error(0x03);
break;
// AvanceR pido
case 81:
CurrRow = 0; CurrCompras += NLINEAS_REF;
while ( (CurrCompras + CurrRow) >= BCompras.Registros() ) CurrCompras--;
// Mostramos datos hasta que se nos acabe la pantalla
MuestraDatosCompras( CurrCompras );
if ( BCompras.LeeReg( (void *)&SCompras, (CurrCompras + CurrRow) ) == ERROR )
Error(0x03);
break;
// Retroceso R pido
case 73:
CurrRow = NLINEAS_REF - 1; CurrCompras -= NLINEAS_REF;
if ( CurrCompras < 0 ) CurrCompras = 0;
while( ( CurrRow + CurrCompras ) >= BCompras.Registros() && CurrRow > 0 ) CurrRow--;
while( ( CurrRow + CurrCompras ) >= BCompras.Registros() && CurrCompras > 0 ) CurrCompras++;
// Mostramos datos hasta que se nos acabe la pantalla
MuestraDatosCompras( CurrCompras );
if ( BCompras.LeeReg( (void *)&SCompras, (CurrCompras + CurrRow) ) == ERROR )
Error(0x03);
break;
}
while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER
break;
// Imprimir Lista de socios
case 6:
// MuestraImpresionesCompras();
break;
// Menu Principal
case 1:
ok = 1;
break;
// Eliminar
case 3:
while( kbhit() ) getch();
if ( Optar( 1, "ATENCION", "Eliminar  un gasto interno", "confirme eliminacion", NULL ) )
{
if ( BCompras.DelReg( CurrCompras + CurrRow ) == ERROR )
Error(0x05);
if ( BCompras.Registros() == 0 )
{
ComprasNuevoRegistro( &SCompras );
if ( BCompras.InsReg( (void *)&SCompras, BCompras.Registros(), ARRIBA ) == ERROR )
Error(0x02);
CurrRow = 0;
} else
// Si he borrado el £ltimo registro subo una linea
if ( (CurrCompras+CurrRow) >= ( BCompras.Registros() - 2 ) )
{
if ( (CurrRow + CurrCompras) > 0 )
{
if ( ( CurrRow ) <= 0 )
{
CurrRow = NLINEAS_REF - 1; CurrCompras -= NLINEAS_REF;
if ( CurrCompras < 0 ) CurrCompras = 0;
while( ( CurrRow + CurrCompras ) >= BCompras.Registros() && CurrRow > 0 ) CurrRow--;
while( ( CurrRow + CurrCompras ) >= BCompras.Registros() && CurrCompras > 0 ) CurrCompras++;
// Mostramos datos hasta que se nos acabe la pantalla
MuestraDatosCompras( CurrCompras );
} else {
CurrRow --; if ( CurrRow < 0 ) CurrRow = 0;
}
}
if ( BCompras.LeeReg( (void *)&SCompras, (CurrCompras + CurrRow) ) == ERROR )
Error(0x03);
}
// Mostramos datos hasta que se nos acabe la pantalla
MuestraDatosCompras( CurrCompras );
if ( BCompras.LeeReg( (void *)&SCompras, (CurrCompras + CurrRow) ) == ERROR )
Error(0x03);
}
break;
// Insertar
case 2:
ComprasNuevoRegistro( &SCompras );
if ( BCompras.InsReg( (void *)&SCompras, (CurrCompras + CurrRow), ARRIBA ) == ERROR )
Error(0x02);
if ( ( CurrRow + CurrCompras ) < BCompras.Registros() - 1 )
{
if ( ( CurrRow ) >= NLINEAS_REF - 1 )
{
CurrRow = 0; CurrCompras += NLINEAS_REF;
while ( (CurrCompras + CurrRow) >= BCompras.Registros() ) CurrCompras--;
} else
CurrRow++;
}
// Mostramos datos hasta que se nos acabe la pantalla
MuestraDatosCompras( CurrCompras );
if ( BCompras.LeeReg( (void *)&SCompras, (CurrCompras + CurrRow) ) == ERROR )
Error(0x03);
break;
// Ordenar
case 4:
OrdenarGastosi();
CurrCompras = 0; CurrRow = 0;
// Mostramos datos hasta que se nos acabe la pantalla
MuestraDatosCompras( CurrRow + CurrCompras );
if ( BCompras.LeeReg( (void *)&SCompras, 0 ) == ERROR )
Error(0x03);
CurrCol = 0;
break;
// Gastos por proveedor
case 5:
RastreaFicheroGastosi();
break;
default:
while( kbhit() ) getch();
break;
}
} while( !ok );
BCompras.CerrarReg();
}
/**************************************************************************\
|* *|
|* MuestraDatosCompras *|
|* *|
|* Descripci¢n: *|
|* Dado un registro, se muestran sucesivamente este y todos *|
|* los que hay por debajo de l, hasta que se agote la base *|
|* o no quepan mas en la pantalla. *|
|* *|
|* Entradas: Registro por el que comenzar *|
|* Salidas: (ninguna) *|
|* *|
\**************************************************************************/
void MuestraDatosCompras( int RowStart )
{
int linea, campo;
char dev;
// Imprimo la NLINEAS_REF que caben en la pantalla
dev = OK;
for ( linea=0; linea < NLINEAS_REF && dev == OK; linea++ )
{
dev = BCompras.LeeReg( (void *)&SCompras, RowStart + linea );
if ( dev == OK )
// Por cada linea hay 6 campos, ehhh!!!
for ( campo=0; campo < 6; campo++ )
MuestraCompras( campo, linea, NORMAL );
}
// Ahora limpio los restantes huecos si los hay
if ( dev != OK )
{
linea--;
textbackground( BLACK );
textcolor( WHITE );
for ( ; linea < NLINEAS_REF; linea++ )
for ( campo=0; campo < 6; campo++ )
{
gotoxy( 1, linea + 6 );
cprintf( "³ ³ ³ ³ ³ ³ ³");
}
}
}
/**************************************************************************\
|* *|
|* MuestraCompras *|
|* *|
|* Descripci¢n: *|
|* Reescribe el campo dado, seg£n la fila, y la intensidad *|
|* *|
|* Entradas: *|
|* columna campo ha mostar *|
|* linea linea en la que nos encontramos *|
|* como intensidad del texto (NORMAL/INTENSO) *|
|* *|
|* Salidas: (ninguna) *|
|* *|
\**************************************************************************/
void MuestraCompras( char columna, int linea, char como )
{
char buffer[80];
char buffer1[80];
int X0, Y0, X1, Y1;
ObtenCoordenadasCompras( columna, linea, &X0, &Y0, &X1, &Y1 );
switch( columna )
{
// Fecha
case 0:
sprintf ( buffer, " %02d-%02d-%02d ", (int)SCompras.Fecha.da_day, (int)SCompras.Fecha.da_mon, SCompras.Fecha.da_year );
break;
// Articulo
case 1:
sprintf ( buffer, "%24s", SCompras.Articulo );
break;
// Cantidades
case 2:
sprintf ( buffer, " %04d", SCompras.Cantidades );
break;
// Precio
case 3:
formatea_u_long( SCompras.Precio, buffer1 );
sprintf ( buffer, " %7s", buffer1 );
break;
// Total
case 4:
formatea_u_long( SCompras.Precio * SCompras.Cantidades, buffer1 );
sprintf ( buffer, "%13s", buffer1 );
break;
// N§ Proveedor
case 5:
sprintf ( buffer, " %03d", SCompras.Proveedor );
break;
}
textbackground( ( como == NORMAL ) ? Config.TxtBgN : Config.TxtBgI );
strnset( buffer1, 32, X1 );
textcolor( ( como == NORMAL ) ? Config.TxtFgN : Config.TxtFgI );
gotoxy( X0, Y0 );
cprintf( "%s", buffer );
}
/**************************************************************************\
|* *|
|* EditItemCompras *|
|* *|
|* Descripci¢n: *|
|* Se encarga de editar y validar el campo. *|
|* *|
|* Entradas: *|
|* columna campo ha editar *|
|* linea linea en la que nos encontramos *|
|* *|
|* Salidas: (ninguna) *|
|* *|
\**************************************************************************/
void EditItemCompras( char columna, int linea )
{
char buffer[80];
int X0, Y0, X1, Y1;
ObtenCoordenadasCompras( columna, linea, &X0, &Y0, &X1, &Y1 );
switch( columna )
{
// Fecha
case 0:
sprintf ( buffer, "%02d%02d", (int)SCompras.Fecha.da_day, (int)SCompras.Fecha.da_mon );
if ( !( InputCadenaG( buffer, 1, 4, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) )
if ( ( (buffer[0]-'0')*10 + (buffer[1]-'0') ) <= 31 && ( (buffer[2]-'0')*10 + (buffer[3]-'0') ) <= 12 )
{
SCompras.Fecha.da_day = (char)((buffer[0]-'0')*10 + (buffer[1]-'0'));
SCompras.Fecha.da_mon = (char)((buffer[2]-'0')*10 + (buffer[3]-'0'));
SCompras.Fecha.da_year = AnoActual;
}
break;
// Articulo
case 1:
strcpy ( buffer, SCompras.Articulo );
if ( !( InputCadenaG( buffer, 0, 24, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) )
strcpy ( SCompras.Articulo, buffer );
break;
// Cantidad
case 2:
sprintf ( buffer, "%d", SCompras.Cantidades );
if ( !( InputCadenaG( buffer, 0, 4, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) )
{
SCompras.Cantidades = atoi( buffer );
MuestraCompras( 4, linea, NORMAL );
}
break;
// Precio
case 3:
sprintf ( buffer, "%ld", SCompras.Precio );
if ( !( InputCadenaG( buffer, 0, 6, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) )
{
SCompras.Precio = atol( buffer );
MuestraCompras( 4, linea, NORMAL );
}
break;
//Total
case 4:
break;
// Proveedor
case 5:
sprintf ( buffer, "%d", SCompras.Proveedor );
if ( !( InputCadenaG( buffer, 0, 3, Config.TxtBgN, Config.TxtFgN, X0, Y0, X1, Y1) >> 8 ) )
SCompras.Proveedor = atoi( buffer );
break;
}
}
/**************************************************************************\
|* *|
|* ObtenCoordenadasCompras *|
|* *|
|* Descripci¢n: *|
|* Obtiene las coordenadas de acotacion para el campo pedido *|
|* *|
|* Entradas: *|
|* columna campo del que obtener las coordenadas *|
|* linea linea en la que nos encontramos *|
|* X0 Y0 X1 Y1 Punteros para devolver las coordenadas *|
|* *|
|* Salidas: (ninguna) *|
|* *|
\**************************************************************************/
void ObtenCoordenadasCompras( char columna, char linea, int *X0, int *Y0, int *X1, int *Y1 )
{
// Calculamos la Y0, Y1 para la linea dada ( SOLO columna < 6 )
*Y0 = 6 + linea;
*Y1 = 6 + linea;
switch( columna )
{
case 0:
*X0 = 2; *X1 = 10;
break;
case 1:
*X0 = 13; *X1 = 24;
break;
case 2:
*X0 = 38; *X1 = 7;
break;
case 3:
*X0 = 46; *X1 = 10;
break;
case 4:
*X0 = 57; *X1 = 13;
break;
case 5:
*X0 = 71; *X1 = 9;
break;
}
}
/**************************************************************************\
|* *|
|* ComprasNuevoRegistro *|
|* *|
|* Descripci¢n: *|
|* Limpia el buffer, para un nuevo registro. *|
|* *|
|* Entradas: (ninguna) *|
|* Salidas: (ninguna) *|
|* *|
\**************************************************************************/
void ComprasNuevoRegistro( INFO_PRECIOS *NSCompras )
{
NSCompras -> Fecha.da_day = 0;
NSCompras -> Fecha.da_mon = 0;
NSCompras -> Fecha.da_year = AnoActual;
NSCompras -> Articulo[0] = '\0';
NSCompras -> Cantidades = 0;
NSCompras -> Precio = 0;
NSCompras -> Proveedor = 0;
}
// ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
// Û Parte secundaria del m¢dulo Û
// Û Û
// Û Secci¢n de Busqueda de refecencias Û
// ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
/**************************************************************************\
|* *|
|* MuestraImpresionesRed *|
|* *|
|* Descripci¢n: *|
|* Muestra un cuadro con las distintas opciones de impresi¢n *|
|* *|
|* Entradas:(ninguna) *|
|* Salidas: (ninguna) *|
|* *|
\**************************************************************************/
/**************************************************************************\
|* *|
|* ImprimeCompraserencias *|
|* *|
|* Descripci¢n: *|
|* Imprime todas las referencias seg£n se le indique *|
|* *|
|* Entradas: *|
|* Como imprimir las referencias *|
|* *|
|* Salidas: (ninguna) *|
|* *|
\**************************************************************************/
void ImprimeCompraserencias( char como )
{
long i, old_reg;
FILE *file_out;
old_reg = BCompras.RegActual();
if ( !Config.Printer )
{
if ( ( file_out = fopen( Config.PrintTo, "w" ) ) == NULL )
return;
} else
file_out = stdprn;
ImprimeCabeceraCompras( como, file_out );
for ( i=0; i<BCompras.Registros(); i++ )
{
BCompras.LeeReg( (void *)&SCompras, i );
switch( como )
{
/*
// Listado R pido
case 1:
formatea_u_long( (unsigned long)SCompras.CantUnitaria, buffer );
fprintf( file_out, "%9lu %-30s %-6s ", SCompras.CodigoR, SCompras.Descripcion, buffer );
formatea_u_long( (unsigned long)SCompras.PrecioCosto, buffer );
fprintf( file_out, "%-7s ", buffer );
formatea_u_long( (unsigned long)SCompras.PrecioVenta[0], buffer );
fprintf( file_out, "%-7s %-10s\n\r", buffer, SCompras.Combinado ? "Combinado" : "" );
break;
// Listado Completo
case 2:
formatea_u_long( (unsigned long)SCompras.CantUnitaria, buffer );
fprintf( file_out, "%9lu %-30s %-6s ", SCompras.CodigoR, SCompras.Descripcion, buffer );
formatea_u_long( (unsigned long)SCompras.PrecioCosto, buffer );
fprintf( file_out, "%-7s ", buffer );
formatea_u_long( (unsigned long)SCompras.PrecioVenta[0], buffer );
fprintf( file_out, "%-7s %-10s\n\r", buffer, SCompras.Combinado ? "Combinado" : "" );
if ( SCompras.Combinado )
{
for ( j=0; j<10; j++ )
if ( SCompras.CodigosAsociados[j] != 0 )
fprintf( file_out, " %-7s %9lu", j < 4 ? SCompras.PrecioVenta[j+1] : 0, SCompras.CodigosAsociados[j] );
}
break;
// C¢digos de barra
case 3:
break;
*/
}
}
if ( !Config.Printer )
fclose( file_out );
BCompras.LeeReg( (void *)&SCompras, old_reg );
}
void ImprimeCabeceraCompras( char como, FILE *file_out )
{
switch( como )
{
// Listado R pido
case 1:
fprintf( file_out, "C¢digo Proveedor Cant.Unt P.Costo P.Venta Combinado\n\r" );
break;
// Listado Completo
case 2:
fprintf( file_out, "C¢digo Proveedor Cant.Unt P.Costo P.Venta Cod. Combinado\n\r" );
break;
// C¢digos de barra
case 3:
break;
}
}
void Error( int code )
{
printf( "\nSe produjo un codigo de error %d, subcodigo no disponible \n\r", code );
switch( code )
{
case 0:
printf( "\n Error incocumentado " );
break;
case 1:
printf( "\n Error abriendo " );
break;
case 2:
printf( "\n Error insertando " );
break;
case 3:
printf( "\n Error leyendo " );
break;
case 4:
printf( "\n Error escribiendo " );
break;
case 5:
printf( "\n Error borrando " );
break;
};
exit(code);
}
void DibujaPantallaGastosInt(void)
{
textcolor( WHITE );
textbackground( BLACK );
// 145678 123456789-123456789-123 12345 345.789 123.123.123 123456789-123456789-
cprintf( "\r ");
cprintf( " ");
cprintf( "ÚÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄ¿");
cprintf( "³ Fecha ³ Articulo ³ Und ³ Precio ³ Total ³ N§ Pdor ³");
cprintf( "ÃÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄ´");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "³ ³ ³ ³ ³ ³ ³");
cprintf( "ÀÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÙ");
}
void RastreaFicheroGastosi(void)
{
char buffer[80], ok = 0, dev;
char buffer1[80];
int Proveedor; long i;
long old_pos;
long Meses[12] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
char MesesF[12][80];
// Pido el n§ de proveedor que deseo buscar
Optar( ENCUADRE, "Rastreo de gastos", "Introduzca el n§ de", "proveedor, a rastrear.", "", "N§ Proveedor: ", NULL );
buffer[0] = '\0';
if ( !( InputCadenaG( buffer, 1, 4, Config.TxtBgN, Config.TxtFgN, 46, 12, 4, 0) >> 8 ) )
{
Proveedor = atoi( buffer );
ok = 1;
}
Optar( ENCUADRE, NULL );
if ( ok == 1 )
{
Optar( ENCUADRE, "Realizando rastreo...", "Esto puede tardar unos", "minutos, por favor, epere...", NULL );
old_pos = BCompras.RegActual();
dev = OK;
for ( i=0; i < BCompras.Registros(); i++ )
{
BCompras.LeeReg( (void *)&SCompras, i );
if ( SCompras.Proveedor == Proveedor )
{
if ( SCompras.Fecha.da_mon > 0 && SCompras.Fecha.da_mon <= 12 )
Meses[ SCompras.Fecha.da_mon - 1 ] += SCompras.Cantidades * SCompras.Precio;
}
}
for( i = 0; i < 6; i++ )
{
formatea_u_long( Meses[i], buffer );
formatea_u_long( Meses[i+6], buffer1);
switch( i )
{
case 0: sprintf( MesesF[i], "Enero: %10s Julio: %10s", buffer, buffer1 ); break;
case 1: sprintf( MesesF[i], "Febrero:%10s Agosto: %10s", buffer, buffer1 ); break;
case 2: sprintf( MesesF[i], "Marzo: %10s Septiembre: %10s", buffer, buffer1 ); break;
case 3: sprintf( MesesF[i], "Abril: %10s Octubre: %10s", buffer, buffer1 ); break;
case 4: sprintf( MesesF[i], "Mayo: %10s Noviembre: %10s", buffer, buffer1 ); break;
case 5: sprintf( MesesF[i], "Junio: %10s Diciembre: %10s", buffer, buffer1 ); break;
}
}
Optar( ENCUADRE, NULL );
Optar( 0, "Rastreo concluido", MesesF[0], MesesF[1], MesesF[2], MesesF[3], MesesF[4], MesesF[5], NULL );
while( kbhit() ) getch();
BCompras.LeeReg( (void *)&SCompras, old_pos );
}
}
void OrdenarGastosi(void)
{
/*
BDatos BCompras; // Base de datos de Compraserencias
INFO_PRECIOS SCompras; // Estructura de referencias
int OrdenGestionInterna;
*/
struct Boton_Texto BT[4];
int devolver;
BT[0].x = 32; BT[0].y = 9; strcpy( BT[0].Texto, " &Fecha de compra "); BT[0].ID_T1 = 0; BT[0].ID_T2 = 0;
BT[1].x = 32; BT[1].y = 11; strcpy( BT[1].Texto, " &Nombre de Articulo"); BT[1].ID_T1 = 0; BT[1].ID_T2 = 0;
BT[2].x = 32; BT[2].y = 13; strcpy( BT[2].Texto, " &Proveedor del Art "); BT[2].ID_T1 = 0; BT[2].ID_T2 = 0;
BT[3].x = 32; BT[3].y = 15; strcpy( BT[3].Texto, " &Cancelar operacion"); BT[3].ID_T1 = 0; BT[3].ID_T2 = 0;
Optar( ENCUADRE, "Elija orden a seguir", NULL );
while( ( devolver = Funcion_Botones(STD_BY, 4, BT) ) < 1 || devolver > 4 ) while ( kbhit() ) getch();
if ( devolver != 4 )
{
OrdenGestionInterna = devolver;
BCompras.SortReg( ComparaRegistros );
}
Optar( ENCUADRE, NULL );
}
int ComparaRegistros( const void *A, const void *B )
{
// Tipos de ordenaciones posibles
switch( OrdenGestionInterna )
{
// Por Proveedor
case 3:
if ( ( ((INFO_PRECIOS *)A) -> Proveedor ) < ( ((INFO_PRECIOS *)B) -> Proveedor ) ) return -1;
if ( ( ((INFO_PRECIOS *)A) -> Proveedor ) == ( ((INFO_PRECIOS *)B) -> Proveedor ) ) return 0;
if ( ( ((INFO_PRECIOS *)A) -> Proveedor ) > ( ((INFO_PRECIOS *)B) -> Proveedor ) ) return 1;
break;
// Por Articulo
case 2:
return strcmpi( ( ((INFO_PRECIOS *)A) -> Articulo ), ( ((INFO_PRECIOS *)B) -> Articulo ) );
case 1:
if ( ( ((INFO_PRECIOS *)A) -> Fecha.da_year ) < ( ((INFO_PRECIOS *)B) -> Fecha.da_year ) ) return -1;
if ( ( ((INFO_PRECIOS *)A) -> Fecha.da_year ) > ( ((INFO_PRECIOS *)B) -> Fecha.da_year ) ) return 1;
if ( ( ((INFO_PRECIOS *)A) -> Fecha.da_mon ) < ( ((INFO_PRECIOS *)B) -> Fecha.da_mon ) ) return -1;
if ( ( ((INFO_PRECIOS *)A) -> Fecha.da_mon ) > ( ((INFO_PRECIOS *)B) -> Fecha.da_mon ) ) return 1;
if ( ( ((INFO_PRECIOS *)A) -> Fecha.da_day ) < ( ((INFO_PRECIOS *)B) -> Fecha.da_day ) ) return -1;
if ( ( ((INFO_PRECIOS *)A) -> Fecha.da_day ) > ( ((INFO_PRECIOS *)B) -> Fecha.da_day ) ) return 1;
return 0;
}
return -1;
}

1088
TXT_LPR.CPP Normal file

File diff suppressed because it is too large Load Diff

1609
TXT_SOC.CPP Normal file

File diff suppressed because it is too large Load Diff

277
TXT_UTL.CPP Normal file
View File

@ -0,0 +1,277 @@
#include <dos.h>
#include <conio.h>
#include <ctype.h>
#include <stdio.h>
#include <alloc.h>
#include <string.h>
#include <stdarg.h>
#define BLANCO EGA_WHITE
#define ENCUADRE 3
#define SEC_OPTAR 5
#include "zorr.h"
void BEEP(void);
/**************************************************************************\
|* *|
|* InputCadenaG *|
|* *|
|* Descripci¢n: *|
|* Edita una cadena en formato gr fico *|
|* *|
|* Entradas: *|
|* Puntero a los datos editados *|
|* 0 alfanumerico 1 numerico *|
|* longitud de la cadena (TEXTO/NUMERO) *|
|* color del texto *|
|* color de fondo *|
|* Limites de acotacion *|
|* *|
|* Salidas: (ninguna) *|
|* *|
|* *|
\**************************************************************************/
int InputCadenaG(char *s, int numalp, int lmax, int cc, int cf, int X0, int Y0, int X1, int Y1)
{
// A todas las y les sumaba antes +RoW*12 parametro que indica la linea
int ls; // longitud cadena
char Status = 0;
char *s1; // puntero a cadena inicial
int c, ok, i;
s1 = s; // inicio cadena
textbackground( cf );
gotoxy( X0, Y0 );
for ( i = 0; i < X1; i++ )
putch( 32 );
textcolor( cc );
gotoxy( X0, Y0 );
cprintf( "%s", s1 );
_setcursortype( _SOLIDCURSOR );
ls = strlen ( s ); // Longitud de actual
s += ls; // se coloca en el final
do{
c = getch(); // obtiene tecla
if ( c == 27 ) Status = 1;
ok = ( c == 27 || c == 13 || c == 0); // 13 = INTRO || Especiales
if ( c == 8 && ls > 0 && !ok ) { // 8 = Back Space
ls--;
s--;
*s = '\0';
gotoxy( X0, Y0 );
for ( i = 0; i < X1; i++ )
putch( 32 );
textcolor( cc );
gotoxy( X0, Y0 );
cprintf( "%s", s1 );
} else {
if ( !numalp && c >= 32 && c <= 254 && ls < lmax) {
*s++ = c;
ls++;
*s = '\0';
gotoxy( X0, Y0 );
for ( i = 0; i < X1; i++ )
putch( 32 );
textcolor( cc );
gotoxy( X0, Y0 );
cprintf( "%s", s1 );
} else {
if ( numalp && isdigit(c) && ls < lmax) {
*s++ = c;
ls++;
*s = '\0'; // Cero final
gotoxy( X0, Y0 );
for ( i = 0; i < X1; i++ )
putch( 32 );
textcolor( cc );
gotoxy( X0, Y0 );
cprintf( "%s", s1 );
}
/*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ*/
else if( c == 27 ) {*s='\0'; ok = 1; }
/*ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ*/
else BEEP();
}
}
}while(!ok);
_setcursortype( _NOCURSOR );
ok = 1;
*s = ' ';
while( ok && ls >= 0 ) {
if(*s==' ') { *s = '\0'; s--; ls--;
} else { s++; ok = 0; }
}
*s = '\0';
while(kbhit()) getch(); // Vacia Buffer impidiendo falsas
// pulsaciones...
return ( (Status<<8) + (ls&0x00FF) );
}
void BEEP(void)
{
sound(440);
delay(50);
nosound();
}
void formatea_u_long( unsigned long Numero, char *Inter_Chg)
{
char Buffer1[80];
int c;
sprintf(Buffer1, "%lu", Numero);
Inter_Chg[0]='\0';
strrev(Buffer1);
c = strlen( Buffer1 );
while( c >= 3 )
{
c -= 3;
strncat( Inter_Chg, Buffer1, 3);
strrev(Buffer1);
Buffer1[c] = '\0';
strrev(Buffer1);
if(strlen(Buffer1)!=0)
strcat( Inter_Chg, "." );
}
strcat( Inter_Chg, Buffer1);
strrev(Inter_Chg);
/*// return Buffer2;*/
}
int Optar( int optar, ... )
{
struct Boton_Texto BT[6];
int devolver = 0;
BT[0].x = 22; BT[0].y = 15; strcpy( BT[0].Texto, " &Aceptar "); BT[0].ID_T1 = 00; BT[0].ID_T2 = 30;
BT[1].x = 51; BT[1].y = 15; strcpy( BT[1].Texto, " &Cancelar"); BT[1].ID_T1 = 00; BT[1].ID_T2 = 46;
static char fondo[4096];
static char Memoria = 0;
int DEV = 0, ok = 0, linea = 0;
int Center; char *buff;
va_list ap;
va_start( ap, &optar );
if ( Memoria == 1 )
{
puttext( 21, 5, 63, 17, (void *)fondo ); Memoria = 0;
if ( optar == ENCUADRE ) return DEV;
}
Memoria = 1;
gettext( 21, 5, 63, 17, (void *)fondo );
textbackground( BLACK );
textcolor( CYAN );
gotoxy( 21, 5 ); cprintf("ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿");
gotoxy( 21, 6 ); cprintf("³ ³");
gotoxy( 21, 7 ); cprintf("ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´");
gotoxy( 21, 8 ); cprintf("³ ³");
gotoxy( 21, 9 ); cprintf("³ ³");
gotoxy( 21, 10 ); cprintf("³ ³");
gotoxy( 21, 11 ); cprintf("³ ³");
gotoxy( 21, 12 ); cprintf("³ ³");
gotoxy( 21, 13 ); cprintf("³ ³");
gotoxy( 21, 14 ); cprintf("³ ³");
gotoxy( 21, 15 ); cprintf("³ ³");
gotoxy( 21, 16 ); cprintf("³ ³");
gotoxy( 21, 17 ); cprintf("ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ");
textcolor( RED );
linea = 0;
while ( (buff = va_arg(ap, char *)) != NULL )
{
Center = (42 - strlen( buff ) ) / 2;
gotoxy( 21+Center+1, ( (linea == 0 ) ? 6 : 8 + linea ) );
cprintf( "%s", buff );
linea++;
}
va_end(ap);
if ( optar != ENCUADRE )
{
ok = 0; while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER
if ( optar == 1 )
do {
switch( Funcion_Botones(STD_BY, 2, BT) )
{
case 0: // No se pulso ningun BOTON
case -2:
case -1:
while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER
if ( optar == 0 ) ok = 1;
break;
case 1:
DEV = 1; ok = 1;
break;
case 2:
DEV = 0; ok = 1;
break;
}
}while( !ok );
else { espera_pulsar(); espera_soltar(); }
puttext( 21, 5, 63, 17, (void *)fondo );
Memoria = 0;
}
return DEV;
}

BIN
ZORR.DSK Normal file

Binary file not shown.

BIN
ZORR.EXE Normal file

Binary file not shown.

124
ZORR.H Normal file
View File

@ -0,0 +1,124 @@
#include <dos.h>
#define DIBUJA 1
#define DEPRIME 2
#define Dibuja_Todos 3
#define COMPRUEBA 4
#define STD_BY 5
#define NORMAL 0
#define INTENSO 1
#define ATRAS -1
#define NUEVA_BUSQUEDA 0
#define ADELANTE 1
#define SEC_OPTAR 5
#define ENCUADRE 3
// Niveles de acceso al programa
#define TOTAL 0
#define USUARIO 1
#define NINGUNO 2
typedef struct
{
char FillBgS, FillBgC;
char NumFg, NumBg, NumLn;
char TxtBgN, TxtBgI, TxtFgN, TxtFgI;
char Printer, PrintTo[80];
} CONFIG;
struct hora
{
char min; // Minutos y hora
char hora;
};
struct ComprasSocios
{
unsigned char dia;
unsigned char mes;
long Cantidad;
};
typedef struct
{
long NSocio;
char Nombre[15+1];
char Apellido[20+1];
char Direccion[25+1];
int Num;
char Piso[4+1];
int NCompras;
struct ComprasSocios CSocios[240];
} INFO_SOCIOS;
typedef struct
{
struct date Fecha;
char Articulo[25+1];
int Proveedor;
long Precio;
int Cantidades;
} INFO_PRECIOS;
typedef struct
{
char Articulo[45+1];
long Precio;
char Ubicacion[14+1];
long PrecioArt;
} INFO_ARTICULOS;
int Optar( int optar, ... );
void ponicono(int x,int y,char matriz[18][18], char pos);
void formatea_u_long( unsigned long Numero, char *Inter_Chg);
int InputCadenaG(char *s, int numalp, int lmax, int cc, int cf, int X0, int Y0, int X1, int Y1);
void Error( int code );
// M¢dulo de referencias
void InfoProductos(void);
// M¢dulo de Compras
void ComprasDiarias( int NivelAcceso );
// Informacion de los proveedores
void InfoProveedores(void);
//ÛÛ
void espera_soltar(void);
void espera_pulsar(void);
void activa_raton(void);
void desactiva_raton(void);
void inicializa_raton_texto(void);
struct Boton_Texto{
char x; char y;
char Texto[80];
int ID_T1;
int ID_T2;
};
int Funcion_Botones(int Funcion, int nBotones, struct Boton_Texto *Boton_Texto);
extern int boton_izq, boton_der;
extern int x_raton, y_raton, RATON;
//ÛÛ
extern int AnoActual;

443
ZORR.IMG Normal file
View File

@ -0,0 +1,443 @@
**
** Codigo fuente para MAKE_BOTON
**
*****************************************************************************
*
* ATENCION !!!
* ALTERAR ESTE FICHERO, CAUSARA EL MALFUNCIONAMIENTO DEL
* PROGRAMA DE APOYO... ( ERRORES NO DOCUMENTADOS )
*
*****************************************************************************
#5
************************************************ Botones D: 1
**** **** Botones S: 10
** M¢dulo de Ventas **
**** ****
************************************************
!1, 6
$ 605, 5, 635, 120, 7, 63, 56, 2, 2, 000, 000 * Impr. £ltimo ticket
$ 490, 5, 590, 30, 7, 63, 56, 2, 2, 000, 000 * Impr. Tickets
$ 490, 50, 590, 75, 7, 63, 56, 2, 2, 000, 000 * Cobro completo
$ 490, 95, 590, 120, 7, 63, 56, 2, 2, 000, 000 * Servicio en mesa
$ 420, 5, 450, 120, 7, 63, 56, 2, 2, 000, 000 * Gastos / Compras
$ 380, 5, 410, 120, 7, 63, 56, 2, 2, 000, 000 * Menu Principal
­10
************************************************ Botones D: 2
**** **** Botones S: 20
** M¢dulo de Referencias **
**** ****
************************************************
!2, 9
$ 400, 40, 515, 65, 7, 63, 56, 2, 2, 000, 23
$ 520, 40, 635, 65, 7, 63, 56, 2, 2, 000, 50
$ 400, 70, 515, 95, 7, 63, 56, 2, 2, 000, 83
$ 520, 70, 635, 95, 7, 63, 56, 2, 2, 000, 82
$ 400, 100, 440, 125, 7, 63, 56, 2, 2, 000, 73
$ 445, 100, 475, 125, 7, 63, 56, 2, 2, 000, 71
$ 480, 100, 555, 125, 7, 63, 56, 2, 2, 000, 48
$ 560, 100, 590, 125, 7, 63, 56, 2, 2, 000, 79
$ 595, 100, 635, 125, 7, 63, 56, 2, 2, 000, 81
­20
& 400, 5, 635, 30, 7, 63, 56, 2, 2
| 400, 7, 2, 5, 0, 0, Listado de Socios,
| 401, 8, 2, 5, 0, 63, Listado de Socios,
& 400, 40, 515, 65, 7, 63, 56, 2, 2
| 400, 42, 2, 5, 0, 0, Imprimir Soc.,
| 401, 43, 2, 5, 0, 63, Imprimir Soc.,
| 400, 43, 2, 5, 0, 0, _,
| 401, 44, 2, 5, 0, 63, _,
& 520, 40, 635, 65, 7, 63, 56, 2, 2
| 518, 42, 2, 5, 0, 0, Men£ Principal,
| 519, 43, 2, 5, 0, 63, Men£ Principal,
| 518, 43, 2, 5, 0, 0, _,
| 519, 44, 2, 5, 0, 63, _,
& 400, 70, 515, 95, 7, 63, 56, 2, 2
| 400, 72, 2, 5, 0, 0, Eliminar Soc.,
| 401, 73, 2, 5, 0, 63, Eliminar Soc.,
& 520, 70, 635, 95, 7, 63, 56, 2, 2
| 518, 72, 2, 5, 0, 0, Insertar Soc.,
| 519, 73, 2, 5, 0, 63, Insertar Soc.,
& 400, 100, 440, 125, 7, 63, 56, 2, 2
| 400, 102, 2, 5, 0, 0, <<,
| 401, 103, 2, 5, 0, 63, <<,
& 445, 100, 475, 125, 7, 63, 56, 2, 2
| 445, 102, 2, 5, 0, 0, <-,
| 446, 103, 2, 5, 0, 63, <-,
& 480, 100, 555, 125, 7, 63, 56, 2, 2
| 480, 102, 2, 5, 0, 0, Buscar,
| 481, 103, 2, 5, 0, 63, Buscar,
& 560, 100, 590, 125, 7, 63, 56, 2, 2
| 560, 102, 2, 5, 0, 0, ->,
| 561, 103, 2, 5, 0, 63, ->,
& 595, 100, 635, 125, 7, 63, 56, 2, 2
| 595, 102, 2, 5, 0, 0, >>,
| 596, 103, 2, 5, 0, 63, >>,
& 5, 130, 635, 155, 7, 63, 56, 2, 2
| 10, 132, 2, 5, 0, 63, N§ Socio Nombre Direcci¢n,
| 11, 133, 2, 5, 0, 0, N§ Socio Nombre Direcci¢n,
& 5, 160, 80, 450, 63, 7, 56, 2, 2
& 85, 160, 345, 450, 63, 7, 56, 2, 2
& 350, 160, 635, 450, 63, 7, 56, 2, 2
* Linea de fondo para ayudas
& 5, 455, 500, 475, 0, 63, 56, 0, 2
& 505, 455, 635, 475, 63, 0, 0, 0, 2
************************************************ Botones D:
**** **** Botones S: 21
** M¢dulo buscar asociado a Referencias **
**** ****
************************************************
­21
& 260, 200, 360, 220, 63, 0, 56, 0, 2
& 365, 200, 465, 220, 63, 0, 56, 0, 2
& 260, 225, 465, 245, 63, 0, 56, 0, 2
& 235, 250, 315, 275, 63, 0, 56, 0, 2
& 385, 250, 465, 275, 63, 0, 56, 0, 2
& 330, 275, 365, 300, 63, 0, 56, 0, 2
| 175, 200, 2, 6, 0, 0, Cod.Art:,
| 176, 201, 2, 6, 0, 63, Cod.Art:,
| 175, 225, 2, 6, 0, 0, Nombre:,
| 176, 226, 2, 6, 0, 63, Nombre:,
| 175, 250, 2, 6, 0, 0, P.C.: P.V.P.:,
| 176, 251, 2, 6, 0, 63, P.C.: P.V.P.:,
| 175, 275, 2, 6, 0, 0, COMBINADOS -> [ ],
| 176, 276, 2, 6, 0, 63, COMBINADOS -> [ ],
************************************************ Botones D: 3
**** **** Botones S: 22
** M¢dulo imprimir asociado a Referencias **
**** ****
************************************************
!3, 4
$ 180, 200, 220, 305, 1, 56, 63, 2, 2, 000, 46
$ 230, 200, 460, 230, 7, 56, 63, 2, 2, 000, 19
$ 230, 235, 460, 270, 7, 56, 63, 2, 2, 000, 24
$ 230, 275, 460, 305, 7, 56, 63, 2, 2, 000, 48
­22
& 170, 165, 470, 315, 7, 63, 56, 0, 2
& 172, 167, 468, 190, 1, 56, 63, 0, 2
| 175, 167, 2, 6, 0, 0, Impresion de Referencias,
| 175, 168, 2, 6, 0, 63, Impresion de Referencias,
& 180, 200, 220, 305, 1, 56, 63, 2, 2
| 190, 200, 2, 6, 1, 0, Cancelar ,
| 191, 201, 2, 6, 1, 63, Cancelar ,
| 191, 201, 2, 6, 1, 0, _ ,
| 192, 202, 2, 6, 1, 63, _ ,
& 230, 200, 460, 230, 7, 56, 63, 2, 2
| 230, 202, 2, 6, 0, 0, Listado r pido,
| 231, 203, 2, 6, 0, 63, Listado r pido,
| 231, 203, 2, 6, 0, 0, _,
| 232, 204, 2, 6, 0, 63, _,
& 230, 235, 460, 270, 7, 56, 63, 2, 2
| 230, 237, 2, 6, 0, 0, Listado completo,
| 231, 238, 2, 6, 0, 63, Listado completo,
| 231, 238, 2, 6, 0, 0, _,
| 232, 239, 2, 6, 0, 63, _,
& 230, 275, 460, 305, 7, 56, 63, 2, 2
| 230, 277, 2, 6, 0, 0, C¢digos de barra,
| 231, 278, 2, 6, 0, 63, C¢digos de barra,
| 231, 278, 2, 6, 0, 0, _,
| 232, 279, 2, 6, 0, 63, _,
************************************************ Botones D: 2
**** **** Botones S: 30
** M¢dulo para la Gestion de los Proveedores **
**** ****
************************************************
­30
& 400, 5, 635, 30, 7, 63, 56, 2, 2
| 400, 7, 2, 5, 0, 0, Gestion de Proveedores,
| 401, 8, 2, 5, 0, 63, Gestion de Proveedores,
& 400, 40, 515, 65, 7, 63, 56, 2, 2
| 400, 42, 2, 5, 0, 0, Imprimir Prov.,
| 401, 43, 2, 5, 0, 63, Imprimir Prov.,
| 400, 43, 2, 5, 0, 0, _,
| 401, 44, 2, 5, 0, 63, _,
& 520, 40, 635, 65, 7, 63, 56, 2, 2
| 518, 42, 2, 5, 0, 0, Men£ Principal,
| 519, 43, 2, 5, 0, 63, Men£ Principal,
| 518, 43, 2, 5, 0, 0, _,
| 519, 44, 2, 5, 0, 63, _,
& 400, 70, 515, 95, 7, 63, 56, 2, 2
| 400, 72, 2, 5, 0, 0, Eliminar Prov.,
| 401, 73, 2, 5, 0, 63, Eliminar Prov.,
& 520, 70, 635, 95, 7, 63, 56, 2, 2
| 518, 72, 2, 5, 0, 0, Insertar Prov.,
| 519, 73, 2, 5, 0, 63, Insertar Prov.,
& 400, 100, 440, 125, 7, 63, 56, 2, 2
| 400, 102, 2, 5, 0, 0, <<,
| 401, 103, 2, 5, 0, 63, <<,
& 445, 100, 475, 125, 7, 63, 56, 2, 2
| 445, 102, 2, 5, 0, 0, <-,
| 446, 103, 2, 5, 0, 63, <-,
& 480, 100, 555, 125, 7, 63, 56, 2, 2
| 480, 102, 2, 5, 0, 0, Buscar,
| 481, 103, 2, 5, 0, 63, Buscar,
& 560, 100, 590, 125, 7, 63, 56, 2, 2
| 560, 102, 2, 5, 0, 0, ->,
| 561, 103, 2, 5, 0, 63, ->,
& 595, 100, 635, 125, 7, 63, 56, 2, 2
| 595, 102, 2, 5, 0, 0, >>,
| 596, 103, 2, 5, 0, 63, >>,
| 5, 40, 2, 5, 0, 0, Direccion Num,
| 6, 41, 2, 5, 0, 63, Direccion Num,
& 88, 35, 308, 60, 63, 7, 56, 2, 2
& 355, 35, 390, 60, 63, 7, 56, 2, 2
| 5, 65, 2, 5, 0, 0, Poblacion Provincia,
| 6, 66, 2, 5, 0, 63, Poblaci¢n Provincia,
& 88, 65, 210, 90, 63, 7, 56, 2, 2
& 290, 66, 390, 91, 63, 7, 56, 2, 2
| 5, 95, 2, 5, 0, 0, Cd.Postal Estr.,
| 6, 96, 2, 5, 0, 63, Cd.Postal Estr.,
& 88, 95, 188, 120, 63, 7, 56, 2, 2
& 245, 95, 270, 120, 7, 63, 56, 2, 2
& 275, 95, 300, 120, 7, 63, 56, 2, 2
& 305, 95, 330, 120, 7, 63, 56, 2, 2
& 335, 95, 360, 120, 7, 63, 56, 2, 2
& 365, 95, 390, 120, 7, 63, 56, 2, 2
& 5, 130, 635, 155, 7, 63, 56, 2, 2
| 5, 135, 2, 5, 0, 0, C¢digo Proveedor Telfono 1 N§ de Fax,
| 6, 136, 2, 5, 0, 63, C¢digo Proveedor Telfono 1 N§ de Fax,
& 5, 160, 100, 450, 63, 7, 56, 2, 2
& 105, 160, 360, 450, 63, 7, 56, 2, 2
& 365, 160, 497, 450, 63, 7, 56, 2, 2
& 503, 160, 635, 450, 63, 7, 56, 2, 2
* Linea de fondo para ayudas
& 5, 455, 500, 475, 0, 63, 56, 0, 2
& 505, 455, 635, 475, 63, 0, 0, 0, 2
************************************************ Botones D:
**** **** Botones S: 31
** M¢dulo buscar asociado a Proveedores **
**** ****
************************************************
­31
& 265, 200, 365, 220, 63, 0, 56, 0, 2
& 265, 225, 465, 245, 63, 0, 56, 0, 2
& 265, 250, 465, 275, 63, 0, 56, 0, 2
& 265, 280, 465, 305, 63, 0, 56, 0, 2
| 175, 200, 2, 6, 0, 0, Cod.Art:,
| 176, 201, 2, 6, 0, 63, Cod.Art:,
| 175, 225, 2, 6, 0, 0, Proveed.,
| 176, 226, 2, 6, 0, 63, Proveed.,
| 175, 250, 2, 6, 0, 0, Direccion,
| 176, 251, 2, 6, 0, 63, Direccion,
| 175, 275, 2, 6, 0, 0, Poblacion,
| 176, 276, 2, 6, 0, 63, Poblacion,
************************************************ Botones D: 2
**** **** Botones S: 40
** M¢dulo de Compras Diarias **
**** ****
************************************************
­40
& 400, 5, 635, 30, 7, 63, 56, 2, 2
| 400, 7, 2, 5, 0, 0, Gastos Diarios:,
| 401, 8, 2, 5, 0, 63, Gastos Diarios:,
& 400, 40, 515, 65, 7, 63, 56, 2, 2
| 400, 42, 2, 5, 0, 0, Imprimir Comp.,
| 401, 43, 2, 5, 0, 63, Imprimir Comp.,
| 400, 43, 2, 5, 0, 0, _,
| 401, 44, 2, 5, 0, 63, _,
& 520, 40, 635, 65, 7, 63, 56, 2, 2
| 518, 42, 2, 5, 0, 0, Men£ Principal,
| 519, 43, 2, 5, 0, 63, Men£ Principal,
| 518, 43, 2, 5, 0, 0, _,
| 519, 44, 2, 5, 0, 63, _,
& 400, 70, 515, 95, 7, 63, 56, 2, 2
| 400, 72, 2, 5, 0, 0, Eliminar Gasto,
| 401, 73, 2, 5, 0, 63, Eliminar Gasto,
& 520, 70, 635, 95, 7, 63, 56, 2, 2
| 518, 72, 2, 5, 0, 0, Insertar Gasto,
| 519, 73, 2, 5, 0, 63, Insertar Gasto,
& 400, 100, 440, 125, 7, 63, 56, 2, 2
| 400, 102, 2, 5, 0, 0, <<,
| 401, 103, 2, 5, 0, 63, <<,
& 445, 100, 475, 125, 7, 63, 56, 2, 2
| 445, 102, 2, 5, 0, 0, <-,
| 446, 103, 2, 5, 0, 63, <-,
& 480, 100, 555, 125, 7, 63, 56, 2, 2
| 480, 102, 2, 5, 0, 0, Buscar,
| 481, 103, 2, 5, 0, 63, Buscar,
& 560, 100, 590, 125, 7, 63, 56, 2, 2
| 560, 102, 2, 5, 0, 0, ->,
| 561, 103, 2, 5, 0, 63, ->,
& 595, 100, 635, 125, 7, 63, 56, 2, 2
| 595, 102, 2, 5, 0, 0, >>,
| 596, 103, 2, 5, 0, 63, >>,
& 5, 130, 635, 155, 7, 63, 56, 2, 2
| 5, 135, 2, 5, 0, 0, C¢digo Descripcion Unds. Proveedor P. Costo,
| 6, 136, 2, 5, 0, 63, C¢digo Descripcion Unds. Proveedor P. Costo,
& 5, 160, 100, 450, 63, 7, 56, 2, 2
& 105, 160, 360, 450, 63, 7, 56, 2, 2
& 365, 160, 415, 450, 63, 7, 56, 2, 2
& 420, 160, 545, 450, 63, 7, 56, 2, 2
& 550, 160, 635, 450, 63, 7, 56, 2, 2
* Linea de fondo para ayudas
& 5, 455, 500, 475, 0, 63, 56, 0, 2
& 505, 455, 635, 475, 63, 0, 0, 0, 2
************************************************ Botones D: 4
**** **** Botones S: 45
** Calendario para Compras Diarias **
**** ****
************************************************
!4, 44
* Domingos
$ 350, 5, 380, 25, 4, 63, 56, 2, 2, 000, 000
$ 350, 25, 380, 45, 4, 63, 56, 2, 2, 000, 000
$ 350, 45, 380, 65, 4, 63, 56, 2, 2, 000, 000
$ 350, 65, 380, 85, 4, 63, 56, 2, 2, 000, 000
$ 350, 85, 380, 105, 4, 63, 56, 2, 2, 000, 000
$ 350, 105, 380, 125, 4, 63, 56, 2, 2, 000, 000
* Sabado
$ 320, 5, 350, 25, 4, 63, 56, 2, 2, 000, 000
$ 320, 25, 350, 45, 4, 63, 56, 2, 2, 000, 000
$ 320, 45, 350, 65, 4, 63, 56, 2, 2, 000, 000
$ 320, 65, 350, 85, 4, 63, 56, 2, 2, 000, 000
$ 320, 85, 350, 105, 4, 63, 56, 2, 2, 000, 000
$ 320, 105, 350, 125, 4, 63, 56, 2, 2, 000, 000
* Viernes
$ 290, 5, 320, 25, 9, 63, 56, 2, 2, 000, 000
$ 290, 25, 320, 45, 9, 63, 56, 2, 2, 000, 000
$ 290, 45, 320, 65, 9, 63, 56, 2, 2, 000, 000
$ 290, 65, 320, 85, 9, 63, 56, 2, 2, 000, 000
$ 290, 85, 320, 105, 9, 63, 56, 2, 2, 000, 000
$ 290, 105, 320, 125, 9, 63, 56, 2, 2, 000, 000
* Jueves
$ 260, 5, 290, 25, 9, 63, 56, 2, 2, 000, 000
$ 260, 25, 290, 45, 9, 63, 56, 2, 2, 000, 000
$ 260, 45, 290, 65, 9, 63, 56, 2, 2, 000, 000
$ 260, 65, 290, 85, 9, 63, 56, 2, 2, 000, 000
$ 260, 85, 290, 105, 9, 63, 56, 2, 2, 000, 000
$ 260, 105, 290, 125, 9, 63, 56, 2, 2, 000, 000
* Miercoles
$ 230, 5, 260, 25, 9, 63, 56, 2, 2, 000, 000
$ 230, 25, 260, 45, 9, 63, 56, 2, 2, 000, 000
$ 230, 45, 260, 65, 9, 63, 56, 2, 2, 000, 000
$ 230, 65, 260, 85, 9, 63, 56, 2, 2, 000, 000
$ 230, 85, 260, 105, 9, 63, 56, 2, 2, 000, 000
$ 230, 105, 260, 125, 9, 63, 56, 2, 2, 000, 000
* Martes
$ 200, 5, 230, 25, 9, 63, 56, 2, 2, 000, 000
$ 200, 25, 230, 45, 9, 63, 56, 2, 2, 000, 000
$ 200, 45, 230, 65, 9, 63, 56, 2, 2, 000, 000
$ 200, 65, 230, 85, 9, 63, 56, 2, 2, 000, 000
$ 200, 85, 230, 105, 9, 63, 56, 2, 2, 000, 000
$ 200, 105, 230, 125, 9, 63, 56, 2, 2, 000, 000
* Lunes
$ 170, 5, 200, 25, 9, 63, 56, 2, 2, 000, 000
$ 170, 25, 200, 45, 9, 63, 56, 2, 2, 000, 000
$ 170, 45, 200, 65, 9, 63, 56, 2, 2, 000, 000
$ 170, 65, 200, 85, 9, 63, 56, 2, 2, 000, 000
$ 170, 85, 200, 105, 9, 63, 56, 2, 2, 000, 000
$ 170, 105, 200, 125, 9, 63, 56, 2, 2, 000, 000
* Mes Anterior
$ 145, 5, 165, 62, 7, 56, 63, 1, 2, 000, 000
* Mes Siguiente
$ 145, 68, 165, 125, 7, 56, 63, 1, 2, 000, 000
­45
* Nombre del Mes
& 120, 5, 140, 125, 7, 56, 63, 1, 2
************************************************ Botones D: 5
**** **** Botones S: 100
** Parte Utilizada por Optar **
**** ****
************************************************
!5, 2
$ 170, 320, 270, 350, 7, 63, 56, 2, 2, 000, 30
$ 370, 320, 470, 350, 7, 63, 56, 2, 2, 000, 46
­100
& 170, 165, 470, 315, 7, 63, 56, 0, 2
& 172, 167, 468, 190, 1, 56, 63, 0, 2
& 170, 320, 270, 350, 7, 63, 56, 2, 2
| 175, 325, 2, 6, 0, 63, Aceptar,
| 176, 326, 2, 6, 0, 0, Aceptar,
| 175, 327, 2, 6, 0, 63, _,
| 176, 328, 2, 6, 0, 0, _,
& 370, 320, 470, 350, 7, 63, 56, 2, 2
| 373, 325, 2, 6, 0, 63, Cancelar,
| 374, 326, 2, 6, 0, 0, Cancelar,
| 373, 327, 2, 6, 0, 63, _,
| 374, 328, 2, 6, 0, 0, _,

BIN
ZORR.PRJ Normal file

Binary file not shown.

BIN
ZORR.RAR Normal file

Binary file not shown.

400
ZOR_MM.CPP Normal file
View File

@ -0,0 +1,400 @@
#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 "zorr.h"
CONFIG Config = {
1, BLUE,
RED, WHITE, BLACK,
BLACK, RED, 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 ListaPrecios(void);
void GestionSocios(void);
extern void GastosInternos(void);
void PideAnoActual(void);
void DibujaPantallaGastosInt(void);
int boton_izq; int boton_der;
int x_raton, y_raton, RATON = 1;
//ÛÛ
int AnoActual;
int main(void)
{
int ok;
struct date d;
getdate( &d );
AnoActual = d.da_year - ( d.da_year / 100 ) * 100;
inicializa_raton_texto();
if( RATON ) desactiva_raton();
PideAnoActual();
ok = 0;
do {
switch( MenuPrincipal() )
{
case GESTION_DE_SOCIOS:
GestionSocios();
break;
case LISTA_DE_PRECIOS:
ListaPrecios();
break;
case GASTOS_INTERNOS:
GastosInternos();
break;
case SALIR:
ok = 1;
break;
}
} while ( !ok ) ;
return 0;
}
int MenuPrincipal(void)
{
struct Boton_Texto BT[4];
int devolver = 0;
BT[0].x = 29; BT[0].y = 9; strcpy( BT[0].Texto, " &Gestion de Socios "); BT[0].ID_T1 = 71; BT[0].ID_T2 = 0;
BT[1].x = 29; BT[1].y = 12; strcpy( BT[1].Texto, " &Listado de Precios "); BT[1].ID_T1 = 76; BT[1].ID_T2 = 0;
BT[2].x = 29; BT[2].y = 15; strcpy( BT[2].Texto, " Ga&stos internos "); BT[2].ID_T1 = 83; BT[2].ID_T2 = 0;
BT[3].x = 29; BT[3].y = 18; strcpy( BT[3].Texto, " S&ALIR al DOS "); BT[3].ID_T1 = 65; BT[3].ID_T2 = 0;
_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");
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");
cprintf(" ³ ³ \n\r");
cprintf(" ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ \n\r");
while( ( devolver = Funcion_Botones(STD_BY, 4, BT) ) < 1 || devolver > 4 ) while ( kbhit() ) getch();
_setcursortype(_NORMALCURSOR);
return devolver;
}
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;
}
void PideAnoActual(void)
{
char buffer[80];
BDatos SociosO, SociosD;
INFO_SOCIOS Socios;
struct ComprasSocios Vacia;
int r; long i;
Optar( ENCUADRE, "Transacci¢n en curso", "ú-ú", "A¤o: ", NULL );
sprintf( buffer, "%d", AnoActual );
while ( ( InputCadenaG( buffer, 1, 2, Config.TxtBgN, Config.TxtFgN, 40, 10, 2, 11) >> 8 ) );
AnoActual = atoi( buffer );
Optar( ENCUADRE, NULL );
// Comprobamos que existe una base de datos para esa fecha
sprintf( buffer, "socios.%03d", AnoActual );
if ( access(buffer, 0) != 0)
{
sprintf( buffer, "socios.%03d", AnoActual - 1 );
// Si el a¤o anterior existe, lo copiamos
if ( access(buffer, 0) == 0)
{
if ( Optar( 1, "Nuevo a¤o en curso", "El a¤o de la transaccion", "no existe, desea inicializarlo", "Esto puede llevar unos minutos", NULL ) )
{
if ( SociosO.AbrirReg( buffer, sizeof( INFO_SOCIOS ) ) == ERROR )
Error(0x01);
sprintf( buffer, "socios.%03d", AnoActual );
if ( SociosD.AbrirReg( buffer, sizeof( INFO_SOCIOS ) ) == ERROR )
Error(0x01);
i = 0;
for ( ; SociosO.LeeReg( (void *)&Socios, i ) == OK; i++ )
{
for ( r=0; r < 240; r++ )
Socios.CSocios[r].dia = Socios.CSocios[r].mes = Socios.CSocios[r].Cantidad = 0;
SociosD.InsReg( (void *)&Socios, SociosD.Registros(), ARRIBA );
}
}
} else {
Optar( 0, "ATENCION", "No existen datos para ese", "a¤o, se crear  una nueva base", "de datos, (a partir de cero)", NULL );
}
}
}