Скачиваний:
19
Добавлен:
01.05.2014
Размер:
1.39 Кб
Скачать
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "PointCoords.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TfrmPointCoords *frmPointCoords;
//---------------------------------------------------------------------------
__fastcall TfrmPointCoords::TfrmPointCoords(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TfrmPointCoords::edtXChange(TObject *Sender)
{
	TEdit *edt = dynamic_cast<TEdit*>(Sender);
	try {
    	x = StrToInt(edt->Text);
        if (x<1) throw Exception("ERROR");
    }
    catch(...) {
		edt->Text = x;
    }
}
//---------------------------------------------------------------------------
void __fastcall TfrmPointCoords::edtYChange(TObject *Sender)
{
	TEdit *edt = dynamic_cast<TEdit*>(Sender);
	try {
    	y = StrToInt(edt->Text);
        if (y<1) throw Exception("ERROR");
    }
    catch(...) {
		edt->Text = y;
    }
}
//---------------------------------------------------------------------------
void __fastcall TfrmPointCoords::FormCreate(TObject *Sender)
{
	edtX->Text = x;
	edtY->Text = y;
}
//---------------------------------------------------------------------------

Соседние файлы в папке Sources