145 lines
3.3 KiB
C++
145 lines
3.3 KiB
C++
#include <dos.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
#include <alloc.h>
|
|
#include <conio.h>
|
|
#include <stdlib.h>
|
|
#include <graphics.h>
|
|
|
|
#include "..\..\libs\make_bot\make_bot.h"
|
|
#include "frec.h"
|
|
|
|
char Optar( char *texto1, char *texto2, char *texto3 );
|
|
int Muestra_Mensaje(int Mensaje, char *file);
|
|
//void redefine_cursor_raton(int r_e);
|
|
|
|
extern CFG_FREC cfgFREC;
|
|
|
|
char Optar( char *texto1, char *texto2, char *texto3 ){
|
|
|
|
int ok = 0, inst = 0;
|
|
struct textsettingstype textinfo;
|
|
|
|
void *C_Texto, *C_Aceptar, *C_Cancelar;
|
|
|
|
C_Texto = malloc( JD_imagesize(200, 212, 440, 267) );
|
|
C_Aceptar = malloc( JD_imagesize(200, 270, 280, 295) );
|
|
C_Cancelar = malloc( JD_imagesize(360, 270, 440, 295) );
|
|
|
|
if( C_Texto == NULL || C_Aceptar == NULL || C_Cancelar == NULL) {
|
|
closegraph();
|
|
cprintf("\n\rSALIENDO");
|
|
cprintf("\n\rImposible encontrar %ldKbytes en el Heap",
|
|
( JD_imagesize(118, 160, 521, 335) +
|
|
JD_imagesize(118, 160, 521, 335) +
|
|
JD_imagesize(118, 160, 521, 335)
|
|
)
|
|
);
|
|
exit(SIN_MEMORIA);
|
|
}
|
|
|
|
gettextsettings(&textinfo);
|
|
|
|
settextstyle(SMALL_FONT, HORIZ_DIR, 5 );
|
|
// settextjustify(CENTER_TEXT, CENTER_TEXT);
|
|
|
|
getimage(200, 212, 440, 267, C_Texto);
|
|
getimage(200, 270, 280, 295, C_Aceptar);
|
|
getimage(360, 270, 440, 295, C_Cancelar);
|
|
|
|
|
|
Imprime_Estaticos(100, "FREC.DAT"); // Imprime botones estaticos 'Seccion 20'
|
|
|
|
Imprime_Secuencia(3); // Imprime secuencia 4.
|
|
Imprime_Estaticos(101, "FREC.DAT"); // Imprime textos estaticos 'Seccion 5'
|
|
|
|
|
|
setcolor( cfgFREC.Texto );
|
|
outtextxy( 210+( ( 230 - textwidth(texto1) ) / 2 ), 220, texto1 );
|
|
outtextxy( 210+( ( 230 - textwidth(texto2) ) / 2 ), 235, texto2 );
|
|
outtextxy( 210+( ( 230 - textwidth(texto3) ) / 2 ), 250, texto3 );
|
|
|
|
while(!ok){ // Bucle infinito
|
|
|
|
switch( Comprueba_Secuencia( 3, NULL ) ) { // Iniciamos comprobacion de 2¦ sec
|
|
|
|
case 0: // No se pulso ningun BOTON
|
|
// Pero el raton fue presionado en
|
|
// algun sitio...
|
|
break;
|
|
case -2: // Hay una tecla normal en BUFFER
|
|
switch( getch() ) { // La utilizamos
|
|
// ESC ( CANCELAR )
|
|
case 14:
|
|
inst = 0;
|
|
ok = 1;
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
break;
|
|
case -1: // Hay una tecla especial en BUFFER
|
|
getch(); // La eliminamos
|
|
break;
|
|
// Boton Aceptar
|
|
case 1:
|
|
inst = 1;
|
|
ok = 1;
|
|
break;
|
|
// Boton Cancelar
|
|
case 2:
|
|
inst = 0;
|
|
ok = 1;
|
|
break;
|
|
default:
|
|
while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER
|
|
break;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
putimage(200, 212, C_Texto, COPY_PUT);
|
|
putimage(200, 270, C_Aceptar, COPY_PUT);
|
|
putimage(360, 270, C_Cancelar, COPY_PUT);
|
|
|
|
free ( C_Texto );
|
|
free ( C_Aceptar );
|
|
free ( C_Cancelar );
|
|
|
|
|
|
settextstyle(textinfo.font, textinfo.direction, textinfo.charsize );
|
|
settextjustify(textinfo.horiz, textinfo.vert);
|
|
|
|
return inst;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
int Muestra_Mensaje(int Mensaje, char *file) {
|
|
void *Imagen;
|
|
|
|
|
|
if ( (Imagen = malloc( JD_imagesize(200, 212, 440, 267) ) ) == NULL ) {
|
|
Espera_TeclaRaton();
|
|
Anclar_Raton();
|
|
return -1;
|
|
} else {
|
|
getimage( 200, 212, 440, 267, Imagen );
|
|
Imprime_Estaticos( Mensaje, file);
|
|
// Fichero_bot( Mensaje );
|
|
|
|
Espera_TeclaRaton();
|
|
Anclar_Raton();
|
|
putimage( 200, 212, Imagen, COPY_PUT);
|
|
free(Imagen);
|
|
return 1;
|
|
}
|
|
}
|
|
|