Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

LAB3 / Unit1

.h
Скачиваний:
5
Добавлен:
01.02.2019
Размер:
1.84 Кб
Скачать
//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class Point2D {
public:
	int x;
	int y;
	Point2D* next;
	Point2D() {
		x = 0;
		y = 0;
		next = NULL;
	}
	Point2D(int __x, int __y) {
		x = __x;
		y = __y;
		next = NULL;
    }
	void Draw();
};

class Figure {
public:
	Point2D* firstPoint;
	Point2D* lastPoint;
	bool created;
	bool startCreate;
	Figure(): firstPoint(NULL), lastPoint(NULL), created(FALSE), startCreate(FALSE) {}
	bool IsCreated();
	bool IsStartCreate();
	void AddPoint(Point2D*);
	void Clear();
	void Draw();
};

class TForm1 : public TForm
{
__published:	// IDE-managed Components
	TPaintBox *PaintBox1;
	TButton *Button1;
	TButton *Fill;
	TComboBox *ComboBox1;
	void __fastcall PaintBox1Paint(TObject *Sender);
	void __fastcall PaintBox1MouseMove(TObject *Sender, TShiftState Shift, int X, int Y);
	void __fastcall PaintBox1MouseUp(TObject *Sender, TMouseButton Button, TShiftState Shift,
          int X, int Y);
	void __fastcall Button1Click(TObject *Sender);
	void __fastcall FillClick(TObject *Sender);

private:	// User declarations
public:		// User declarations
	__fastcall TForm1(TComponent* Owner);
	void createFigure();
	void Fil(int, int);
	bool StartFill;
	TColor currentColor;
	Figure f;
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif
Соседние файлы в папке LAB3