Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Геометрический поиск метод локусов / Sources / PointCoords
.cpp//---------------------------------------------------------------------------
#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