Ventana::~Ventana() {
	if (Copia != NULL) {
		mouse.Esconder();
		putimage (X,Y,Copia,COPY_PUT);
		delete Copia;
		mouse.Mostrar();
	}
}
void EscribirMenu(MOUSE &mouse) {
   mouse.Esconder();
	clearviewport();
   mouse.LimVert (100,200);
	mouse.LimHoriz (50,100);
	for (int i=0; i < 5; i++)
		outtextxy (100, i * 10 + 50,Menu[i]);
	mouse.Mostrar();
}
void cinco(MOUSE &mouse) {
	int Boton,Vert,Horiz;
	mouse.LimVert (0,getmaxx() );
	mouse.LimHoriz (0,getmaxy() );
	mouse.Esconder();
	clearviewport();  outtext("cinco");
	mouse.Mostrar();
	mouse.LibBotones();
	while (  (Boton = mouse.Estado (&Vert, &Horiz) ) == 0 )
		;
	mouse.LibBotones();
}
void Ventana::DibujarVentana() {
	int i;
	mouse.Esconder();
	if (Buffer != 0) {
		i = imagesize (X, Y, X1, Y1);
		if (i == -1)  // Asi debe ser y no como en el programa de la
							// pagina 565. Favor corregir sobre el texto.
			Error("Imagen muy grande para almacenar");
		Copia = new int [i];
		if (Copia == NULL)
			Error("Memoria Insuficiente");
		getimage (X, Y, X1, Y1, Copia);
	}
	setcolor (WHITE);
	rectangle (X, Y, X1, Y1);
	setfillstyle (SOLID_FILL, LIGHTGRAY);
	bar (X+1, Y+1, X1-1, Y1-1);
	if (TieneBorde != 0) {
		// Implemente aqui el Tipo de Borde deseado
	}
	mouse.Mostrar();
}
int main()
{
	int unidad = DETECT, modo,boton,Horiz,Vert;
	char a[10],todo[30];
	MOUSE mouse;
	mouse.Inicializar();

	initgraph (&unidad,&modo,"c:\\bc\\bgi");
	if (graphresult() != 0) {
		cout << "Error al tratar de pasar al modo grafico\n";
		getch();
		return 1;
	}
	mouse.Mostrar();
	getch();

	boton = mouse.Estado (&Vert,&Horiz);
	itoa (Horiz,a,10);
	strcpy (todo,a);
	itoa (Vert,a,10);
	strcat (todo," ");
	strcat (todo,a);
	itoa (boton,a,10);
	strcat (todo," ");
	strcat (todo,a);
	mouse.Esconder();
	outtextxy (0,0,todo);
	mouse.Mostrar();

	getch();

	boton = mouse.Estado (&Vert,&Horiz);
	itoa (Horiz,a,10);
	strcpy (todo,a);
	itoa (Vert,a,10);
	strcat (todo," ");
	strcat (todo,a);
	itoa (boton,a,10);
	strcat (todo," ");
	strcat (todo,a);
	mouse.Esconder();
	outtextxy (0,10,todo);
	mouse.Mostrar();

	getch();

	boton = mouse.Estado (&Vert,&Horiz);
	itoa (Horiz,a,10);
	strcpy (todo,a);
	itoa (Vert,a,10);
	strcat (todo," ");
	strcat (todo,a);
	itoa (boton,a,10);
	strcat (todo," ");
	strcat (todo,a);
	mouse.Esconder();
	outtextxy (0,20,todo);
	mouse.Mostrar();
	getch();

	closegraph();
	return 0;
}