From 0408d33694635cdc28db23c9c6388bd916626bde Mon Sep 17 00:00:00 2001 From: Andrew Guschin Date: Mon, 9 Nov 2020 23:28:49 +0300 Subject: =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B2=D1=8B=D0=B5=204=20=D0=B7=D0=B0=D0=B4=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- task01/Guschin.sln | 31 ++++++ task01/Guschin/Guschin.vcxproj | 133 +++++++++++++++++++++++++ task01/Guschin/Guschin.vcxproj.filters | 27 ++++++ task01/Guschin/Guschin.vcxproj.user | 4 + task01/Guschin/MyForm.cpp | 13 +++ task01/Guschin/MyForm.h | 171 +++++++++++++++++++++++++++++++++ 6 files changed, 379 insertions(+) create mode 100644 task01/Guschin.sln create mode 100644 task01/Guschin/Guschin.vcxproj create mode 100644 task01/Guschin/Guschin.vcxproj.filters create mode 100644 task01/Guschin/Guschin.vcxproj.user create mode 100644 task01/Guschin/MyForm.cpp create mode 100644 task01/Guschin/MyForm.h (limited to 'task01') diff --git a/task01/Guschin.sln b/task01/Guschin.sln new file mode 100644 index 0000000..28b263c --- /dev/null +++ b/task01/Guschin.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29806.167 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Guschin", "Guschin\Guschin.vcxproj", "{A9D89F35-1B7B-4ABC-890F-1862B89672E1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Debug|x64.ActiveCfg = Debug|x64 + {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Debug|x64.Build.0 = Debug|x64 + {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Debug|x86.ActiveCfg = Debug|Win32 + {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Debug|x86.Build.0 = Debug|Win32 + {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Release|x64.ActiveCfg = Release|x64 + {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Release|x64.Build.0 = Release|x64 + {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Release|x86.ActiveCfg = Release|Win32 + {A9D89F35-1B7B-4ABC-890F-1862B89672E1}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {D94F9F0A-82EE-4062-A0A2-7CF63E6A06BC} + EndGlobalSection +EndGlobal diff --git a/task01/Guschin/Guschin.vcxproj b/task01/Guschin/Guschin.vcxproj new file mode 100644 index 0000000..904927c --- /dev/null +++ b/task01/Guschin/Guschin.vcxproj @@ -0,0 +1,133 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + + + + + + + + + + + + CppForm + + + + 16.0 + {A9D89F35-1B7B-4ABC-890F-1862B89672E1} + v4.7.2 + ManagedCProj + Guschin + 10.0 + + + + Application + true + v142 + true + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + true + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + + Level3 + WIN32;_DEBUG;%(PreprocessorDefinitions) + + + + Windows + Main + + + + + Level3 + _DEBUG;%(PreprocessorDefinitions) + + + + + + + + Level3 + WIN32;NDEBUG;%(PreprocessorDefinitions) + + + + + + + + Level3 + NDEBUG;%(PreprocessorDefinitions) + + + + + + + + + \ No newline at end of file diff --git a/task01/Guschin/Guschin.vcxproj.filters b/task01/Guschin/Guschin.vcxproj.filters new file mode 100644 index 0000000..c9ea7e5 --- /dev/null +++ b/task01/Guschin/Guschin.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Файлы заголовков + + + + + Файлы заголовков + + + \ No newline at end of file diff --git a/task01/Guschin/Guschin.vcxproj.user b/task01/Guschin/Guschin.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/task01/Guschin/Guschin.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/task01/Guschin/MyForm.cpp b/task01/Guschin/MyForm.cpp new file mode 100644 index 0000000..c45f0fc --- /dev/null +++ b/task01/Guschin/MyForm.cpp @@ -0,0 +1,13 @@ +#include "MyForm.h" + +using namespace System; +using namespace System::Windows::Forms; + +[STAThreadAttribute] +void Main(array^ args) +{ + Application::EnableVisualStyles(); + Application::SetCompatibleTextRenderingDefault(false); + Guschin::MyForm form; + Application::Run(% form); +} diff --git a/task01/Guschin/MyForm.h b/task01/Guschin/MyForm.h new file mode 100644 index 0000000..f1d2add --- /dev/null +++ b/task01/Guschin/MyForm.h @@ -0,0 +1,171 @@ +#pragma once + +namespace Guschin { + + using namespace System; + using namespace System::ComponentModel; + using namespace System::Collections; + using namespace System::Windows::Forms; + using namespace System::Data; + using namespace System::Drawing; + + /// + /// MyForm + /// + public ref class MyForm : public System::Windows::Forms::Form + { + public: + MyForm(void) + { + InitializeComponent(); + // + //TODO: + // + } + + protected: + /// + /// . + /// + ~MyForm() + { + if (components) + { + delete components; + } + } + private: System::Windows::Forms::Label^ label1; + private: System::Windows::Forms::TextBox^ textBox1; + private: System::Windows::Forms::Label^ label2; + private: System::Windows::Forms::Button^ button1; + private: System::Windows::Forms::Label^ currency; + + protected: + + protected: + + private: + /// + /// . + /// + System::ComponentModel::Container^ components; + +#pragma region Windows Form Designer generated code + /// + /// + /// . + /// + void InitializeComponent(void) + { + this->label1 = (gcnew System::Windows::Forms::Label()); + this->textBox1 = (gcnew System::Windows::Forms::TextBox()); + this->label2 = (gcnew System::Windows::Forms::Label()); + this->button1 = (gcnew System::Windows::Forms::Button()); + this->currency = (gcnew System::Windows::Forms::Label()); + this->SuspendLayout(); + // + // label1 + // + this->label1->BackColor = System::Drawing::SystemColors::Control; + this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, + static_cast(204))); + this->label1->Location = System::Drawing::Point(29, 33); + this->label1->Name = L"label1"; + this->label1->Size = System::Drawing::Size(442, 90); + this->label1->TabIndex = 0; + this->label1->Text = L", . " + L" . , - " + L" . ."; + this->label1->Click += gcnew System::EventHandler(this, &MyForm::label1_Click); + // + // textBox1 + // + this->textBox1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 13, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, + static_cast(204))); + this->textBox1->Location = System::Drawing::Point(102, 252); + this->textBox1->Name = L"textBox1"; + this->textBox1->Size = System::Drawing::Size(189, 27); + this->textBox1->TabIndex = 1; + // + // label2 + // + this->label2->AutoSize = true; + this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, + static_cast(204))); + this->label2->Location = System::Drawing::Point(30, 255); + this->label2->Name = L"label2"; + this->label2->Size = System::Drawing::Size(66, 20); + this->label2->TabIndex = 2; + this->label2->Text = L": "; + // + // button1 + // + this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, + static_cast(204))); + this->button1->Location = System::Drawing::Point(358, 248); + this->button1->Name = L"button1"; + this->button1->Size = System::Drawing::Size(103, 37); + this->button1->TabIndex = 3; + this->button1->Text = L""; + this->button1->UseVisualStyleBackColor = true; + // + // currency + // + this->currency->AutoSize = true; + this->currency->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, + static_cast(204))); + this->currency->Location = System::Drawing::Point(297, 258); + this->currency->Name = L"currency"; + this->currency->Size = System::Drawing::Size(55, 17); + this->currency->TabIndex = 4; + this->currency->Text = L""; + // + // MyForm + // + this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); + this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; + this->ClientSize = System::Drawing::Size(500, 500); + this->Controls->Add(this->currency); + this->Controls->Add(this->button1); + this->Controls->Add(this->label2); + this->Controls->Add(this->textBox1); + this->Controls->Add(this->label1); + this->DoubleBuffered = true; + this->Name = L"MyForm"; + this->Text = L" "; + this->Paint += gcnew System::Windows::Forms::PaintEventHandler(this, &MyForm::MyForm_Paint); + this->Resize += gcnew System::EventHandler(this, &MyForm::MyForm_Resize); + this->ResumeLayout(false); + this->PerformLayout(); + + } +#pragma endregion + private: System::Void label1_Click(System::Object^ sender, System::EventArgs^ e) { + } + private: System::Void MyForm_Paint(System::Object^ sender, System::Windows::Forms::PaintEventArgs^ e) { + Graphics^ g = e->Graphics; + g->Clear(Color::Pink); + + Pen^ redPen = gcnew Pen(Color::Red); + redPen->Width = 6; + g->DrawLine(redPen, 0, 0, this->ClientRectangle.Width, this->ClientRectangle.Height); + + Pen^ bluePen = gcnew Pen(Color::Blue, 10); + g->DrawLine(bluePen, 90, 50, ClientRectangle.Width, 80); + + SolidBrush^ drawBrush = gcnew SolidBrush(Color::Green); + System::Drawing::Font^ drawFont = gcnew System::Drawing::Font("Comic Sans MS", 20); + g->DrawString(" ", drawFont, drawBrush, 40, 400); + + Pen^ sqarePen = gcnew Pen(Color::Green, 5); + g->DrawLine(sqarePen, 0, ClientRectangle.Height / 3, ClientRectangle.Width / 3 * 2, 0); + g->DrawLine(sqarePen, ClientRectangle.Width / 3 * 2, 0, ClientRectangle.Width, ClientRectangle.Height / 3 * 2); + g->DrawLine(sqarePen, ClientRectangle.Width, ClientRectangle.Height / 3 * 2, ClientRectangle.Width / 3, ClientRectangle.Height); + g->DrawLine(sqarePen, ClientRectangle.Width / 3, ClientRectangle.Height, 0, ClientRectangle.Height / 3); + + } + private: System::Void MyForm_Resize(System::Object^ sender, System::EventArgs^ e) { + this->Refresh(); + } + }; +} -- cgit v1.2.3