CATALOGO/CATALOGO.CPP
2021-09-03 17:43:05 +02:00

978 lines
25 KiB
C++
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Cat logo Gr fico
por Jos David Guilln
Copyright (c) 1994 JD Software Original. All rights reserved.
*/
#ifdef __TINY__
#error CATALOGO will not run in the tiny model.
#endif
#include <dos.h>
#include <bios.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <graphics.h>
#include "..\jd_lib\key.h"
#include "catalogo.h"
int huge DetectVGA256()
{
return 2;
}
// extern int leepcx(char diu[80]);
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* Begin main function */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
int main(int argc, char *argv[])
{
int ch = 32;
union REGS ent, sal;
char *NaC;
NaC = argv[0];
if(argc >=2 ) CheckArg(argc, argv);
{ auto unsigned disk;
_dos_getdrive(&disk);
if(disk==1 || disk==2) NoIniSb = 0;
}
struct boton menu[4];
menu[0].left = 20; menu[0].up = 20; menu[0].right = 170; menu[0].down = 100;
menu[1].left = 20; menu[1].up = 140; menu[1].right = 170; menu[1].down = 220;
menu[2].left = 20; menu[2].up = 260; menu[2].right = 170; menu[2].down = 340;
menu[3].left = 20; menu[3].up = 380; menu[3].right = 170; menu[3].down = 460;
// key_init(INIT);
lee_setup();
Initialize(); /* Set system into Graphics mode */
if ( !NoIniSb || Inicializa_SB() == 0 ) sb2 = 0; /* Fun with sound...? Yea.. SB0 */
/*if (leepcx("catalogo.img")==0)*/
DibujaPantalla(); /* Dise¤a la pantalla de visualizaci¢n */
inicializa_raton_grafico(0, 0, 624, 464, 320, 240);
if (sb!=0) Sound_SN("catalog0");
if (raton!=0) activa_raton();
do{
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* Comprueba las teclas pulsadas */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
if (kbhit()) {
if(raton!=0) desactiva_raton();
ch = getch();
switch ( ch ) {
case 109:
case 77:
if (sb!=0) Sound_SN("catalog1");
Menu_Mirar(0);
break;
case 117:
case 85:
if (sb!=0) Sound_SN("catalog1");
Menu_Utilidad();
break;
case 105:
case 73:
if (sb!=0) Sound_SN("catalog1");
Info( NaC /*LEXE*/ );
break;
case 115:
case 83:
if (sb!=0) Sound_SN("catalog9");
if (raton!=0) desactiva_raton();
fundido_al_negro();
closegraph(); /* Return the system to text mode */
cprintf("Gracias por utilizar mi Software\nJos David Guilln\n");
sleep(2);
if(sb2) SOUNDFXDRIVER(FINDRV);
// key_init(RESTORE);
exit(1);
break;
case 0:
ch = getch();
if (ch== 15 && raton!=0) {
activa_raton();
do{
ent.x.ax = 3;
int86(0x33, &ent, &sal); /* lee posici¢n y estados del bot¢n */
boton_izq = sal.x.bx & 1;
boton_der = (sal.x.bx >> 1) & 1;
x_raton = sal.x.cx;
y_raton = sal.x.dx;
}while(boton_izq==0);
if(x_raton >= 110 && x_raton <= 118 && y_raton >= 78 && y_raton <= 86) {
desactiva_raton();
if (sb!=0) Sound_SN("catalogb");
Animacion();
activa_raton();
}
}
break;
default:
if (sb) Sound_SN("catalog3");
if(raton!=0) activa_raton();
}
// if (ch==0) getch();
}
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* Comprueba las pulsaciones del rat¢n */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
if(raton!=0) {
ent.x.ax = 3;
int86(0x33, &ent, &sal); /* lee posici¢n y estados del bot¢n */
boton_izq = sal.x.bx & 1;
boton_der = (sal.x.bx >> 1) & 1;
x_raton = sal.x.cx;
y_raton = sal.x.dx;
if(boton_izq==1 || boton_der==1) {
if (raton!=0) desactiva_raton();
if( CheckButon(4, menu) ) {
switch(bpush) {
case 1:
Menu_Mirar(0);
break;
case 2:
Menu_Utilidad();
break;
case 3:
Info( NaC /*LEXE*/ );
break;
case 4:
if (sb!=0) Sound_SN("cataloga");
if (raton!=0) desactiva_raton();
fundido_al_negro();
closegraph(); /* Return the system to text mode */
cprintf ("Gracias por utilizar mi Software\nJos David Guilln\n");
sleep(2);
if(sb2) SOUNDFXDRIVER(FINDRV);
// key_init(RESTORE);
exit(1);
default:
break;
}
}
if (raton!=0) activa_raton();
}
}
gotoxy(1,1);
printf("x: %3d y: %3d", x_raton, y_raton);
}while(1);
}
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* */
/* INITIALIZE: Initializes the graphics system and reports */
/* any errors which occured. */
/* */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
void Initialize(void)
{
int errorcode;
int Gd = 9, Gm = 2;
//int Gd = DETECT, Gm;
// installuserdriver("Svga256", DetectVGA256);
//errorcode = registerfarbgidriver(Svga256_fdriver);
errorcode = registerbgidriver(EGAVGA_driver);
/* report any registration errors */
if (errorcode < 0)
{
printf("Graphics error: %s\n%d", grapherrormsg(errorcode), errorcode);
printf("Press any key to halt (REGISTRATION FAR):");
getch();
exit(1); /* terminate with an error code */
}
/* initialize graphics and local variables */
initgraph(&Gd,&Gm,"");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n%d", grapherrormsg(errorcode), errorcode);
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
}
// ÛÛÛÛÛ Û Û Û Û ÛÛ
// ÄÄÄÄÄÄÄÛÛÄÄÄÄÄÄÄÄÛÄÛÄÄÄÄÄÄÛÛÄÛÄÄÄÄÄÄÄÄÄÛÛÄÛÄÄÄÄÄÄÄÄÄÄÄÄÄÛÄÛÄÄÄÄÛÄÛÄÄÄÄÄÄÄÄÄÄ
// ÄÄÄÄÄÄÄÄÛÛÄÄÄÄÄÄÛÄÄÄÛÄÄÄÛÛÄÄÄÄÛÄÄÄÄÄÄÄÛÄÄÄÄÛÄÄÄÄÄÄÛÄÄÄÄÛÄÄÄÛÄÄÛÄÄÛÄÄÄÄÄÛÛÛÛÛ
// ÄÄÄÄÄÄÄÄÄÛÛÄÄÛÛÛÄÄÄÄÛÛÄÛÄÄÄÄÄÄÄÛÄÄÄÄÄÛÄÄÄÄÄÛÛÄÄÄÄÛÄÛÄÄÄÛÄÄÄÄÛÄÛÄÄÛÄÄÄÄÛÄÄÄÄÄ
// ÄÄÄÄÄÄÄÛÛÛÄÄÄÄÄÄÄÄÄÄÄÄÛÄÄÄÄÄÄÄÄÄÛÄÄÄÛÄÄÄÄÄÄÄÛÄÄÄÛÄÄÄÛÄÛÄÄÄÄÄÄÛÄÄÄÛÄÄÄÄÛÄÄÄÄÄ
// ÄÄÄÄÄÄÛÛÛÛÛÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÛÄÛÄÄÄÄÄÄÄÄÄÛÄÛÄÄÄÄÄÛÄÄÄÄÄÄÄÄÄÄÄÄÛÄÄÛÄÄÄÄÄÄ
// ÛÛÛ Û ÛÛ ÛÛ
void Sound_SN(char headfile[])
{
if ( sb2 ) {
strcpy(dir_sfx, headfile);
strcat(dir_sfx, ".voc");
if( strcmp( vieja_dir_sfx, dir_sfx ) != 0 ) {
strcpy(vieja_dir_sfx, dir_sfx);
PlaySound(1);
} else PlaySound(0);
} else {
sound(440);
delay(50);
nosound();
}
}
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* Borra las distintas pantallas de visualizaci¢n #1 #2 y #3 */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
void BorraViewPort(int view)
{
setcolor(0);
setlinestyle(0, 0, NORM_WIDTH);
setfillstyle(1, 0);
if(view==1) bar(217, 32, 298, 206);
if(view==2) bar(325, 32, 593, 206);
if(view==3) bar(216, 272, 593, 448);
}
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* Da un mensaje de ERROR en modo GRµFICO */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/*void MensajeError(int erronum)
{
char *msg_error[] = { "Error leyendo dispositivo E/S",
"Error de proteccion contra escritura",
"Error Disco lleno",
"Error utilizando Sound_SN Blaster",
"Error FALTA MEMORIA",
"Error Ficheros necesarios",
"de uso interno no encontrados",
"Error SISTEMA ALTERADO",
"INTENTO DE PIRATEO",
"Error el dispositivo: PRN",
"Error de tipo DESCONOCIDO",
"compruebe su sistema minuciosamente"
};
// ImprimeBoton(160, 176, 480, 304, 7, 63, 8);
}*/
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* Principio del Menu Mirar */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
void Menu_Mirar(int Mirar_Modificar)
{
union REGS ent, sal;
int ch, x, y;
int salir = FALSE;
char *texto[] = { "Juegos ", "M£sica ", "P.Textos",
"Contabil. ", "Electr¢n. ", "Gr ficos",
"Utilidades", "Lenguajes ", "Windows ",
"Varios... ", "RETROCEDER", " " };
struct boton menu[11];
menu[0].left = 325; menu[0].up = 33; menu[0].right = 412; menu[0].down = 76;
menu[1].left = 413; menu[1].up = 33; menu[1].right = 503; menu[1].down = 76;
menu[2].left = 504; menu[2].up = 33; menu[2].right = 592; menu[2].down = 76;
menu[3].left = 325; menu[3].up = 77; menu[3].right = 412; menu[3].down = 120;
menu[4].left = 413; menu[4].up = 77; menu[4].right = 503; menu[4].down = 120;
menu[5].left = 504; menu[5].up = 77; menu[5].right = 592; menu[5].down = 120;
menu[6].left = 325; menu[6].up = 121; menu[6].right = 412; menu[6].down = 164;
menu[7].left = 413; menu[7].up = 121; menu[7].right = 503; menu[7].down = 164;
menu[8].left = 504; menu[8].up = 121; menu[8].right = 592; menu[8].down = 164;
menu[9].left = 325; menu[9].up = 165; menu[9].right = 412; menu[9].down = 205;
menu[10].left = 413; menu[10].up = 165; menu[10].right = 592; menu[10].down = 205;
for(x=0; x<11; x++) ImprimeBoton2 (1, 7, 63, 56, menu[x]);
ch=-1;
for(y=40; y<=169; y+=43) { /* 40 */
for(x=330; x<=510; x+=90) {
++ch;
setcolor(15);
outtextxy(x+1, y+1, texto[ch]);
setcolor(1);
outtextxy(x, y, texto[ch]);
setcolor(4);
if(ch!=11) outtextxy(x+1, y+5, "-");
}
}
if(raton!=0) {
inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
activa_raton();
}
x=11; /* Las x's representan el boton pulsado, que sera 11 en el caso de que
se pulse salir para no activar ninguna opcion */
do{
if (kbhit()) {
if (raton!=0) desactiva_raton();
ch = getch();
switch( ch ) {
case 0: getch();
break;
case 74:
case 106: x=1;
salir = TRUE;
break;
case 77:
case 109: x=2;
salir = TRUE;
break;
case 80:
case 112: x=3;
salir = TRUE;
break;
case 67:
case 99: x=4;
salir = TRUE;
break;
case 69:
case 101: x=5;
salir = TRUE;
break;
case 71:
case 103: x=6;
salir = TRUE;
break;
case 85:
case 117: x=7;
salir = TRUE;
break;
case 76:
case 108: x=8;
salir = TRUE;
break;
case 87:
case 119: x=9;
salir = TRUE;
break;
case 86:
case 118: x=10;
salir = TRUE;
break;
case 82:
case 114: salir = TRUE;
break;
default:
if (sb) Sound_SN("catalog3");
break;
}
if (raton!=0) activa_raton();
}
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* Comprueba las pulsaciones del rat¢n */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
if(raton!=0 && !salir ) {
ent.x.ax = 3;
int86(0x33, &ent, &sal); /* lee posici¢n y estados del bot¢n */
boton_izq = sal.x.bx & 1;
boton_der = (sal.x.bx >> 1) & 1;
x_raton = sal.x.cx;
y_raton = sal.x.dx;
if(boton_izq==1 || boton_der==1) {
desactiva_raton();
if( CheckButon(11, menu) ) { x = bpush; salir = TRUE; }
activa_raton();
}
}
}while(!salir);
if (raton!=0) desactiva_raton();
if (sb) Sound_SN("catalog1");
BorraViewPort(2);
if(x!=11) {
if(Mirar_Modificar>=0 && Mirar_Modificar<=1) Editar_Modificar(Mirar_Modificar, x);
if(Mirar_Modificar==2) Imprimir_Individual(x);
}
if (raton!=0) inicializa_raton_grafico(0, 0, 624, 464, 320, 240);
}
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* Dibuja el Men£ de Utilidad */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
void Dibuja_Menu_Utilidad(void)
{
setcolor(15);
outtextxy(329, 39, "Pedidos");
outtextxy(329, 97, "Impresi¢n");
outtextxy(329, 105, " Completa");
outtextxy(461, 97, "Impresi¢n");
outtextxy(461, 105, " Individual");
outtextxy(329, 151, "Men£");
outtextxy(329, 159, " Principal");
outtextxy(461, 151, "RETROCEDER");
setcolor(1);
outtextxy(330, 40, "Pedidos");
outtextxy(330, 98, "Impresi¢n");
outtextxy(330, 106, " Completa");
outtextxy(462, 98, "Impresi¢n");
outtextxy(462, 106, " Individual");
outtextxy(330, 152, "Men£");
outtextxy(330, 160, " Principal");
outtextxy(462, 152, "RETROCEDER");
setcolor(4);
outtextxy(330, 45, "-");
outtextxy(330, 111, " -");
outtextxy(462, 111, " -");
outtextxy(330, 157, "-");
outtextxy(462, 157, "-");
}
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* Principio del Men£ Utilidad */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
void Menu_Utilidad(void)
{
union REGS ent, sal;
int ch;
int salir = FALSE;
struct boton menu[6];
menu[0].left = 325; menu[0].up = 33; menu[0].right = 455; menu[0].down = 90;
menu[1].left = 457; menu[1].up = 33; menu[1].right = 592; menu[1].down = 90;
menu[2].left = 325; menu[2].up = 91; menu[2].right = 455; menu[2].down = 146;
menu[3].left = 457; menu[3].up = 91; menu[3].right = 592; menu[3].down = 146;
menu[4].left = 325; menu[4].up = 147; menu[4].right = 455; menu[4].down = 205;
menu[5].left = 457; menu[5].up = 147; menu[5].right = 592; menu[5].down = 205;
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Utilidad();
if(raton!=0) {
inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
activa_raton();
}
do{
if (kbhit()) {
if (raton!=0) desactiva_raton();
ch = getch();
switch( ch ) {
case 0: getch();
break;
case 80:
case 112: if (sb) Sound_SN("catalog1");
EditarModificarPedidos();
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Utilidad();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
case 67:
case 99: if (sb) Sound_SN("catalog1");
Imprimir_Individual(0);
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Utilidad();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
case 73:
case 105: if (sb) Sound_SN("catalog1");
Menu_Mirar(2);
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Utilidad();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
case 77:
case 109: if( Setup.codigo == 0 ) Menu_Principal();
else { if(PideCodigo() == 1) Menu_Principal(); }
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Utilidad();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
case 82:
case 114:
if (sb) Sound_SN("catalog1");
salir = TRUE;
break;
default:
if (sb) Sound_SN("catalog3");
break;
}
if (raton!=0) activa_raton();
}
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* Comprueba las pulsaciones del rat¢n */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
if(raton!=0 && !salir ) {
ent.x.ax = 3;
int86(0x33, &ent, &sal); /* lee posici¢n y estados del bot¢n */
boton_izq = sal.x.bx & 1;
boton_der = (sal.x.bx >> 1) & 1;
x_raton = sal.x.cx;
y_raton = sal.x.dx;
if(boton_izq==1 || boton_der==1) {
desactiva_raton();
if( CheckButon(6, menu) ) {
switch(bpush) {
case 1:
EditarModificarPedidos();
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Utilidad();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
/* case 2:
break; VACIO VACIO VACIO VACIO VACIO VACIO
*/
case 3:
Imprimir_Individual(0);
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Utilidad();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
case 4:
Menu_Mirar(2);
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Utilidad();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
case 5:
if( Setup.codigo == 0 ) Menu_Principal();
else { if(PideCodigo() == 1) Menu_Principal(); }
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Utilidad();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
case 6:
salir = TRUE;
break;
default:
activa_raton();
break;
}
} else activa_raton();
}
}
}while(!salir);
if (raton!=0) desactiva_raton();
BorraViewPort(2);
if(raton!=0) {
inicializa_raton_grafico(0, 0, 624, 464, 320, 240);
activa_raton();
}
}
void Dibuja_Menu_Principal(void)
{
setcolor(1);
outtextxy(462, 40, "Modificar");
outtextxy(462, 48, " Comentario");
outtextxy(330, 98, "Configuracion");
outtextxy(330, 152, "Add/Supr.");
outtextxy(330, 160, " Programas");
outtextxy(462, 152, "RETROCEDER");
setcolor(4);
outtextxy(462, 45, "-");
outtextxy(330, 103, "-");
outtextxy(330, 157, "-");
outtextxy(462, 157, "-");
}
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* Principio del Men£ Principal */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
void Menu_Principal(void)
{
union REGS ent, sal;
int ch;
int salir = FALSE;
struct boton menu[6];
menu[0].left = 325; menu[0].up = 33; menu[0].right = 455; menu[0].down = 90;
menu[1].left = 457; menu[1].up = 33; menu[1].right = 592; menu[1].down = 90;
menu[2].left = 325; menu[2].up = 91; menu[2].right = 455; menu[2].down = 146;
menu[3].left = 457; menu[3].up = 91; menu[3].right = 592; menu[3].down = 146;
menu[4].left = 325; menu[4].up = 147; menu[4].right = 455; menu[4].down = 205;
menu[5].left = 457; menu[5].up = 147; menu[5].right = 592; menu[5].down = 205;
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Principal();
if(raton!=0) {
inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
activa_raton();
}
do{
if (kbhit()) {
if (raton!=0) desactiva_raton();
ch = getch();
switch( ch ) {
case 0: getch();
break;
case 77:
case 109: if (sb) Sound_SN("catalog1");
Modificar_Comentario();
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Principal();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
case 67:
case 99: if (sb) Sound_SN("catalog1");
Configuracion();
BorraViewPort(1);
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Principal();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
case 65:
case 97: if (sb) Sound_SN("catalog1");
Menu_Mirar(1);
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Principal();
if(raton!=0) inicializa_raton_grafico(325,33,584, 189, 454, 111);
break;
case 82:
case 114:
if (sb) Sound_SN("catalog1");
salir = TRUE;
break;
default:
if (sb) Sound_SN("catalog3");
break;
}
if (raton!=0) activa_raton();
}
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* Comprueba las pulsaciones del rat¢n */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
if(raton!=0 && !salir ) {
ent.x.ax = 3;
int86(0x33, &ent, &sal); /* lee posici¢n y estados del bot¢n */
boton_izq = sal.x.bx & 1;
boton_der = (sal.x.bx >> 1) & 1;
x_raton = sal.x.cx;
y_raton = sal.x.dx;
if(boton_izq==1 || boton_der==1) {
desactiva_raton();
if( CheckButon(6, menu) ) {
switch(bpush) {
/* case 1:
EditarModificarPedidos();
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Principal();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
*/
case 2:
Modificar_Comentario();
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Principal();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
case 3:
Configuracion();
BorraViewPort(1);
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Principal();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
// case 4:
// /* VACIO */
// break;
case 5:
Menu_Mirar(1);
for(ch=0; ch<6; ch++) ImprimeBoton2 (1, 7, 63, 56, menu[ch]);
Dibuja_Menu_Principal();
if(raton!=0) inicializa_raton_grafico(325, 33, 584, 189, 454, 111);
break;
case 6:
salir = TRUE;
break;
default:
activa_raton();
break;
}
} else activa_raton();
}
}
}while(!salir);
if (raton!=0) desactiva_raton();
BorraViewPort(2);
if(raton!=0) {
inicializa_raton_grafico(0, 0, 624, 464, 320, 240);
activa_raton();
}
}
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
void CheckArg(int nargumentos, char *argumentos[]) {
int contador;
for(contador=1; contador<=nargumentos; contador++) {
if ( !strcmpi( argumentos[contador], "SB0") ) NoIniSb = 0;
if ( !strcmpi( argumentos[contador], "PO" ) ) PunteroRaton = 1;
if ( !strcmpi( argumentos[contador], "NS" ) ) sb=0;
if ( !strcmp ( argumentos[contador], "/?" ) || !strcmpi( argumentos[contador], "/H") ) {
//////////////////////// Show Help Screen ////////////////////////
clrscr();
textcolor(WHITE); textbackground(BLUE);
cprintf("Copyright (c) J.D. System 1994. Jos David Guilln Dominguez... Cat logo 4.0 ");
textbackground(BLACK);
gotoxy(1,3);
printf("Sintaxis:\n");
printf(" SB0 ---------> redirecciona sonidos al Speaker\n");
printf(" NS ----------> sin sonido de ninguna clase\n");
printf(" PO ----------> puntero original de raton\n");
printf(" /? o /H -----> muestra esta Pantalla\n");
printf("\nTodos los parametros se pueden definir por defecto en la variable de entorno SET");
printf("\nSET JD_C4 = SB0 PO \n\n");
gotoxy(1, 23);
exit(0);
}
}
}
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
/* ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ */
int CheckButon(int nb, struct boton menu[])
{
union REGS ent, sal;
int y;
int Pulso = 0;
for(y = 0; y < nb; y++) {
if(x_raton >= menu[y].left && x_raton <= menu[y].right &&
y_raton >= menu[y].up && y_raton <= menu[y].down) {
bpush = y + 1;
Pulso = 1;
}
}
if(Pulso) {
ImprimeBoton2 (0, 7, 56, 63, menu[bpush-1]);
if (sb!=0) Sound_SN("catalog2");
if (raton!=0) activa_raton();
do {
ent.x.ax = 3;
int86(0x33, &ent, &sal); /* lee posici¢n y estados del bot¢n */
boton_izq = sal.x.bx & 1;
boton_der = (sal.x.bx >> 1) & 1;
} while(boton_izq==1 || boton_der==1);
if (raton!=0) desactiva_raton();
ImprimeBoton2 (0, 7, 63, 56, menu[bpush-1]);
} else if (sb!=0) Sound_SN("catalog4");
return Pulso;
}
int PideCodigo(void){
int Devuelve = 0;
char string[15] = "\0";
BorraViewPort(2);
/////// Devolvera 1. Si el c¢digo es correcto.
setcolor(12);
outtextxy( 42 * 8 - 7, 6 * 16 - 16, "C¢digo:" );
setcolor(4);
outtextxy( 328, 79 , "C¢digo:" );
// sprintf(string, "%05ld", Setup.codigo);
InputCadenaG( string, 1, 8, 53, 6, 63, 57);
if( Setup. codigo == atol(string) ) Devuelve = 1;
BorraViewPort(2);
return Devuelve;
}