25 lines
558 B
C++
25 lines
558 B
C++
#include <vcl.h>
|
|
#pragma hdrstop
|
|
|
|
#include "RectangleFigure.h"
|
|
|
|
#pragma package(smart_init)
|
|
|
|
TRectangleFigure::TRectangleFigure(int aNum) : TFigure(aNum)
|
|
{
|
|
}
|
|
|
|
void TRectangleFigure::Draw(TCanvas *c)
|
|
{
|
|
SetupCanvas(c);
|
|
c->Rectangle(x, y, x + w, y + h);
|
|
PaintNumber(c);
|
|
}
|
|
|
|
bool TRectangleFigure::Contains(int px, int py)
|
|
{
|
|
return (px >= x) && (px <= x + w) && (py >= y) && (py <= y + h);
|
|
}
|
|
|
|
String TRectangleFigure::TypeName() { return "rectangle"; }
|
|
String TRectangleFigure::RusName() { return L"Прямоугольник"; }
|