Backup proyecto Joyfe - Borland
This commit is contained in:
149
CPP/WIN.CPP
Normal file
149
CPP/WIN.CPP
Normal file
@ -0,0 +1,149 @@
|
||||
#include <graphics.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <conio.h>
|
||||
#include <dos.h>
|
||||
|
||||
#define seleccionado color_numero=color_menu=9;settextstyle(7,0,4);
|
||||
#define no_seleccionado color_numero=3;color_menu=8;settextstyle(8,0,3);
|
||||
|
||||
void ventana(int x1, int y1, int x2, int y2, char titulo[80]);
|
||||
void boton(int x1, int y1, int x2, int y2,int, char titulo[80]);
|
||||
void main(){
|
||||
|
||||
int gdriver = DETECT, gmode, errorcode;
|
||||
initgraph(&gdriver, &gmode, "d:\\tc\\bgi");
|
||||
errorcode = graphresult();
|
||||
if (errorcode != grOk){
|
||||
printf("Error al iniciar el modo gr<67>fico: %s\n",
|
||||
grapherrormsg(errorcode));
|
||||
printf("Pulse cualquier tecla1 para finalizar...");
|
||||
getch();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int midx, midy, i;
|
||||
midx = getmaxx() / 2;
|
||||
midy = getmaxy() / 2;
|
||||
|
||||
/* loop through the fill patterns */
|
||||
// for (i=0; i<12; i++)
|
||||
// {
|
||||
/* set the fill style */
|
||||
setfillstyle(1,1);bar(1,1,getmaxx(),getmaxy());
|
||||
|
||||
setcolor(8);
|
||||
bar3d(midx-153, midy-148, midx+153, midy+153, 0, 1);
|
||||
|
||||
setcolor(7);
|
||||
bar3d(midx-152, midy-147, midx+152, midy+152, 0, 1);
|
||||
|
||||
setcolor(16);
|
||||
bar3d(midx-151, midy-146, midx+151, midy+151, 0, 1);
|
||||
setfillstyle(1,9);
|
||||
bar3d(midx-150, midy-145, midx+150, midy+150, 0, 1);
|
||||
|
||||
setfillstyle(1, 1);
|
||||
bar3d(midx-150, midy-145, midx+150, midy-120, 0, 1);
|
||||
|
||||
settextstyle(2,0,5);
|
||||
setcolor(15);outtextxy(midx-140,midy-140,"Ooohh.. It`s Fun !!");
|
||||
|
||||
getch();
|
||||
setfillstyle(1,1);bar(1,1,getmaxx(),getmaxy());
|
||||
ventana(midx-150,midy-150,midx+150,midy+150,"Microsoft Word _OX");
|
||||
|
||||
boton(midx-15,midy-15,midx+60,midy+10,0,"Acepta?");
|
||||
// }
|
||||
getch();
|
||||
boton(midx-15,midy-15,midx+60,midy+10,1,"Acepta?");delay(305);
|
||||
int o=1;
|
||||
for ( o; o<200;o+=5){
|
||||
|
||||
ventana(midx-o,midy-o,midx+o,midy+o,"Se Sale...");
|
||||
// setfillstyle(1,1);bar(midx-o,midy-o,midx+o,midy+o);
|
||||
}
|
||||
ventana(midx-o,midy-o,midx+o,midy+o,"Se Sale...");
|
||||
getch();
|
||||
|
||||
/* int x1=midx-o+3, y1=midy-o+3, x2=midx+o-4, y2=midy-o+20;
|
||||
bar(x1,y1,x2,y2);
|
||||
for (int k=0; y1<getmaxy() && x2>(x1+10);k+=10){
|
||||
bar(x1,y1+k,x2,y2+20);
|
||||
|
||||
} */
|
||||
getch();
|
||||
closegraph();
|
||||
}
|
||||
|
||||
|
||||
void ventana(int x1, int y1, int x2, int y2,char titulo[]){
|
||||
// ventana normal -----------------------------------------------
|
||||
|
||||
setcolor(7); rectangle(x1,y1,x2,y2); // cuadro gris claro
|
||||
|
||||
setcolor(16);
|
||||
|
||||
line(x1,y2,x2,y2); // linea negra -- abajo
|
||||
line(x2,y2,x2,y1); // linea negra | derecha
|
||||
|
||||
|
||||
setcolor(15); rectangle(x1+1,y1+1,x2-1,y2-1); //cuadro blanco dentro
|
||||
|
||||
setcolor(8);
|
||||
|
||||
line(x1+1,y2-1,x2-1,y2-1); // gris -- abajo
|
||||
line(x2-1,y1+1,x2-1,y2-1); // gris | derecha
|
||||
|
||||
setfillstyle(1,7);
|
||||
bar(x1+2,y1+2,x2-2,y2-2);// interior gris de la ventana
|
||||
|
||||
setfillstyle(1,1);
|
||||
bar(x1+3,y1+3,x2-4,y1+20);// fondo azul del titulo
|
||||
|
||||
setcolor(15);
|
||||
outtextxy(x1+10,y1+4,titulo);
|
||||
//--------------------------------------------------------------
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
// FUNCI<43>N BOTON
|
||||
// --------------------------------------------------------------------
|
||||
|
||||
void boton(int x1,int y1, int x2,int y2,int pulsado,char titulo[]) {
|
||||
|
||||
setcolor(7); rectangle(x1,y1,x2,y2); // cuadro gris claro
|
||||
|
||||
if (pulsado)
|
||||
{
|
||||
setcolor(16);
|
||||
line(x1, y1, x2, y1); // linea negra -- arriba
|
||||
line(x1, y2, x1, y1); // linea negra | izquierda
|
||||
|
||||
setcolor(15);
|
||||
rectangle(x1+1,y1+1,x2-1,y2-1); //cuadro blanco dentro
|
||||
|
||||
setcolor(8);
|
||||
line(x1+1, y1+1, x2-1, y1+1); // gris -- arriba
|
||||
line(x1+1, y1+1, x1+1, y2-1); // gris | izquierda
|
||||
}
|
||||
else {
|
||||
setcolor(16);
|
||||
line(x1, y2, x2, y2); // linea negra -- abajo
|
||||
line(x2, y2, x2, y1); // linea negra | derecha
|
||||
|
||||
setcolor(15);
|
||||
rectangle(x1+1, y1+1, x2-1, y2-1); //cuadro blanco dentro
|
||||
|
||||
setcolor(8);
|
||||
line(x1+1, y2-1, x2-1, y2-1); // gris -- abajo
|
||||
line(x2-1, y1+1, x2-1, y2-1); // gris | derecha
|
||||
}
|
||||
setfillstyle(1,7);
|
||||
bar(x1+2, y1+2, x2-2, y2-2);// interior gris de la ventana
|
||||
outtextxy(x1+10,y1+4,titulo);
|
||||
|
||||
} // FIN DE LA FUNCI<43>N ----------------------------------------------------
|
||||
Reference in New Issue
Block a user