//--------------------------------------------------------------------------- #include #pragma hdrstop #include "Unit1.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma resource "*.dfm" TForm1 *Form1; //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TForm1::FormActivate(TObject *Sender) { Edit1->SetFocus(); } //--------------------------------------------------------------------------- void __fastcall TForm1::Button2Click(TObject *Sender) { Edit1->Clear(); StaticText1->Caption = ""; StaticText2->Caption = ""; StaticText3->Caption = "0"; Button1->Enabled = false; } //--------------------------------------------------------------------------- void __fastcall TForm1::Button1Click(TObject *Sender) { if(StaticText3->Caption == "0") { plot = (StrToFloat(Edit1->Text) * StrToFloat(Edit1->Text)) * M_PI; ilg = 2 * M_PI * StrToFloat(Edit1->Text); StaticText1->Caption = FloatToStrF(plot,ffFixed,8,2); StaticText2->Caption = FloatToStrF(ilg,ffFixed,8,2); StaticText3->Caption = '1'; } else { ShowMessage("Yveskite apskritimo spinduli"); StaticText1->Caption = ""; StaticText2->Caption = ""; StaticText3->Caption = "0"; Edit1->Clear(); Button1->Enabled = false; } } //--------------------------------------------------------------------------- void __fastcall TForm1::Edit1Change(TObject *Sender) { Button1->Enabled = true; } //---------------------------------------------------------------------------