#pragma once
#include ".\Square.h"
namespace Figures
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
/// </summary>
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private: System::Windows::Forms::GroupBox * groupBox1;
private: System::Windows::Forms::Label * label1;
private: System::Windows::Forms::Label * label2;
private: System::Windows::Forms::Label * label3;
private: System::Windows::Forms::TextBox * txtSide;
private: System::Windows::Forms::TextBox * txtPerimeter;
private: System::Windows::Forms::TextBox * txtArea;
private: System::Windows::Forms::Button * btnCalculate;
private: System::Windows::Forms::Button * btnClose;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container * components;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->groupBox1 = new System::Windows::Forms::GroupBox();
this->label1 = new System::Windows::Forms::Label();
this->label2 = new System::Windows::Forms::Label();
this->label3 = new System::Windows::Forms::Label();
this->txtSide = new System::Windows::Forms::TextBox();
this->txtPerimeter = new System::Windows::Forms::TextBox();
this->txtArea = new System::Windows::Forms::TextBox();
this->btnCalculate = new System::Windows::Forms::Button();
this->btnClose = new System::Windows::Forms::Button();
this->groupBox1->SuspendLayout();
this->SuspendLayout();
//
// groupBox1
//
this->groupBox1->Controls->Add(this->btnClose);
this->groupBox1->Controls->Add(this->btnCalculate);
this->groupBox1->Controls->Add(this->txtArea);
this->groupBox1->Controls->Add(this->txtPerimeter);
this->groupBox1->Controls->Add(this->txtSide);
this->groupBox1->Controls->Add(this->label3);
this->groupBox1->Controls->Add(this->label2);
this->groupBox1->Controls->Add(this->label1);
this->groupBox1->Location = System::Drawing::Point(16, 16);
this->groupBox1->Name = S"groupBox1";
this->groupBox1->Size = System::Drawing::Size(280, 136);
this->groupBox1->TabIndex = 0;
this->groupBox1->TabStop = false;
this->groupBox1->Text = S"Square Processing";
//
// label1
//
this->label1->Location = System::Drawing::Point(16, 32);
this->label1->Name = S"label1";
this->label1->Size = System::Drawing::Size(80, 23);
this->label1->TabIndex = 0;
this->label1->Text = S"Side:";
//
// label2
//
this->label2->Location = System::Drawing::Point(16, 64);
this->label2->Name = S"label2";
this->label2->Size = System::Drawing::Size(80, 23);
this->label2->TabIndex = 1;
this->label2->Text = S"Perimeter:";
//
// label3
//
this->label3->Location = System::Drawing::Point(16, 96);
this->label3->Name = S"label3";
this->label3->Size = System::Drawing::Size(80, 23);
this->label3->TabIndex = 2;
this->label3->Text = S"Area:";
//
// txtSide
//
this->txtSide->Location = System::Drawing::Point(96, 32);
this->txtSide->Name = S"txtSide";
this->txtSide->Size = System::Drawing::Size(80, 20);
this->txtSide->TabIndex = 3;
this->txtSide->Text = S"0.00";
this->txtSide->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
//
// txtPerimeter
//
this->txtPerimeter->Location = System::Drawing::Point(96, 64);
this->txtPerimeter->Name = S"txtPerimeter";
this->txtPerimeter->Size = System::Drawing::Size(80, 20);
this->txtPerimeter->TabIndex = 4;
this->txtPerimeter->Text = S"0.00";
this->txtPerimeter->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
//
// txtArea
//
this->txtArea->Location = System::Drawing::Point(96, 96);
this->txtArea->Name = S"txtArea";
this->txtArea->Size = System::Drawing::Size(80, 20);
this->txtArea->TabIndex = 5;
this->txtArea->Text = S"0.00";
this->txtArea->TextAlign = System::Windows::Forms::HorizontalAlignment::Right;
//
// btnCalculate
//
this->btnCalculate->Location = System::Drawing::Point(184, 32);
this->btnCalculate->Name = S"btnCalculate";
this->btnCalculate->TabIndex = 6;
this->btnCalculate->Text = S"Calculate";
this->btnCalculate->Click += new System::EventHandler(this, btnCalculate_Click);
//
// btnClose
//
this->btnClose->Location = System::Drawing::Point(184, 96);
this->btnClose->Name = S"btnClose";
this->btnClose->TabIndex = 7;
this->btnClose->Text = S"Close";
//
// Form1
//
this->AutoScaleBaseSize = System::Drawing::Size(5, 13);
this->ClientSize = System::Drawing::Size(314, 168);
this->Controls->Add(this->groupBox1);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedDialog;
this->MaximizeBox = false;
this->MinimizeBox = false;
this->Name = S"Form1";
this->Text = S"Interfaces";
this->groupBox1->ResumeLayout(false);
this->ResumeLayout(false);
}
private: System::Void btnCalculate_Click(System::Object * sender, System::EventArgs * e)
{
CSquare __gc *Sqr = __gc new CSquare;
double s = this->txtSide->Text->ToDouble(0);
Sqr->setSide(s);
double Perim = Sqr->Perimeter();
double Ar = Sqr->Area();
this->txtPerimeter->Text = Perim.ToString();
this->txtArea->Text = Ar.ToString();
}
private: System::Void btnClose_Click(System::Object * sender, System::EventArgs * e)
{
Close();
}
};
}
|