Скачиваний:
19
Добавлен:
01.05.2014
Размер:
3.9 Кб
Скачать
//----------------------------------------------------------------------------
#ifndef ChildWinH
#define ChildWinH
//----------------------------------------------------------------------------
#include <vcl\Controls.hpp>
#include <vcl\Forms.hpp>
#include <vcl\Graphics.hpp>
#include <vcl\Classes.hpp>
#include <vcl\Windows.hpp>
#include <vcl\System.hpp>
#include <StdCtrls.hpp>
#include <ExtCtrls.hpp>

#include "Unit1.h"
#include <Grids.hpp>
#include <ActnList.hpp>
#include <ImgList.hpp>
#include <Menus.hpp>
#include <ComCtrls.hpp>
#include <Dialogs.hpp>

#define POINT_R		4
#define POINT_A		6

//----------------------------------------------------------------------------
class TfrmMDIChild : public TForm
{
__published:
	TSplitter *Splitter1;
	TPanel *Panel2;
	TPanel *Panel3;
	TSplitter *Splitter2;
	TPanel *Panel4;
	TPanel *Panel5;
	TPanel *Panel6;
	TActionList *ActionList1;
	TAction *actDeletePoint;
	TAction *actInsertPoint;
	TMainMenu *MainMenu1;
	TAction *actMovePoint;
	TListView *ListView1;
	TListView *ListView2;
	TAction *actAlgStep;
	TAction *actAlgRun;
	TAction *actAlgStop;
	TScrollBox *ScrollBox1;
	TPanel *Panel1;
	TMenuItem *Screenshots1;
	TMenuItem *N14;
	TMenuItem *N15;
	TSaveDialog *SaveDialog1;
	TAction *actAlgStepPre;
	void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
	void __fastcall FormCreate(TObject *Sender);
	void __fastcall Panel1DblClick(TObject *Sender);
	void __fastcall Panel1MouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y);
	void __fastcall Panel1MouseMove(TObject *Sender, TShiftState Shift, int X, int Y);
	void __fastcall actDeletePointExecute(TObject *Sender);
	void __fastcall actDeletePointUpdate(TObject *Sender);
	void __fastcall actMovePointExecute(TObject *Sender);
	void __fastcall actInsertPointExecute(TObject *Sender);
	void __fastcall ListView1DblClick(TObject *Sender);
	void __fastcall actAlgRunUpdate(TObject *Sender);
	void __fastcall actAlgStepExecute(TObject *Sender);
	void __fastcall actAlgStopUpdate(TObject *Sender);
	void __fastcall actAlgStopExecute(TObject *Sender);
	void __fastcall actAlgRunExecute(TObject *Sender);
	void __fastcall actAlgStepUpdate(TObject *Sender);
	void __fastcall N14Click(TObject *Sender);
	void __fastcall N15Click(TObject *Sender);
	void __fastcall FormActivate(TObject *Sender);
	void __fastcall actAlgStepPreExecute(TObject *Sender);
	void __fastcall actAlgStepPreUpdate(TObject *Sender);
	void __fastcall ListView1Click(TObject *Sender);

private:
    HDC panelHDC, tempHDC;

    HBRUSH brushField, brushPoint, brushRect, brushLocus;
    HPEN penField, penLine, penPoint, penRect, penLocus;

    MyPoint activePoint;
    MyRect activeRect;
    TLocus currentLocus, locus1, locus2, locus3, locus4;

    void __fastcall paintPoint(HDC hDC, const TPoint& point, int isActivePoint = 0);
    void __fastcall paintLine( HDC hDC, const TPoint& point);
    void __fastcall paintField(HDC hdc, int isDrawLines = 1);
    void __fastcall paintLocus(const TLocus& locus);

    void __fastcall SubClassWndProc(Messages::TMessage &Message);
    TWndMethod oldWindowProc;

    int isNewRect;

   	void TraceFunc(const TLocus& locus);

    int isNextStep;

    AnsiString __fastcall LocusCoordsToStr(TLocus &locus);

    float fzoom;
    void setZoom(float zoom);
    float getZoom();

public:
	virtual __fastcall TfrmMDIChild(TComponent *Owner);

    TRegionalSearch pointList;
    MyPoint __fastcall addPoint(const TPoint& point);
    void __fastcall movePoint(const TPoint& point);

    void __fastcall setField();
    void __fastcall setOptions();

    int isDrawLines;
    int pWidth, pHeight;
    __property float zoom={read=getZoom, write=setZoom};
};
//----------------------------------------------------------------------------
#endif
Соседние файлы в папке Sources