#pragma once
namespace stvorec2
{
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 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.
///
public __gc class Form1 : public System::Windows::Forms::Form
{
public:
Graphics __gc *grafika;
Pen __gc *Pero1;
PointF stvorec[];
Form1(void)
{
InitializeComponent();
grafika = pictureBox1->CreateGraphics();
Pero1 = new Pen(Color::Black);
stvorec=new PointF[4];
stvorec[0]=PointF((float)textBox1->Text->ToDouble(0),(float)textBox2->Text->ToDouble(0));
stvorec[1]=PointF((float)textBox3->Text->ToDouble(0),(float)textBox4->Text->ToDouble(0));
stvorec[2]=PointF((float)textBox5->Text->ToDouble(0),(float)textBox6->Text->ToDouble(0));
stvorec[3]=PointF((float)textBox7->Text->ToDouble(0),(float)textBox8->Text->ToDouble(0));
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private: System::Windows::Forms::GroupBox * groupBox3;
private: System::Windows::Forms::GroupBox * groupBox4;
private: System::Windows::Forms::Button * button7;
private: System::Windows::Forms::Button * button8;
private: System::Windows::Forms::TextBox * textBox10;
private: System::Windows::Forms::PictureBox * pictureBox1;
private: System::Windows::Forms::Button * button1;
private: System::Windows::Forms::TextBox * textBox1;
private: System::Windows::Forms::TextBox * textBox2;
private: System::Windows::Forms::TextBox * textBox3;
private: System::Windows::Forms::TextBox * textBox4;
private: System::Windows::Forms::TextBox * textBox5;
private: System::Windows::Forms::TextBox * textBox6;
private: System::Windows::Forms::TextBox * textBox7;
private: System::Windows::Forms::TextBox * textBox8;
private: System::Windows::Forms::GroupBox * groupBox1;
private: System::Windows::Forms::Button * button2;
private: System::Windows::Forms::Button * button4;
private: System::Windows::Forms::Button * button5;
private: System::Windows::Forms::Button * button6;
private: System::Windows::Forms::GroupBox * groupBox2;
private: System::Windows::Forms::TextBox * textBox9;
private: System::Windows::Forms::Button * button3;
private:
///
/// Required designer variable.
///
System::ComponentModel::Container * components;
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
{
this->pictureBox1 = new System::Windows::Forms::PictureBox();
this->button1 = new System::Windows::Forms::Button();
this->textBox1 = new System::Windows::Forms::TextBox();
this->textBox2 = new System::Windows::Forms::TextBox();
this->textBox3 = new System::Windows::Forms::TextBox();
this->textBox4 = new System::Windows::Forms::TextBox();
this->textBox5 = new System::Windows::Forms::TextBox();
this->textBox6 = new System::Windows::Forms::TextBox();
this->textBox7 = new System::Windows::Forms::TextBox();
this->textBox8 = new System::Windows::Forms::TextBox();
this->groupBox1 = new System::Windows::Forms::GroupBox();
this->button2 = new System::Windows::Forms::Button();
this->button4 = new System::Windows::Forms::Button();
this->button5 = new System::Windows::Forms::Button();
this->button6 = new System::Windows::Forms::Button();
this->groupBox2 = new System::Windows::Forms::GroupBox();
this->groupBox3 = new System::Windows::Forms::GroupBox();
this->button3 = new System::Windows::Forms::Button();
this->textBox9 = new System::Windows::Forms::TextBox();
this->groupBox4 = new System::Windows::Forms::GroupBox();
this->button8 = new System::Windows::Forms::Button();
this->button7 = new System::Windows::Forms::Button();
this->textBox10 = new System::Windows::Forms::TextBox();
this->groupBox2->SuspendLayout();
this->groupBox4->SuspendLayout();
this->SuspendLayout();
//
// pictureBox1
//
this->pictureBox1->BackColor = System::Drawing::SystemColors::Menu;
this->pictureBox1->BorderStyle = System::Windows::Forms::BorderStyle::FixedSingle;
this->pictureBox1->Location = System::Drawing::Point(16, 16);
this->pictureBox1->Name = S"pictureBox1";
this->pictureBox1->Size = System::Drawing::Size(480, 352);
this->pictureBox1->TabIndex = 0;
this->pictureBox1->TabStop = false;
this->pictureBox1->Click += new System::EventHandler(this, pictureBox1_Click);
//
// button1
//
this->button1->BackColor = System::Drawing::SystemColors::ActiveBorder;
this->button1->Location = System::Drawing::Point(528, 168);
this->button1->Name = S"button1";
this->button1->Size = System::Drawing::Size(160, 23);
this->button1->TabIndex = 1;
this->button1->Text = S"kresli";
this->button1->Click += new System::EventHandler(this, button1_Click);
//
// textBox1
//
this->textBox1->Location = System::Drawing::Point(528, 40);
this->textBox1->Name = S"textBox1";
this->textBox1->Size = System::Drawing::Size(72, 20);
this->textBox1->TabIndex = 2;
this->textBox1->Text = S"150";
this->textBox1->TextChanged += new System::EventHandler(this, textBox1_TextChanged);
//
// textBox2
//
this->textBox2->Location = System::Drawing::Point(616, 40);
this->textBox2->Name = S"textBox2";
this->textBox2->Size = System::Drawing::Size(72, 20);
this->textBox2->TabIndex = 3;
this->textBox2->Text = S"200";
//
// textBox3
//
this->textBox3->Location = System::Drawing::Point(528, 72);
this->textBox3->Name = S"textBox3";
this->textBox3->Size = System::Drawing::Size(72, 20);
this->textBox3->TabIndex = 5;
this->textBox3->Text = S"200";
this->textBox3->TextChanged += new System::EventHandler(this, textBox3_TextChanged);
//
// textBox4
//
this->textBox4->Location = System::Drawing::Point(616, 72);
this->textBox4->Name = S"textBox4";
this->textBox4->Size = System::Drawing::Size(72, 20);
this->textBox4->TabIndex = 4;
this->textBox4->Text = S"300";
//
// textBox5
//
this->textBox5->Location = System::Drawing::Point(528, 104);
this->textBox5->Name = S"textBox5";
this->textBox5->Size = System::Drawing::Size(72, 20);
this->textBox5->TabIndex = 9;
this->textBox5->Text = S"300";
//
// textBox6
//
this->textBox6->Location = System::Drawing::Point(616, 104);
this->textBox6->Name = S"textBox6";
this->textBox6->Size = System::Drawing::Size(72, 20);
this->textBox6->TabIndex = 8;
this->textBox6->Text = S"300";
//
// textBox7
//
this->textBox7->Location = System::Drawing::Point(528, 136);
this->textBox7->Name = S"textBox7";
this->textBox7->Size = System::Drawing::Size(72, 20);
this->textBox7->TabIndex = 7;
this->textBox7->Text = S"300";
//
// textBox8
//
this->textBox8->Location = System::Drawing::Point(616, 136);
this->textBox8->Name = S"textBox8";
this->textBox8->Size = System::Drawing::Size(72, 20);
this->textBox8->TabIndex = 6;
this->textBox8->Text = S"200";
//
// groupBox1
//
this->groupBox1->Location = System::Drawing::Point(512, 16);
this->groupBox1->Name = S"groupBox1";
this->groupBox1->Size = System::Drawing::Size(192, 184);
this->groupBox1->TabIndex = 10;
this->groupBox1->TabStop = false;
this->groupBox1->Text = S"Rozmery";
this->groupBox1->Enter += new System::EventHandler(this, groupBox1_Enter);
//
// button2
//
this->button2->BackColor = System::Drawing::SystemColors::ActiveBorder;
this->button2->Location = System::Drawing::Point(48, 24);
this->button2->Name = S"button2";
this->button2->Size = System::Drawing::Size(32, 32);
this->button2->TabIndex = 11;
this->button2->Text = S"U";
this->button2->Click += new System::EventHandler(this, button2_Click);
//
// button4
//
this->button4->BackColor = System::Drawing::SystemColors::ActiveBorder;
this->button4->Location = System::Drawing::Point(48, 104);
this->button4->Name = S"button4";
this->button4->Size = System::Drawing::Size(32, 32);
this->button4->TabIndex = 13;
this->button4->Text = S"D";
this->button4->Click += new System::EventHandler(this, button4_Click);
//
// button5
//
this->button5->BackColor = System::Drawing::SystemColors::ActiveBorder;
this->button5->Location = System::Drawing::Point(8, 64);
this->button5->Name = S"button5";
this->button5->Size = System::Drawing::Size(32, 32);
this->button5->TabIndex = 14;
this->button5->Text = S"L";
this->button5->Click += new System::EventHandler(this, button5_Click);
//
// button6
//
this->button6->BackColor = System::Drawing::SystemColors::ActiveBorder;
this->button6->Location = System::Drawing::Point(88, 64);
this->button6->Name = S"button6";
this->button6->Size = System::Drawing::Size(32, 32);
this->button6->TabIndex = 15;
this->button6->Text = S"R";
this->button6->Click += new System::EventHandler(this, button6_Click);
//
// groupBox2
//
this->groupBox2->Controls->Add(this->groupBox3);
this->groupBox2->Controls->Add(this->button3);
this->groupBox2->Controls->Add(this->button4);
this->groupBox2->Controls->Add(this->button6);
this->groupBox2->Controls->Add(this->button5);
this->groupBox2->Controls->Add(this->button2);
this->groupBox2->Controls->Add(this->textBox9);
this->groupBox2->Location = System::Drawing::Point(512, 216);
this->groupBox2->Name = S"groupBox2";
this->groupBox2->Size = System::Drawing::Size(128, 152);
this->groupBox2->TabIndex = 17;
this->groupBox2->TabStop = false;
this->groupBox2->Text = S"Transformacia";
this->groupBox2->Enter += new System::EventHandler(this, groupBox2_Enter);
//
// groupBox3
//
this->groupBox3->Location = System::Drawing::Point(40, 152);
this->groupBox3->Name = S"groupBox3";
this->groupBox3->Size = System::Drawing::Size(80, 100);
this->groupBox3->TabIndex = 18;
this->groupBox3->TabStop = false;
this->groupBox3->Text = S"groupBox3";
//
// button3
//
this->button3->BackColor = System::Drawing::SystemColors::ActiveBorder;
this->button3->Location = System::Drawing::Point(48, 64);
this->button3->Name = S"button3";
this->button3->Size = System::Drawing::Size(32, 32);
this->button3->TabIndex = 19;
this->button3->Click += new System::EventHandler(this, button3_Click);
//
// textBox9
//
this->textBox9->Location = System::Drawing::Point(88, 24);
this->textBox9->Name = S"textBox9";
this->textBox9->Size = System::Drawing::Size(32, 20);
this->textBox9->TabIndex = 18;
this->textBox9->Text = S"10";
this->textBox9->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
this->textBox9->TextChanged += new System::EventHandler(this, textBox9_TextChanged);
//
// groupBox4
//
this->groupBox4->Controls->Add(this->button8);
this->groupBox4->Controls->Add(this->button7);
this->groupBox4->Controls->Add(this->textBox10);
this->groupBox4->Location = System::Drawing::Point(648, 216);
this->groupBox4->Name = S"groupBox4";
this->groupBox4->Size = System::Drawing::Size(56, 152);
this->groupBox4->TabIndex = 20;
this->groupBox4->TabStop = false;
this->groupBox4->Text = S"Scale";
//
// button8
//
this->button8->BackColor = System::Drawing::SystemColors::ActiveBorder;
this->button8->Location = System::Drawing::Point(8, 104);
this->button8->Name = S"button8";
this->button8->Size = System::Drawing::Size(40, 40);
this->button8->TabIndex = 21;
this->button8->Text = S"+";
this->button8->Click += new System::EventHandler(this, button8_Click);
//
// button7
//
this->button7->BackColor = System::Drawing::SystemColors::ActiveBorder;
this->button7->Location = System::Drawing::Point(8, 48);
this->button7->Name = S"button7";
this->button7->Size = System::Drawing::Size(40, 40);
this->button7->TabIndex = 20;
this->button7->Text = S"-";
this->button7->Click += new System::EventHandler(this, button7_Click);
//
// textBox10
//
this->textBox10->Location = System::Drawing::Point(8, 16);
this->textBox10->Name = S"textBox10";
this->textBox10->Size = System::Drawing::Size(40, 20);
this->textBox10->TabIndex = 20;
this->textBox10->Text = S"1,1";
this->textBox10->TextAlign = System::Windows::Forms::HorizontalAlignment::Center;
//
// Form1
//
this->AutoScaleBaseSize = System::Drawing::Size(5, 13);
this->BackColor = System::Drawing::SystemColors::ControlDarkDark;
this->ClientSize = System::Drawing::Size(720, 382);
this->Controls->Add(this->textBox5);
this->Controls->Add(this->textBox6);
this->Controls->Add(this->textBox7);
this->Controls->Add(this->textBox8);
this->Controls->Add(this->textBox3);
this->Controls->Add(this->textBox4);
this->Controls->Add(this->textBox2);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->button1);
this->Controls->Add(this->pictureBox1);
this->Controls->Add(this->groupBox1);
this->Controls->Add(this->groupBox2);
this->Controls->Add(this->groupBox4);
this->Name = S"Form1";
this->Text = S"Form1";
this->Load += new System::EventHandler(this, Form1_Load);
this->groupBox2->ResumeLayout(false);
this->groupBox4->ResumeLayout(false);
this->ResumeLayout(false);
}
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
grafika->Clear(Color::FromArgb(255,255,255));
grafika->DrawLine(Pero1,stvorec[0],stvorec[1]);
grafika->DrawLine(Pero1,stvorec[1],stvorec[2]);
grafika->DrawLine(Pero1,stvorec[2],stvorec[3]);
grafika->DrawLine(Pero1,stvorec[3],stvorec[0]);
}
private: System::Void pictureBox1_Click(System::Object * sender, System::EventArgs * e)
{
}
private: System::Void Form1_Load(System::Object * sender, System::EventArgs * e)
{
}
private: System::Void textBox1_TextChanged(System::Object * sender, System::EventArgs * e)
{
}
private: System::Void textBox3_TextChanged(System::Object * sender, System::EventArgs * e)
{
}
private: System::Void groupBox1_Enter(System::Object * sender, System::EventArgs * e)
{
}
private: System::Void textBox9_TextChanged(System::Object * sender, System::EventArgs * e)
{
}
private: System::Void button2_Click(System::Object * sender, System::EventArgs * e)
{
grafika->Clear(Color::FromArgb(255,255,255));
float h=(float)textBox9->Text->ToDouble(0);
stvorec[0].set_Y(stvorec[0].get_Y()-h);
stvorec[1].set_Y(stvorec[1].get_Y()-h);
stvorec[2].set_Y(stvorec[2].get_Y()-h);
stvorec[3].set_Y(stvorec[3].get_Y()-h);
grafika->DrawLine(Pero1,stvorec[0],stvorec[1]);
grafika->DrawLine(Pero1,stvorec[1],stvorec[2]);
grafika->DrawLine(Pero1,stvorec[2],stvorec[3]);
grafika->DrawLine(Pero1,stvorec[3],stvorec[0]);
}
private: System::Void button4_Click(System::Object * sender, System::EventArgs * e)
{
grafika->Clear(Color::FromArgb(255,255,255));
float h=(float)textBox9->Text->ToDouble(0);
stvorec[0].set_Y(stvorec[0].get_Y()+h);
stvorec[1].set_Y(stvorec[1].get_Y()+h);
stvorec[2].set_Y(stvorec[2].get_Y()+h);
stvorec[3].set_Y(stvorec[3].get_Y()+h);
grafika->DrawLine(Pero1,stvorec[0],stvorec[1]);
grafika->DrawLine(Pero1,stvorec[1],stvorec[2]);
grafika->DrawLine(Pero1,stvorec[2],stvorec[3]);
grafika->DrawLine(Pero1,stvorec[3],stvorec[0]);
}
private: System::Void button5_Click(System::Object * sender, System::EventArgs * e)
{ grafika->Clear(Color::FromArgb(255,255,255));
float h=(float)textBox9->Text->ToDouble(0);
stvorec[0].set_X(stvorec[0].get_X()-h);
stvorec[1].set_X(stvorec[1].get_X()-h);
stvorec[2].set_X(stvorec[2].get_X()-h);
stvorec[3].set_X(stvorec[3].get_X()-h);
grafika->DrawLine(Pero1,stvorec[0],stvorec[1]);
grafika->DrawLine(Pero1,stvorec[1],stvorec[2]);
grafika->DrawLine(Pero1,stvorec[2],stvorec[3]);
grafika->DrawLine(Pero1,stvorec[3],stvorec[0]);
}
private: System::Void button6_Click(System::Object * sender, System::EventArgs * e)
{
grafika->Clear(Color::FromArgb(255,255,255));
float h=(float)textBox9->Text->ToDouble(0);
stvorec[0].set_X(stvorec[0].get_X()+h);
stvorec[1].set_X(stvorec[1].get_X()+h);
stvorec[2].set_X(stvorec[2].get_X()+h);
stvorec[3].set_X(stvorec[3].get_X()+h);
grafika->DrawLine(Pero1,stvorec[0],stvorec[1]);
grafika->DrawLine(Pero1,stvorec[1],stvorec[2]);
grafika->DrawLine(Pero1,stvorec[2],stvorec[3]);
grafika->DrawLine(Pero1,stvorec[3],stvorec[0]);
}
private: System::Void button3_Click(System::Object * sender, System::EventArgs * e)
{
}
private: System::Void groupBox2_Enter(System::Object * sender, System::EventArgs * e)
{
}
private: System::Void button7_Click(System::Object * sender, System::EventArgs * e)
{
grafika->Clear(Color::FromArgb(255,255,255));
float h=(float)textBox10->Text->ToDouble(0);
stvorec[0].set_X(stvorec[0].get_X()/h);
stvorec[1].set_X(stvorec[1].get_X()/h);
stvorec[2].set_X(stvorec[2].get_X()/h);
stvorec[3].set_X(stvorec[3].get_X()/h);
stvorec[0].set_Y(+stvorec[0].get_Y()/h);
stvorec[1].set_Y(+stvorec[1].get_Y()/h);
stvorec[2].set_Y(stvorec[2].get_Y()/h);
stvorec[3].set_Y(stvorec[3].get_Y()/h);
grafika->DrawLine(Pero1,stvorec[0],stvorec[1]);
grafika->DrawLine(Pero1,stvorec[1],stvorec[2]);
grafika->DrawLine(Pero1,stvorec[2],stvorec[3]);
grafika->DrawLine(Pero1,stvorec[3],stvorec[0]);
}
private: System::Void button8_Click(System::Object * sender, System::EventArgs * e)
{
grafika->Clear(Color::FromArgb(255,255,255));
float h=(float)textBox10->Text->ToDouble(0);
stvorec[0].set_X(stvorec[0].get_X()*h);
stvorec[1].set_X(stvorec[1].get_X()*h);
stvorec[2].set_X(stvorec[2].get_X()*h);
stvorec[3].set_X(stvorec[3].get_X()*h);
stvorec[0].set_Y(+stvorec[0].get_Y()*h);
stvorec[1].set_Y(+stvorec[1].get_Y()*h);
stvorec[2].set_Y(stvorec[2].get_Y()*h);
stvorec[3].set_Y(stvorec[3].get_Y()*h);
grafika->DrawLine(Pero1,stvorec[0],stvorec[1]);
grafika->DrawLine(Pero1,stvorec[1],stvorec[2]);
grafika->DrawLine(Pero1,stvorec[2],stvorec[3]);
grafika->DrawLine(Pero1,stvorec[3],stvorec[0]);
}
}
};
}