Backup proyecto Joyfe - Borland
This commit is contained in:
36
CPP/VENTANA.CPP
Normal file
36
CPP/VENTANA.CPP
Normal file
@ -0,0 +1,36 @@
|
||||
#include<stdio.h>
|
||||
#include<conio.h>
|
||||
|
||||
char ventana (int ancho,int largo,int color_g,int color_borde,char titulo,
|
||||
int color_titulo,int posx,int posy);
|
||||
|
||||
void main() {
|
||||
clrscr();
|
||||
ventana(40,10,7,1,'P',14,30,7);
|
||||
fflush(stdin);
|
||||
getch();
|
||||
}
|
||||
|
||||
// Funci<63>n ventana.
|
||||
char ventana (int ancho,int largo,int color_g,int color_borde,char titulo,
|
||||
int color_titulo,int posx,int posy) {
|
||||
int x,y,cony,conx;
|
||||
char dib;
|
||||
dib='<EFBFBD>';
|
||||
for (cony=0,y=posy;cony<largo;cony++,y++){
|
||||
for (conx=0,x=posx;conx<ancho;conx++,x++) {
|
||||
gotoxy(x,y);
|
||||
if (x==posx || y==posy || y==(posy+(largo-1)) || x==(posx+1)
|
||||
|| x==(posx+(ancho-2)) || x==(posx+(ancho-1)))
|
||||
textcolor(color_borde);
|
||||
else
|
||||
textcolor(color_g);
|
||||
cprintf ("%c",dib);
|
||||
}
|
||||
}
|
||||
gotoxy((posx+2),posy);
|
||||
textcolor(color_titulo);
|
||||
textbackground(color_borde);
|
||||
cprintf("%c",titulo);
|
||||
return(0);
|
||||
}
|
||||
Reference in New Issue
Block a user