Programacion

Solo disponible en BuenasTareas
  • Páginas : 4 (877 palabras )
  • Descarga(s) : 0
  • Publicado : 8 de noviembre de 2011
Leer documento completo
Vista previa del texto
//Circulo.h
#pragma once

class CCirculo
{
private:
int posX;
int posY;
int desplX;
int desplY;
int color;
int radio;
int numero;

public:
CCirculo(int posX,int posY,intdesplX,int desplY,int color,int radio,int numero);
~CCirculo(void);

void Dibujar_Circulo(System::Drawing::Graphics ^canvas);
void Mover_Circulo(System::Drawing::Graphics ^canvas);
voidBorrar_Circulo(System::Drawing::Graphics ^canvas);
};

//Circulo.cpp
#include "StdAfx.h"
#include "Circulo.h"

CCirculo::CCirculo(int x,int y,int dx,int dy,int col,int rad,int num)
{
this->posX = x;this->posY = y;
this->desplX = dx;
this->desplY = dy;
this->color = col;
this->radio = rad;
this->numero = num;
}

CCirculo::~CCirculo(void){}

voidCCirculo::Dibujar_Circulo(System::Drawing::Graphics ^canvas)
{
System::Drawing::Color colorcito = System::Drawing::ColorTranslator::FromWin32(color);
System::Drawing::SolidBrush ^miBrochita = gcnewSystem::Drawing::SolidBrush(colorcito);

canvas->FillEllipse(System::Drawing::Brushes::Blue,posX-radio,posY-radio,radio*2,radio*2);
canvas->DrawEllipse(System::Drawing::Pens::Red,posX-radio,posY-radio,radio*2,radio*2);System::Drawing::Font ^miFuente = gcnew System::Drawing::Font("Arial Blue",posY-(posY-radio));
canvas->DrawString(numero.ToString(),miFuente,System::Drawing::Brushes::Black,posX-radio,posY-radio);
}void CCirculo::Borrar_Circulo(System::Drawing::Graphics ^canvas){}
void CCirculo::Mover_Circulo(System::Drawing::Graphics ^canvas)
{
if( (posX + radio + desplX >= canvas->VisibleClipBounds.Width)|| (posX - radio + desplX = canvas->VisibleClipBounds.Height) || (posY - radio + desplY Dibujar_Circulo(canvas);
}
//Cuadrado.h
#pragma once

class CCuadrado
{
private:
int posX;
int posY;int desplX;
int desplY;
int desplO;
int color;
int Lado;
int numero;

public:
CCuadrado(int posX,int posY,int desplX,int desplY,int color,int Lado,int numero);
~CCuadrado(void);...
tracking img