CD_OUT_SRC/CD_IN/CD_EDIT.CPP
2021-09-03 17:50:32 +02:00

1177 lines
33 KiB
C++
Raw Permalink Blame History

extern int Fichero_cd_in2(char Dinamicos_Estaticos);
#include <alloc.h>
#include <dos.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <conio.h> // Para getch();
#include <graphics.h> // Para outtextxy(...); y cleardevice(...);
#include "d:\program\src_dos\libs\make_bot\make_bot.h" // Fuciones de MAKE_BOTON
#include "cd_icons.h"
#include "..\cd_file.h"
#define DOS 1
#define WINDOWS 2
#define Letra_Boton setcolor(1);
#define Azul 1
#define Texto_Normal setcolor(255);
#define Texto_Negrita setcolor(240);
void BEEP(void);
int InputCadenaG_T4(char *s, int numalp, int lmax, int cc, int cf, int X0, int Y0/*, int X1, int Y1*/, int RoW);
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
/*****/ void Abre_Ficha_CD_in(void); /*****/
/*****/ void Poner_a_cero_estructura_actual_CD_in(void); /*****/
/*****/ void PutLineCD_in(void); /*****/
/*****/ void GetLineCD_in(void); /*****/
/*****/ void DeleteRecordCD_in(void); /*****/
/*****/ void AddRecordCD_in(void); /*****/
/*****/ void Mueve_Abajo_CD_in(void); /*****/
/*****/ void Mueve_Arriba_CD_in(void); /*****/
/*****/ void EditCursorCD_in(int ShowHide); /*****/
/*****/ void PrintLineCD_in(void); /*****/
/*****/ void PrintLineCD_in2(void); /*****/
/*****/ void PrintWholeScreenCD_in(void); /*****/
/*****/ void Edit_Item_CD_in(void); /*****/
/*****/ void Borra_Campo_Visual(int Columna); /*****/
/*****/ FILE *CD_in; /*****/
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
CD_FILE CD_in1;
struct Cabecera CD_cabecera;
void Muestra_Comentario(void);
int Editar_Comentario(void);
void Muestra_Informacion(void);
void Inicializa_Apertura(void);
void Coloca_Iconos(int Start_Icon);
void Menu_de_Edicion(void);
int Items_for = DOS;
int Item_select = 1;
int CurrTopLineCD_in = 1; int CurrRowCD_in = 1;
int CurrColCD_in = 1;
void Menu_de_Edicion(void){
int ok = 0, key;
int Curr_Item = 1;
Imprime_Bordes(1, 2, 251);
settextstyle( SMALL_FONT, HORIZ_DIR, 4);
Inicializa_Apertura();
Muestra_Informacion();
Muestra_Comentario();
while(!ok){ // Bucle infinito
switch( Comprueba_Secuencia( 1 ) ) { // Iniciamos comprobacion de iconos
case 0: // No se pulso ningun BOTON
// Pero el raton fue presionado en
// algun sitio...
break;
case -2: // Hay una tecla normal en BUFFER
key = getch(); // La utilizamos
if( isprint(key) || isspace(key) ) {
if(key!=13) ungetch(key);
Edit_Item_CD_in();
EditCursorCD_in(0);
}
break;
case -1: // Hay una tecla especial en BUFFER
EditCursorCD_in(1);
switch( (key=getch()) ){ // La utilizamos
// Flecha Arriba
case 72:
Mueve_Arriba_CD_in();
Muestra_Informacion();
Muestra_Comentario();
break;
// Flecha Izquierda
case 75:
case 15:
CurrColCD_in--; if ( CurrColCD_in<1 ) CurrColCD_in=8;
break;
// Flecha Derecha
case 77:
case 9:
CurrColCD_in++; if ( CurrColCD_in>8 ) CurrColCD_in=1;
break;
// Flecha Abajo
case 80:
Mueve_Abajo_CD_in();
Muestra_Informacion();
Muestra_Comentario();
break;
// INICIO
case 71:
CurrColCD_in = 1;
break;
// FIN
case 79:
CurrColCD_in = 8;
break;
// ReP<65>g
case 73:
// CurrRow = 1;
if( CurrTopLineCD_in + CurrRowCD_in > 28 ) { CurrTopLineCD_in -= 11; } else { CurrTopLineCD_in = 1; CurrRowCD_in = 1;}
if( CurrTopLineCD_in + CurrRowCD_in< 1 ) { CurrTopLineCD_in = 1; CurrRowCD_in = 1;}
PrintWholeScreenCD_in();
GetLineCD_in();
Muestra_Informacion();
break;
// AvP<76>g
case 81:
// CurrRow = 1;
CurrTopLineCD_in += 11;
if ( (CurrTopLineCD_in +CurrRowCD_in-1) > CD_cabecera.Records) { CurrTopLineCD_in = CD_cabecera.Records; CurrRowCD_in = 1; }
if (CurrTopLineCD_in ==0) CurrTopLineCD_in = 1;
PrintWholeScreenCD_in();
GetLineCD_in();
Muestra_Informacion();
break;
default:
break;
}
EditCursorCD_in(0);
break;
// Boton Windows
case 1:
Imprime_Bordes(1, 2, -1);
Items_for = WINDOWS;
Imprime_Bordes(1, 1, 251);
fclose(CD_in);
Inicializa_Apertura();
Muestra_Informacion();
Muestra_Comentario();
break;
// Boton Dos
case 2:
Imprime_Bordes(1, 1, -1);
Items_for = DOS;
Imprime_Bordes(1, 2, 251);
fclose(CD_in);
Inicializa_Apertura();
Muestra_Informacion();
Muestra_Comentario();
break;
// Boton Retroceder Icono
case 3:
Curr_Item--; if ( Curr_Item<= 0 ) Curr_Item = 15;
Coloca_Iconos(Curr_Item);
break;
// Boton Avanzar Icono
case 4:
Curr_Item++; if ( Curr_Item>=15 ) Curr_Item = 1;
Coloca_Iconos(Curr_Item);
break;
// Boton Creditos
case 5:
break;
// Boton Salir
case 6:
ok = 1;
break;
// Boton A<>adir
case 7:
AddRecordCD_in();
Muestra_Informacion();
Muestra_Comentario();
break;
// Boton Borrar
case 8:
DeleteRecordCD_in();
Muestra_Informacion();
Muestra_Comentario();
break;
// Boton Editar Comentario
case 9:
Editar_Comentario();
break;
// Boton Confirmar Icono
case 10:
Item_select = Curr_Item;
fclose(CD_in);
Inicializa_Apertura();
Muestra_Informacion();
Muestra_Comentario();
break;
default:
while( kbhit() ) getch(); // Limpiamos posibles teclas en BUFFER
break;
}
}
fclose(CD_in);
return;
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F> <20>
//<2F> <20><> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20> <20><><EFBFBD> <20><> <20><><EFBFBD> <20>
//<2F> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
//<2F> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD> <20> <20> <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20>
//<2F> <20> <20> <20> <20><><EFBFBD> <20> <20> <20> <20><><EFBFBD><EFBFBD> <20> <20> <20> <20> <20><><EFBFBD><EFBFBD> <20>
//<2F> <20>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void Abre_Ficha_CD_in(void){
char ArchivoDatos[]="JD_Soft.FV";
char Memoria;
void *Imagen;
int cm;
cm = JD_imagesize(200, 212, 440, 267);
if ( (Imagen = malloc( cm /*imagesize(200, 212, 440, 267)*/ ) ) == NULL ) Memoria = 0;
else {
Memoria = 1;
getimage( 200, 212, 440, 267, Imagen );
Fichero_cd_in2(113);
//Imprime_Estaticos( 113, "cd_in.img");
settextstyle( SMALL_FONT, HORIZ_DIR, 4);
}
if (Items_for == DOS)
sprintf(ArchivoDatos, "CD_D%02d.dat", Item_select );
else
sprintf(ArchivoDatos, "CD_W%02d.dat", Item_select );
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>//
//<2F> CD_in Apertura de Indice, y Datos, o creaci<63>n... <20>//
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>//
int LSJ = sizeof(struct Cabecera);
int LSC = sizeof(CD_FILE);
if ( (CD_in = fopen( ArchivoDatos, "r+b"))==NULL) {
FILE *fa;
if ( (fa = fopen( ArchivoDatos, "wb" ) )!=NULL ) {
Poner_a_cero_estructura_actual_CD_in();
CD_cabecera.Records = 0;
rewind(fa);
fwrite(&CD_cabecera, LSJ, 1, fa); fseek(fa, (long)LSJ, SEEK_SET);
fwrite(&CD_in1, LSC, 1, fa);
if (fclose(fa) == EOF ) exit(1);
}
if ( (CD_in = fopen( ArchivoDatos, "r+b"))==NULL) {
if ( Memoria ) free(Imagen);
restorecrtmode();
printf("NO SE PUDO ABRIR EL FICHERO INDICE EN LA 2<> PASADA");
exit(1);
}
}
rewind(CD_in);
if ( fread(&CD_cabecera, LSJ, 1, CD_in) != 1 ) {
if ( Memoria ) free(Imagen);
restorecrtmode();
printf("NO SE PUDO LEER EN EL FICHERO: INDICE");
exit(1);
}
fseek(CD_in, (long)LSJ, SEEK_SET);
if ( fread(&CD_in1, LSC, 1, CD_in) != 1 ) {
if ( Memoria ) free(Imagen);
restorecrtmode();
printf("NO SE PUDO LEER EN EL FICHERO: DATOS");
exit(1);
}
if( Memoria ) {
putimage( 200, 212, Imagen, COPY_PUT);
free(Imagen);
}
}
void Poner_a_cero_estructura_actual_CD_in(void){
char CR = 13, LF = 10, BEEP = 7, ANY = 26;
sprintf( CD_cabecera.Nombre_del_Programa, "%c %c %c - CD_OUT - %c %c", CR, LF, BEEP, CR, LF );
sprintf( CD_cabecera.Comentario_Inicial, "Jos<EFBFBD> David Guill<6C>n %c %c %c %c", CR, LF, BEEP, ANY );
CD_cabecera.VerHi = 1; CD_cabecera.VerLow = 0;
CD_cabecera.Register = 1;
CD_in1.Typo.DOS_WINDOWS = ( Items_for == DOS ? 0 : 1);
CD_in1.Typo.Tipo_de_Programa = Item_select;
CD_in1.Typo.T_Dibujo = 0;
CD_in1.Typo.Install = 0;
CD_in1.Typo.Ejecutable = 0;
strcpy( CD_in1.Nombre, "\0" );
for(CR=0; CR<32; CR++)
// strcpy( CD_in1.Comentario[CR], " ");
strcpy( CD_in1.Comentario[CR], " ");
strcpy( CD_in1.N_Img, "\0");
strcpy( CD_in1.Dir_P, "\0");
CD_in1.Alt_Install.Usar_VGA_COPY = 0;
CD_in1.Alt_Install.Usar_ARJ = 0;
CD_in1.Alt_Install.Usar_ZIP = 0;
CD_in1.Alt_Install.Usar_LHA = 0;
CD_in1.Alt_Install.Usar_XCopy = 0;
CD_in1.Alt_Install.Usar_Install_P = 0;
// CD_in1.Alt_Install.Usar_NO_Install = 0;
strcpy( CD_in1.N_Install, "\0");
strcpy( CD_in1.N_Exe, "\0");
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F> <20>
//<2F> <20><> <20><><EFBFBD> <20><><EFBFBD> <20> <20> <20><><EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD> <20>
//<2F> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
//<2F> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20> <20> <20> <20> <20> <20>
//<2F> <20> <20> <20> <20> <20><><EFBFBD> <20> <20> <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20>
//<2F> <20>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void PutLineCD_in(void){
long LSJ = sizeof(struct Cabecera);
long LSC = sizeof(CD_FILE);
long CurrRecord = CurrTopLineCD_in + CurrRowCD_in - 1;
fseek(CD_in, (long)LSJ + ( LSC * CurrRecord ) - LSC, SEEK_SET); // Se coloca
fwrite(&CD_in1, LSC, 1, CD_in); // Y escribe
}
void GetLineCD_in(void){
long LSJ = sizeof(struct Cabecera);
long LSC = sizeof(CD_FILE);
long CurrRecord = CurrTopLineCD_in + CurrRowCD_in - 1;
fseek(CD_in, (long)LSJ + ( LSC * CurrRecord ) - LSC, SEEK_SET); // Se coloca
fread(&CD_in1, LSC, 1, CD_in); // Y lee
}
void DeleteRecordCD_in(void) {
long CurrRecord;
long LSJ = sizeof(struct Cabecera);
long LSC = sizeof(CD_FILE);
CurrRecord = CurrTopLineCD_in + CurrRowCD_in - 1;
if ( (CD_cabecera.Records == 0) ) { BEEP();
Poner_a_cero_estructura_actual_CD_in();
fseek(CD_in, (long)LSJ + ( LSC * ( 0 ) ), SEEK_SET);
fwrite(&CD_in1, LSC, 1, CD_in);
PrintWholeScreenCD_in();
GetLineCD_in();
EditCursorCD_in(0);
} else {
CD_cabecera.Records -= 1;
unsigned int p = CurrRecord - 1;
while( p <= CD_cabecera.Records ) {
fseek(CD_in, (long)(LSJ + ( LSC * ( p + 1 ) )), SEEK_SET); // Se coloca
fread(&CD_in1, LSC, 1, CD_in); // Y lee
fseek(CD_in, (long)(LSJ + ( LSC * p )), SEEK_SET); // Se coloca
fwrite(&CD_in1, LSC, 1, CD_in); // Y escribe
p++;
};
rewind(CD_in);
fwrite(&CD_cabecera, LSJ, 1, CD_in); // Acualiza n<> de registros
if ((CurrRecord - 1) == CD_cabecera.Records + 1) CurrRowCD_in--;
/* <20> */
/* <20><><EFBFBD><EFBFBD> */ PrintWholeScreenCD_in();
/* <20> */ GetLineCD_in();
EditCursorCD_in(0);
PrintLineCD_in2();
}
}
void AddRecordCD_in(void){
long CurrRecord= CurrTopLineCD_in + CurrRowCD_in - 1;
long LSJ = sizeof(struct Cabecera);
long LSC = sizeof(CD_FILE);
if( CurrRecord < 100000 ) {
long avance = CD_cabecera.Records;
while( avance >= (CurrRecord-1) ) {
fseek(CD_in, (long)LSJ + ( LSC * avance ), SEEK_SET);
fread(&CD_in1, LSC, 1, CD_in);
fseek(CD_in, (long)LSJ + ( LSC * (avance + 1) ), SEEK_SET);
fwrite(&CD_in1, LSC, 1, CD_in);
avance--;
};
// CD_in1_inx.Fin = CD_in1_inx.Fin + 1;
CD_cabecera.Records++;
rewind(CD_in);
fwrite(&CD_cabecera, LSJ, 1, CD_in); // Acualiza n<> de registros
Poner_a_cero_estructura_actual_CD_in();
fseek(CD_in, (long)LSJ + ( LSC * ( CurrTopLineCD_in + CurrRowCD_in - 1) ), SEEK_SET);
fwrite(&CD_in1, LSC, 1, CD_in);
CurrRowCD_in++;
if (CurrRowCD_in>19) { CurrTopLineCD_in++; CurrRowCD_in--; }
PrintWholeScreenCD_in();
GetLineCD_in();
EditCursorCD_in(0);
PrintLineCD_in2();
}
}
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//<2F> <20>
//<2F> <20><><EFBFBD> <20><> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20> <20> <20><> <20>
//<2F> <20> <20> <20> <20> <20><> <20> <20> <20> <20> <20> <20> <20> <20> <20>
//<2F> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><> <20> <20><><EFBFBD><EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD> <20>
//<2F> <20> <20> <20> <20> <20> <20> <20> <20> <20><><EFBFBD> <20><><EFBFBD> <20> <20> <20>
//<2F> <20>
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
void Mueve_Abajo_CD_in(void){
int CurrRecord = CurrTopLineCD_in + CurrRowCD_in - 1;
if (CurrRowCD_in == 19) {
if ( (CurrRecord - 1) >= CD_cabecera.Records) { BEEP(); EditCursorCD_in(0); }
else { CurrTopLineCD_in++;
PrintWholeScreenCD_in();
GetLineCD_in();
PrintLineCD_in2();
}
} else {
if( (CurrRecord - 1) >= CD_cabecera.Records) { BEEP(); EditCursorCD_in(0); }
else { CurrRowCD_in++;
GetLineCD_in();
PrintLineCD_in2();
}
}
}
void Mueve_Arriba_CD_in(void){
int CurrRecord = CurrTopLineCD_in + CurrRowCD_in - 1;
if (CurrRowCD_in==1) {
if ((CurrRecord - 1) <= 0) { BEEP(); EditCursorCD_in(0); }
else {
CurrTopLineCD_in--;
PrintWholeScreenCD_in();
GetLineCD_in();
PrintLineCD_in2();
}
} else {
if( (CurrRecord - 1) <= 0) { BEEP(); // Do nothing, get over...
} else { CurrRowCD_in--;
GetLineCD_in();
PrintLineCD_in2();
}
}
}
void EditCursorCD_in(int ShowHide) {
char Buffer[80];
int Ch;
if (!ShowHide) {
setcolor(255);
setfillstyle(SOLID_FILL, 255);
Borra_Campo_Visual( CurrColCD_in );
setcolor(240);
} else {
setcolor(240);
setfillstyle(SOLID_FILL, 240);
Borra_Campo_Visual( CurrColCD_in );
Texto_Normal
}
switch(CurrColCD_in){
case 1:
// Nombre del Programa 26 d.
outtextxy( 8, 98 + (CurrRowCD_in-1) * 12, CD_in1.Nombre );
break;
case 2:
// Nombre del Instalador
outtextxy( 175, 98 + (CurrRowCD_in-1) * 12, CD_in1.N_Install );
break;
case 3:
// Nombre del Ejecutable
outtextxy( 233, 98 + (CurrRowCD_in-1) * 12, CD_in1.N_Exe);
break;
case 4:
// <20> Es Instalable ? <20> Cual es el Tipo ?
if ( CD_in1.Alt_Install.Usar_VGA_COPY ) strcpy( Buffer, "VCpy" ); else
if ( CD_in1.Alt_Install.Usar_ARJ ) strcpy( Buffer, "Arj" ); else
if ( CD_in1.Alt_Install.Usar_ZIP ) strcpy( Buffer, "Zip" ); else
if ( CD_in1.Alt_Install.Usar_XCopy ) strcpy( Buffer, "Xcpy" ); else
if ( CD_in1.Alt_Install.Usar_Install_P) strcpy( Buffer, "Inst" ); else
if ( CD_in1.Alt_Install.Usar_LHA ) strcpy( Buffer, "NO I" ); else
strcpy( Buffer, "NO I" );
outtextxy( 291, 98 + (CurrRowCD_in-1) * 12, Buffer );
break;
case 5:
// <20> Es ejecutable ?
strcpy( Buffer, (CD_in1.Typo.Ejecutable ? "SI" : "NO") );
outtextxy( 321, 98 + (CurrRowCD_in-1) * 12, Buffer );
break;
case 6:
// <20> Tiene Dibujo ?
strcpy( Buffer, (CD_in1.Typo.T_Dibujo ? "SI" : "NO") );
outtextxy( 353, 98 + (CurrRowCD_in-1) * 12, Buffer );
break;
case 7:
// Directorio
outtextxy( 123, 338, CD_in1.Dir_P );
break;
case 8:
// Nombre Imagen
outtextxy( 123, 358, CD_in1.N_Img );
break;
}
}
void PrintLineCD_in(void){
char Buffer[80];
setcolor(240);
setfillstyle(SOLID_FILL, 240);
Borra_Campo_Visual(-1);
Texto_Normal
// Nombre del Programa 26 d.
outtextxy( 8, 98 + (CurrRowCD_in-1) * 12, CD_in1.Nombre );
// Nombre del Instalador
outtextxy( 175, 98 + (CurrRowCD_in-1) * 12, CD_in1.N_Install );
// Nombre del Ejecutable
outtextxy( 233, 98 + (CurrRowCD_in-1) * 12, CD_in1.N_Exe);
// <20> Es Instalable ? <20> Cual es el Tipo ?
if ( CD_in1.Alt_Install.Usar_VGA_COPY ) strcpy( Buffer, "VCpy" ); else
if ( CD_in1.Alt_Install.Usar_ARJ ) strcpy( Buffer, "Arj" ); else
if ( CD_in1.Alt_Install.Usar_ZIP ) strcpy( Buffer, "Zip" ); else
if ( CD_in1.Alt_Install.Usar_XCopy ) strcpy( Buffer, "Xcpy" ); else
if ( CD_in1.Alt_Install.Usar_Install_P) strcpy( Buffer, "Inst" ); else
if ( CD_in1.Alt_Install.Usar_LHA ) strcpy( Buffer, "NO I" ); else
strcpy( Buffer, "NO I" );
outtextxy( 291, 98 + (CurrRowCD_in-1) * 12, Buffer );
// <20> Es ejecutable ?
strcpy( Buffer, (CD_in1.Typo.Ejecutable ? "SI" : "NO") );
outtextxy( 321, 98 + (CurrRowCD_in-1) * 12, Buffer );
// <20> Tiene Dibujo ?
strcpy( Buffer, (CD_in1.Typo.T_Dibujo ? "SI" : "NO") );
outtextxy( 353, 98 + (CurrRowCD_in-1) * 12, Buffer );
// Directorio
outtextxy( 123, 338, CD_in1.Dir_P );
// Nombre Imagen
outtextxy( 123, 358, CD_in1.N_Img );
}
void PrintLineCD_in2(void){
setcolor(240);
setfillstyle(SOLID_FILL, 240);
Borra_Campo_Visual(7);
Borra_Campo_Visual(8);
Texto_Normal
// Directorio
outtextxy( 123, 338, CD_in1.Dir_P );
// Nombre Imagen
outtextxy( 123, 358, CD_in1.N_Img );
}
void PrintWholeScreenCD_in(void){
int tmp = CurrRowCD_in;
setcolor(240);
setfillstyle(SOLID_FILL, 240);
Borra_Campo_Visual(-2);
for(CurrRowCD_in = 1; CurrRowCD_in < (19+1); CurrRowCD_in++)
if ( (CurrTopLineCD_in + CurrRowCD_in - 1) <= (CD_cabecera.Records + 1) ) {
GetLineCD_in();
PrintLineCD_in();
}
PrintLineCD_in2();
CurrRowCD_in = tmp;
}
void Edit_Item_CD_in(void){
char buffer[80];
switch(CurrColCD_in){
case 1:
// Nombre del Programa 26 d.
// Puntero a cadena, T/N, Dtos, Color, Fondo, Up, Left, Right, Down, Linea
InputCadenaG_T4( CD_in1.Nombre, 0, 26, 255, 250, 8, 98/*, 175, 327*/, CurrRowCD_in-1);
break;
case 2:
// Nombre del Instalador
InputCadenaG_T4( CD_in1.N_Install, 0, 8, 255, 250, 175, 98/*, 227, 327*/, CurrRowCD_in-1);
break;
case 3:
// Nombre del Ejecutable
InputCadenaG_T4( CD_in1.N_Exe, 0, 8, 255, 250, 233, 98/*, 285, 327*/, CurrRowCD_in-1);
break;
case 4:
// <20> Es Instalable ? <20> Cual es el Tipo ?
if ( CD_in1.Alt_Install.Usar_VGA_COPY ) strcpy( buffer, "1" ); else
if ( CD_in1.Alt_Install.Usar_ARJ ) strcpy( buffer, "2" ); else
if ( CD_in1.Alt_Install.Usar_ZIP ) strcpy( buffer, "3" ); else
if ( CD_in1.Alt_Install.Usar_XCopy ) strcpy( buffer, "4" ); else
if ( CD_in1.Alt_Install.Usar_Install_P) strcpy( buffer, "5" ); else
if ( CD_in1.Alt_Install.Usar_LHA ) strcpy( buffer, "6" );
InputCadenaG_T4( buffer, 1, 1, 255, 250, 291, 98/*, 315, 327*/, CurrRowCD_in-1);
CD_in1.Alt_Install.Usar_VGA_COPY = 0;
CD_in1.Alt_Install.Usar_ARJ = 0;
CD_in1.Alt_Install.Usar_ZIP = 0;
CD_in1.Alt_Install.Usar_XCopy = 0;
CD_in1.Alt_Install.Usar_Install_P = 0;
CD_in1.Alt_Install.Usar_LHA = 0;
switch( atoi(buffer) ) {
case 1: CD_in1.Alt_Install.Usar_VGA_COPY = 1;
break;
case 2: CD_in1.Alt_Install.Usar_ARJ = 1;
break;
case 3: CD_in1.Alt_Install.Usar_ZIP = 1;
break;
case 4: CD_in1.Alt_Install.Usar_XCopy = 1;
break;
case 5: CD_in1.Alt_Install.Usar_Install_P = 1;
break;
case 6: CD_in1.Alt_Install.Usar_LHA = 1;
break;
default:
break;
}
break;
case 5:
// <20> Es ejecutable ?
strcpy( buffer, (CD_in1.Typo.Ejecutable ? "1" : "0") );
InputCadenaG_T4( buffer, 1, 1, 255, 250, 321, 98/*, 347, 327*/, CurrRowCD_in-1);
CD_in1.Typo.Ejecutable = atoi(buffer);
break;
case 6:
// <20> Tiene Dibujo ?
strcpy( buffer, (CD_in1.Typo.T_Dibujo ? "1" : "0") );
InputCadenaG_T4( buffer, 1, 1, 255, 250, 353, 98/*, 377, 327*/, CurrRowCD_in-1);
CD_in1.Typo.T_Dibujo = atoi(buffer);
break;
case 7:
// Directorio
InputCadenaG_T4( CD_in1.Dir_P, 0, 40, 255, 250, 123, 338/*, 377, 352*/, 0);
break;
case 8:
// Nombre Imagen
InputCadenaG_T4( CD_in1.N_Img, 0, 8, 255, 250, 123, 358/*, 175, 372*/, 0);
break;
}
PutLineCD_in();
GetLineCD_in();
PrintLineCD_in();
PrintLineCD_in2();
}
void Borra_Campo_Visual(int Columna){
switch( Columna ) {
case -2:
// ** Nombre
bar( 8, 98, 169, 327 );
// ** Nombre Install
bar( 175, 98, 227, 327 );
// ** Nombre Exe
bar( 233, 98, 285, 327 );
// ** Instalable
bar( 291, 98, 315, 327 );
// ** Ejecutable
bar( 321, 98, 347, 327 );
// ** Imagen
bar( 353, 98, 377, 327 );
// *** Directorio
bar( 123, 338, 377, 352 );
// *** Nombre Imagen
bar( 123, 358, 175, 372 );
// *** Directorio
bar( 123, 338, 377, 352 );
// *** Nombre Imagen
bar( 123, 358, 175, 372 );
break;
case -1:
// *** Los Borra -> TODOS
// C:\>del.
// Todos los archivos en el directorio
// seran eliminados. <20> Si / No ? S
// C:\>_
// ** Nombre
bar( 8, 98 + (CurrRowCD_in-1) * 12, 169, 98 + ( CurrRowCD_in - 1 ) * 12 + 10);
// ** Nombre Install
bar( 175, 98 + (CurrRowCD_in-1) * 12, 227, 98 + ( CurrRowCD_in - 1 ) * 12 + 10);
// ** Nombre Exe
bar( 233, 98 + (CurrRowCD_in-1) * 12, 285, 98 + ( CurrRowCD_in - 1 ) * 12 + 10);
// ** Instalable
bar( 291, 98 + (CurrRowCD_in-1) * 12, 315, 98 + ( CurrRowCD_in - 1 ) * 12 + 10);
// ** Ejecutable
bar( 321, 98 + (CurrRowCD_in-1) * 12, 347, 98 + ( CurrRowCD_in - 1 ) * 12 + 10);
// ** Imagen
bar( 353, 98 + (CurrRowCD_in-1) * 12, 377, 98 + ( CurrRowCD_in - 1 ) * 12 + 10 );
// *** Directorio
bar( 123, 338, 377, 352 );
// *** Nombre Imagen
bar( 123, 358, 175, 372 );
break;
case 1:
// ** Nombre
bar( 8, 98 + (CurrRowCD_in-1) * 12, 169, 98 + ( CurrRowCD_in - 1 ) * 12 + 10);
break;
case 2:
// ** Nombre Install
bar( 175, 98 + (CurrRowCD_in-1) * 12, 227, 98 + ( CurrRowCD_in - 1 ) * 12 + 10);
break;
case 3:
// ** Nombre Exe
bar( 233, 98 + (CurrRowCD_in-1) * 12, 285, 98 + ( CurrRowCD_in - 1 ) * 12 + 10);
break;
case 4:
// ** Instalable
bar( 291, 98 + (CurrRowCD_in-1) * 12, 315, 98 + ( CurrRowCD_in - 1 ) * 12 + 10);
break;
case 5:
// ** Ejecutable
bar( 321, 98 + (CurrRowCD_in-1) * 12, 347, 98 + ( CurrRowCD_in - 1 ) * 12 + 10);
break;
case 6:
// ** Imagen
bar( 353, 98 + (CurrRowCD_in-1) * 12, 377, 98 + ( CurrRowCD_in - 1 ) * 12 + 10 );
break;
case 7:
// *** Directorio
bar( 123, 338, 377, 352 );
break;
case 8:
// *** Nombre Imagen
bar( 123, 358, 175, 372 );
break;
default:
break;
}
}
int InputCadenaG_T4(char *s, int numalp, int lmax, int cc, int cf, int X0, int Y0/*, int X1, int Y1*/, int RoW)
{
int ls; // longitud cadena
char *s1; // puntero a cadena inicial
int c, ok;
s1 = s; // inicio cadena
setcolor(cf); // pone color a 0 para borrar
setfillstyle(SOLID_FILL, cf);
Borra_Campo_Visual(CurrColCD_in);
setcolor(cc); // devuelve el color a su estado
outtextxy( X0, Y0+RoW*12, s );
ls = strlen ( s ); // Longitud de actual
if ( ls < lmax ) {
setcolor(250);
outtextxy( X0+textwidth( s1 ), Y0+RoW*12, "<EFBFBD>");
}
s += ls; // se coloca en el final
do{
c = getch(); // obtiene tecla
ok = ( c == 13 || c == 0); // 13 = INTRO || Especiales
if ( c == 8 && ls > 0 && !ok ) { // 8 = Back Space
ls--;
s--;
*s = '\0';
setcolor(cf);
setfillstyle(SOLID_FILL, cf);
Borra_Campo_Visual(CurrColCD_in);
//bar(X0, Y0+RoW*12+/*2*/4, X1-2, Y0+4+RoW*12 + 10);
setcolor(cc);
outtextxy( X0, Y0+RoW*12, s1 );
setcolor(4);
outtextxy( X0+textwidth( s1 ), Y0+RoW*12, "<EFBFBD>");
setcolor(cc);
} else {
if ( !numalp && c >= 32 && c <= 254 /* isprint(c) */ && ls < lmax) {
*s++ = c;
ls++;
*s = '\0';
setcolor(cf);
setfillstyle(SOLID_FILL, cf);
Borra_Campo_Visual(CurrColCD_in);
//bar(X0, Y0+RoW*12+/*2*/4, X1-2, Y0+4+RoW*12 + 10);
setcolor(cc);
outtextxy( X0, Y0+RoW*12, s1 );
if ( ls < lmax ) {
setcolor(4);
outtextxy( X0+textwidth( s1 ), Y0+RoW*12, "<EFBFBD>");
setcolor(cc);
}
} else {
if ( numalp && isdigit(c) && ls < lmax) {
*s++ = c;
ls++;
*s = '\0'; // Cero final
setcolor(cf);
setfillstyle(SOLID_FILL, cf);
Borra_Campo_Visual(CurrColCD_in);
//bar(X0, Y0+RoW*12+4, X1-2, Y0+4+RoW*12 + 10);
setcolor(cc);
outtextxy( X0, Y0+RoW*12, s1 );
if ( ls < lmax ) {
setcolor(4);
outtextxy( X0+textwidth( s1 ), Y0+RoW*12, "<EFBFBD>");
setcolor(cc);
}
}
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
else if( c == 27 ) {*s='\0'; ok = 1; }
/*<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>*/
else BEEP();
}
}
}while(!ok);
ok = 1;
*s = ' ';
while( ok ) {
if(*s==' ') { *s = '\0'; s--;
} else { s++; ok = 0; }
}
*s = '\0';
while(kbhit()) getch(); // Vacia Buffer impidiendo falsas
// pulsaciones...
return ls;
}
void BEEP(void){
sound(440);
delay(50);
nosound();
}
void Inicializa_Apertura(void) {
CurrTopLineCD_in = 1;
CurrRowCD_in = 1;
CurrColCD_in = 1;
Abre_Ficha_CD_in();
PrintWholeScreenCD_in();
GetLineCD_in();
EditCursorCD_in(0);
}
void Muestra_Informacion(void){
char Buffer[80];
setcolor(240);
setfillstyle(SOLID_FILL, 240);
bar( 13, 388, 182, 434 );
setcolor(255);
sprintf( Buffer, "Modulo:" );
switch ( Item_select ) {
case 1: strcat( Buffer, " Juegos" ); break;
case 2: strcat( Buffer, " P.Texto" ); break;
case 3: strcat( Buffer, " M<>sica" ); break;
case 4: strcat( Buffer, " Dibujo" ); break;
case 5: strcat( Buffer, " Utild." ); break;
case 6: strcat( Buffer, " Base D" ); break;
case 7: strcat( Buffer, " Hoja C" ); break;
case 8: strcat( Buffer, " Red" ); break;
case 9: strcat( Buffer, " Lenguaj" ); break;
case 10:strcat( Buffer, " Scanner" ); break;
case 11:strcat( Buffer, " News" ); break;
case 12:strcat( Buffer, " Compr" ); break;
case 13:strcat( Buffer, " Videos" ); break;
case 14:strcat( Buffer, " Varios" ); break;
case 15:strcat( Buffer, " CD's" ); break;
default: strcat( Buffer, "ERROR" ); break;
}
strcat( Buffer, ( (Items_for==DOS) ? ", DOS" : ", WINDOWS") );
outtextxy( 15, 390, Buffer);
sprintf( Buffer, "Linea %02d. Reg %d / %d", CurrRowCD_in, (CurrRowCD_in+CurrTopLineCD_in-1), (CD_cabecera.Records + 1) );
outtextxy( 15, 400, Buffer);
}
/////// EDITAR COMENTARIO....
int Editar_Comentario(void)
{
int ls; // longitud cadena
char *s1, *s, *s_tmp, *s_tmp1; // puntero a cadena inicial
int key, ok, Linea = 0, Columna = 0, X, Y, lmax;
char Buffer[80];
X = 395; Y = 105; lmax = 35;
ok = 0;
s_tmp1 = s_tmp = s = s1 = CD_in1.Comentario[0]; // inicio cadena
s += lmax ; *s = '\0';
s = s_tmp;
do {
setcolor(250); // pone color a 0 para borrar
setfillstyle(SOLID_FILL, 250); // selecciona los atributos de
bar( X, Y+Linea*11, X + 230, Y+Linea*11 + 11); // relleno, y Borra el campo
setcolor(255); // devuelve el color a su estado
outtextxy( X, Y+Linea*11, s1 ); // e imprime la cadena.
// ls = strlen ( s ); // Longitud de la cadena actual
if ( Columna < lmax ) { // Muestra cursor si es posible
setcolor(251);
strncpy( Buffer, s1, Columna );
Buffer[Columna] = '\0';
outtextxy( X + textwidth( Buffer ), Y+Linea*11+2, "<EFBFBD>");
}
switch ( ( key = getch() ) ) { // obtiene tecla
// Intro o Return
case 13:
if( Linea < 31 ) {
setcolor(240); // pone color a 0 para borrar
setfillstyle(SOLID_FILL, 240); // selecciona los atributos de
bar( X, Y+Linea*11, X + 230, Y+Linea*11 + 11); // relleno, y Borra el campo
setcolor(255); // devuelve el color a su estado
outtextxy( X, Y+Linea*11, s1 ); // e imprime la cadena.
Linea++;
s_tmp1 = s_tmp = s = s1 = CD_in1.Comentario[Linea]; // inicio cadena
s += lmax; *s = '\0';
Columna = 0;
s = s_tmp1 = s_tmp = s1;
}
break;
case 0:
switch ( key = getch() ) {
// F. Arriba
case 72:
if( Linea > 0 ) {
setcolor(240); // pone color a 0 para borrar
setfillstyle(SOLID_FILL, 240); // selecciona los atributos de
bar( X, Y+Linea*11, X + 230, Y+Linea*11 + 11); // relleno, y Borra el campo
setcolor(255); // devuelve el color a su estado
outtextxy( X, Y+Linea*11, s1 ); // e imprime la cadena.
Linea--;
s_tmp1 = s_tmp = s = s1 = CD_in1.Comentario[Linea]; // inicio cadena
s += lmax; *s = '\0';
if ( Columna < strlen( s1 ) ) s_tmp += Columna; else { Columna = 0;
s_tmp = s1; }
s = s_tmp1 = s_tmp;
}
break;
// F. Abajo
case 80:
if( Linea < 31 ) {
setcolor(240); // pone color a 0 para borrar
setfillstyle(SOLID_FILL, 240); // selecciona los atributos de
bar( X, Y+Linea*11, X + 230, Y+Linea*11 + 11); // relleno, y Borra el campo
setcolor(255); // devuelve el color a su estado
outtextxy( X, Y+Linea*11, s1 ); // e imprime la cadena.
Linea++;
s_tmp1 = s_tmp = s = s1 = CD_in1.Comentario[Linea]; // inicio cadena
s += lmax; *s = '\0';
if ( Columna < strlen( s1 ) ) s_tmp += Columna; else { Columna = 0;
s_tmp = s1; }
s = s_tmp1 = s_tmp;
}
break;
// F. Derecha
case 77:
case 9:
if ( Columna < strlen(s1) ) { Columna++; s++; }
break;
// F. Izquierda
case 75:
case 15:
if ( Columna > 0) { Columna--; s--; }
break;
default:
BEEP();
}
break;
// Back Space
case 8:
if ( Columna > 0 ) {
Columna--;
s--;
s_tmp1 = s_tmp = s;
while ( *s_tmp1 != NULL ) {
s_tmp1++;
*s_tmp = *s_tmp1;
s_tmp++;
}
}
break;
case 27:
ok = 1;
break;
default:
if ( key >= 32 && key <= 254 && Columna < lmax) {
*s++ = key;
Columna++;
}
else BEEP();
break;
}
}while(!ok);
while(kbhit()) getch(); // Vacia Buffer impidiendo falsas
// pulsaciones...
setcolor(240); // pone color a 0 para borrar
setfillstyle(SOLID_FILL, 240); // selecciona los atributos de
bar( X, Y+Linea*11, X + 230, Y+Linea*11 + 11); // relleno, y Borra el campo
setcolor(255); // devuelve el color a su estado
outtextxy( X, Y+Linea*11, s1 ); // e imprime la cadena.
PutLineCD_in();
GetLineCD_in();
return /* de momento nada */ 0;
}
void Muestra_Comentario(void){
int X, Y;
X = 395; Y = 105;
setcolor(240); // pone color a 0 para borrar
setfillstyle(SOLID_FILL, 240); // selecciona los atributos de
for(int Linea=0; Linea<32; Linea++ ){
bar( X, Y+Linea*11, X + 230, Y+Linea*11 + 11); // relleno, y Borra el campo
setcolor(255); // devuelve el color a su estado
outtextxy( X, Y+Linea*11, CD_in1.Comentario[Linea] ); // e imprime la cadena.
}
}