Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include <cstring>
- #include "Opperations.h"
- #include <cmath>
- namespace Calc {
- 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>
- /// Сводка для MyForm
- /// </summary>
- public ref class MyForm : public System::Windows::Forms::Form
- {
- public:
- MyForm(void)
- {
- InitializeComponent();
- //
- //TODO: добавьте код конструктора
- //
- }
- protected:
- /// <summary>
- /// Освободить все используемые ресурсы.
- /// </summary>
- ~MyForm()
- {
- if (components)
- {
- delete components;
- }
- }
- private: System::Windows::Forms::TextBox^ inputValue;
- private: System::Windows::Forms::TextBox^ bufferNum;
- private: System::Windows::Forms::Button^ Summ;
- private: System::Windows::Forms::TextBox^ opperatorBox;
- private: System::Windows::Forms::Button^ equal;
- private: System::Windows::Forms::Button^ plus0;
- private: System::Windows::Forms::Button^ plus1;
- private: System::Windows::Forms::Button^ plus2;
- private: System::Windows::Forms::Button^ plus3;
- private: System::Windows::Forms::Button^ plus4;
- private: System::Windows::Forms::Button^ plus5;
- private: System::Windows::Forms::Button^ plus6;
- private: System::Windows::Forms::Button^ plus7;
- private: System::Windows::Forms::Button^ plus8;
- private: System::Windows::Forms::Button^ plus9;
- private: System::Windows::Forms::Button^ addDot;
- private: System::Windows::Forms::Button^ diff;
- private: System::Windows::Forms::Button^ multip;
- private: System::Windows::Forms::Button^ disvion;
- private: System::Windows::Forms::Button^ reset;
- private: System::Windows::Forms::Button^ sign;
- private: System::Windows::Forms::Button^ resetCurrent;
- private:
- /// <summary>
- /// Обязательная переменная конструктора.
- /// </summary>
- System::ComponentModel::Container ^components;
- #pragma region Windows Form Designer generated code
- /// <summary>
- /// Требуемый метод для поддержки конструктора — не изменяйте
- /// содержимое этого метода с помощью редактора кода.
- /// </summary>
- void InitializeComponent(void)
- {
- System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(MyForm::typeid));
- this->inputValue = (gcnew System::Windows::Forms::TextBox());
- this->bufferNum = (gcnew System::Windows::Forms::TextBox());
- this->Summ = (gcnew System::Windows::Forms::Button());
- this->opperatorBox = (gcnew System::Windows::Forms::TextBox());
- this->equal = (gcnew System::Windows::Forms::Button());
- this->plus0 = (gcnew System::Windows::Forms::Button());
- this->plus1 = (gcnew System::Windows::Forms::Button());
- this->plus2 = (gcnew System::Windows::Forms::Button());
- this->plus3 = (gcnew System::Windows::Forms::Button());
- this->plus4 = (gcnew System::Windows::Forms::Button());
- this->plus5 = (gcnew System::Windows::Forms::Button());
- this->plus6 = (gcnew System::Windows::Forms::Button());
- this->plus7 = (gcnew System::Windows::Forms::Button());
- this->plus8 = (gcnew System::Windows::Forms::Button());
- this->plus9 = (gcnew System::Windows::Forms::Button());
- this->addDot = (gcnew System::Windows::Forms::Button());
- this->diff = (gcnew System::Windows::Forms::Button());
- this->multip = (gcnew System::Windows::Forms::Button());
- this->disvion = (gcnew System::Windows::Forms::Button());
- this->reset = (gcnew System::Windows::Forms::Button());
- this->sign = (gcnew System::Windows::Forms::Button());
- this->resetCurrent = (gcnew System::Windows::Forms::Button());
- this->SuspendLayout();
- //
- // inputValue
- //
- this->inputValue->BackColor = System::Drawing::Color::LightCyan;
- this->inputValue->BorderStyle = System::Windows::Forms::BorderStyle::None;
- this->inputValue->Cursor = System::Windows::Forms::Cursors::Default;
- this->inputValue->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->inputValue->Location = System::Drawing::Point(12, 41);
- this->inputValue->Name = L"inputValue";
- this->inputValue->ReadOnly = true;
- this->inputValue->Size = System::Drawing::Size(250, 31);
- this->inputValue->TabIndex = 5;
- //
- // bufferNum
- //
- this->bufferNum->BackColor = System::Drawing::Color::LightCyan;
- this->bufferNum->BorderStyle = System::Windows::Forms::BorderStyle::None;
- this->bufferNum->Cursor = System::Windows::Forms::Cursors::Default;
- this->bufferNum->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->bufferNum->Location = System::Drawing::Point(12, 25);
- this->bufferNum->Name = L"bufferNum";
- this->bufferNum->ReadOnly = true;
- this->bufferNum->Size = System::Drawing::Size(250, 16);
- this->bufferNum->TabIndex = 10;
- //
- // Summ
- //
- this->Summ->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->Summ->FlatAppearance->BorderSize = 0;
- this->Summ->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->Summ->Location = System::Drawing::Point(61, 78);
- this->Summ->Name = L"Summ";
- this->Summ->Size = System::Drawing::Size(50, 50);
- this->Summ->TabIndex = 11;
- this->Summ->Text = L"+";
- this->Summ->UseVisualStyleBackColor = true;
- this->Summ->Click += gcnew System::EventHandler(this, &MyForm::Summ_Click);
- //
- // opperatorBox
- //
- this->opperatorBox->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(226)), static_cast<System::Int32>(static_cast<System::Byte>(235)),
- static_cast<System::Int32>(static_cast<System::Byte>(246)));
- this->opperatorBox->BorderStyle = System::Windows::Forms::BorderStyle::None;
- this->opperatorBox->Cursor = System::Windows::Forms::Cursors::Default;
- this->opperatorBox->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->opperatorBox->Location = System::Drawing::Point(268, 23);
- this->opperatorBox->Name = L"opperatorBox";
- this->opperatorBox->ReadOnly = true;
- this->opperatorBox->Size = System::Drawing::Size(16, 16);
- this->opperatorBox->TabIndex = 12;
- //
- // equal
- //
- this->equal->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->equal->FlatAppearance->BorderSize = 0;
- this->equal->Location = System::Drawing::Point(229, 246);
- this->equal->Name = L"equal";
- this->equal->Size = System::Drawing::Size(52, 50);
- this->equal->TabIndex = 13;
- this->equal->Text = L"=";
- this->equal->UseVisualStyleBackColor = true;
- this->equal->Click += gcnew System::EventHandler(this, &MyForm::equal_Click);
- //
- // plus0
- //
- this->plus0->AccessibleName = L"";
- this->plus0->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->plus0->FlatAppearance->BorderSize = 0;
- this->plus0->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->plus0->Location = System::Drawing::Point(117, 246);
- this->plus0->Name = L"plus0";
- this->plus0->Size = System::Drawing::Size(50, 50);
- this->plus0->TabIndex = 9;
- this->plus0->Text = L"0";
- this->plus0->UseVisualStyleBackColor = true;
- this->plus0->Click += gcnew System::EventHandler(this, &MyForm::plus0_Click);
- //
- // plus1
- //
- this->plus1->AccessibleName = L"";
- this->plus1->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->plus1->FlatAppearance->BorderSize = 0;
- this->plus1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->plus1->Location = System::Drawing::Point(117, 78);
- this->plus1->Name = L"plus1";
- this->plus1->Size = System::Drawing::Size(50, 50);
- this->plus1->TabIndex = 7;
- this->plus1->Text = L"1";
- this->plus1->UseVisualStyleBackColor = true;
- this->plus1->Click += gcnew System::EventHandler(this, &MyForm::plus1_Click);
- //
- // plus2
- //
- this->plus2->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->plus2->FlatAppearance->BorderSize = 0;
- this->plus2->Font = (gcnew System::Drawing::Font(L"Microsoft Tai Le", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->plus2->Location = System::Drawing::Point(173, 78);
- this->plus2->Name = L"plus2";
- this->plus2->Size = System::Drawing::Size(50, 50);
- this->plus2->TabIndex = 8;
- this->plus2->Text = L"2";
- this->plus2->UseVisualStyleBackColor = true;
- this->plus2->Click += gcnew System::EventHandler(this, &MyForm::plus2_Click);
- //
- // plus3
- //
- this->plus3->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->plus3->FlatAppearance->BorderSize = 0;
- this->plus3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->plus3->Location = System::Drawing::Point(229, 78);
- this->plus3->Name = L"plus3";
- this->plus3->Size = System::Drawing::Size(50, 50);
- this->plus3->TabIndex = 8;
- this->plus3->Text = L"3";
- this->plus3->UseVisualStyleBackColor = true;
- this->plus3->Click += gcnew System::EventHandler(this, &MyForm::plus3_Click);
- //
- // plus4
- //
- this->plus4->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->plus4->FlatAppearance->BorderSize = 0;
- this->plus4->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->plus4->Location = System::Drawing::Point(115, 134);
- this->plus4->Name = L"plus4";
- this->plus4->Size = System::Drawing::Size(50, 50);
- this->plus4->TabIndex = 8;
- this->plus4->Text = L"4";
- this->plus4->UseVisualStyleBackColor = true;
- this->plus4->Click += gcnew System::EventHandler(this, &MyForm::plus4_Click);
- //
- // plus5
- //
- this->plus5->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->plus5->FlatAppearance->BorderSize = 0;
- this->plus5->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->plus5->Location = System::Drawing::Point(173, 134);
- this->plus5->Name = L"plus5";
- this->plus5->Size = System::Drawing::Size(50, 50);
- this->plus5->TabIndex = 8;
- this->plus5->Text = L"5";
- this->plus5->UseVisualStyleBackColor = true;
- this->plus5->Click += gcnew System::EventHandler(this, &MyForm::plus5_Click);
- //
- // plus6
- //
- this->plus6->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->plus6->FlatAppearance->BorderSize = 0;
- this->plus6->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->plus6->Location = System::Drawing::Point(229, 134);
- this->plus6->Name = L"plus6";
- this->plus6->Size = System::Drawing::Size(50, 50);
- this->plus6->TabIndex = 8;
- this->plus6->Text = L"6";
- this->plus6->UseVisualStyleBackColor = true;
- this->plus6->Click += gcnew System::EventHandler(this, &MyForm::plus6_Click);
- //
- // plus7
- //
- this->plus7->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->plus7->FlatAppearance->BorderSize = 0;
- this->plus7->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->plus7->Location = System::Drawing::Point(117, 190);
- this->plus7->Name = L"plus7";
- this->plus7->Size = System::Drawing::Size(50, 50);
- this->plus7->TabIndex = 8;
- this->plus7->Text = L"7";
- this->plus7->UseVisualStyleBackColor = true;
- this->plus7->Click += gcnew System::EventHandler(this, &MyForm::plus7_Click);
- //
- // plus8
- //
- this->plus8->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->plus8->FlatAppearance->BorderSize = 0;
- this->plus8->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->plus8->Location = System::Drawing::Point(173, 190);
- this->plus8->Name = L"plus8";
- this->plus8->Size = System::Drawing::Size(50, 50);
- this->plus8->TabIndex = 8;
- this->plus8->Text = L"8";
- this->plus8->UseVisualStyleBackColor = true;
- this->plus8->Click += gcnew System::EventHandler(this, &MyForm::plus8_Click);
- //
- // plus9
- //
- this->plus9->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->plus9->FlatAppearance->BorderSize = 0;
- this->plus9->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->plus9->Location = System::Drawing::Point(229, 190);
- this->plus9->Name = L"plus9";
- this->plus9->Size = System::Drawing::Size(50, 50);
- this->plus9->TabIndex = 8;
- this->plus9->Text = L"9";
- this->plus9->UseVisualStyleBackColor = true;
- this->plus9->Click += gcnew System::EventHandler(this, &MyForm::plus9_Click);
- //
- // addDot
- //
- this->addDot->AccessibleName = L"";
- this->addDot->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->addDot->FlatAppearance->BorderSize = 0;
- this->addDot->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->addDot->Location = System::Drawing::Point(173, 246);
- this->addDot->Name = L"addDot";
- this->addDot->Size = System::Drawing::Size(50, 50);
- this->addDot->TabIndex = 14;
- this->addDot->Text = L".";
- this->addDot->UseVisualStyleBackColor = true;
- this->addDot->Click += gcnew System::EventHandler(this, &MyForm::addDot_Click);
- //
- // diff
- //
- this->diff->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->diff->FlatAppearance->BorderSize = 0;
- this->diff->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->diff->Location = System::Drawing::Point(61, 134);
- this->diff->Name = L"diff";
- this->diff->Size = System::Drawing::Size(50, 49);
- this->diff->TabIndex = 15;
- this->diff->Text = L"-";
- this->diff->UseVisualStyleBackColor = true;
- this->diff->Click += gcnew System::EventHandler(this, &MyForm::diff_Click);
- //
- // multip
- //
- this->multip->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->multip->FlatAppearance->BorderSize = 0;
- this->multip->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->multip->Location = System::Drawing::Point(61, 190);
- this->multip->Name = L"multip";
- this->multip->Size = System::Drawing::Size(50, 49);
- this->multip->TabIndex = 16;
- this->multip->Text = L"*";
- this->multip->UseVisualStyleBackColor = true;
- this->multip->Click += gcnew System::EventHandler(this, &MyForm::multip_Click);
- //
- // disvion
- //
- this->disvion->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->disvion->FlatAppearance->BorderSize = 0;
- this->disvion->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->disvion->Location = System::Drawing::Point(61, 246);
- this->disvion->Name = L"disvion";
- this->disvion->Size = System::Drawing::Size(49, 49);
- this->disvion->TabIndex = 17;
- this->disvion->Text = L"/";
- this->disvion->UseVisualStyleBackColor = true;
- this->disvion->Click += gcnew System::EventHandler(this, &MyForm::disvion_Click);
- //
- // reset
- //
- this->reset->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->reset->FlatAppearance->BorderSize = 0;
- this->reset->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 15, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->reset->Location = System::Drawing::Point(6, 78);
- this->reset->Name = L"reset";
- this->reset->Size = System::Drawing::Size(49, 50);
- this->reset->TabIndex = 18;
- this->reset->Text = L"C";
- this->reset->UseVisualStyleBackColor = true;
- this->reset->Click += gcnew System::EventHandler(this, &MyForm::reset_Click);
- //
- // sign
- //
- this->sign->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->sign->FlatAppearance->BorderSize = 0;
- this->sign->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 20, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->sign->Location = System::Drawing::Point(6, 189);
- this->sign->Name = L"sign";
- this->sign->Size = System::Drawing::Size(49, 50);
- this->sign->TabIndex = 19;
- this->sign->Text = L"±";
- this->sign->UseVisualStyleBackColor = true;
- this->sign->Click += gcnew System::EventHandler(this, &MyForm::sign_Click);
- //
- // resetCurrent
- //
- this->resetCurrent->BackgroundImageLayout = System::Windows::Forms::ImageLayout::None;
- this->resetCurrent->FlatAppearance->BorderSize = 0;
- this->resetCurrent->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 15, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(204)));
- this->resetCurrent->Location = System::Drawing::Point(6, 134);
- this->resetCurrent->Name = L"resetCurrent";
- this->resetCurrent->Size = System::Drawing::Size(49, 49);
- this->resetCurrent->TabIndex = 20;
- this->resetCurrent->Text = L"CE";
- this->resetCurrent->UseVisualStyleBackColor = true;
- this->resetCurrent->Click += gcnew System::EventHandler(this, &MyForm::resetCurrent_Click);
- //
- // MyForm
- //
- this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
- this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
- this->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(226)), static_cast<System::Int32>(static_cast<System::Byte>(235)),
- static_cast<System::Int32>(static_cast<System::Byte>(246)));
- this->ClientSize = System::Drawing::Size(289, 315);
- this->Controls->Add(this->resetCurrent);
- this->Controls->Add(this->sign);
- this->Controls->Add(this->reset);
- this->Controls->Add(this->disvion);
- this->Controls->Add(this->multip);
- this->Controls->Add(this->diff);
- this->Controls->Add(this->addDot);
- this->Controls->Add(this->plus9);
- this->Controls->Add(this->plus8);
- this->Controls->Add(this->plus7);
- this->Controls->Add(this->plus0);
- this->Controls->Add(this->plus6);
- this->Controls->Add(this->equal);
- this->Controls->Add(this->plus5);
- this->Controls->Add(this->opperatorBox);
- this->Controls->Add(this->plus4);
- this->Controls->Add(this->Summ);
- this->Controls->Add(this->plus3);
- this->Controls->Add(this->bufferNum);
- this->Controls->Add(this->plus2);
- this->Controls->Add(this->plus1);
- this->Controls->Add(this->inputValue);
- this->HelpButton = true;
- this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon")));
- this->ImeMode = System::Windows::Forms::ImeMode::NoControl;
- this->KeyPreview = true;
- this->Name = L"MyForm";
- this->Text = L"Calculator";
- this->Load += gcnew System::EventHandler(this, &MyForm::MyForm_Load);
- this->ResumeLayout(false);
- this->PerformLayout();
- }
- #pragma endregion
- private: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e)
- {
- }
- //Кнопки ввода числа
- private: System::Void plus0_Click(System::Object^ sender, System::EventArgs^ e) {
- if(inputValue->TextLength > 1)
- inputValue->Text = inputNum(0, inputValue->Text);
- }
- private: System::Void plus1_Click(System::Object^ sender, System::EventArgs^ e) {
- inputValue->Text = inputNum(1, inputValue->Text);
- }
- private: System::Void plus2_Click(System::Object^ sender, System::EventArgs^ e) {
- inputValue->Text = inputNum(2, inputValue->Text);
- }
- private: System::Void plus3_Click(System::Object^ sender, System::EventArgs^ e) {
- inputValue->Text = inputNum(3, inputValue->Text);
- }
- private: System::Void plus4_Click(System::Object^ sender, System::EventArgs^ e) {
- inputValue->Text = inputNum(4, inputValue->Text);
- }
- private: System::Void plus5_Click(System::Object^ sender, System::EventArgs^ e) {
- inputValue->Text = inputNum(5, inputValue->Text);
- }
- private: System::Void plus6_Click(System::Object^ sender, System::EventArgs^ e) {
- inputValue->Text = inputNum(6, inputValue->Text);
- }
- private: System::Void plus7_Click(System::Object^ sender, System::EventArgs^ e) {
- inputValue->Text = inputNum(7, inputValue->Text);
- }
- private: System::Void plus8_Click(System::Object^ sender, System::EventArgs^ e) {
- inputValue->Text = inputNum(8, inputValue->Text);
- }
- private: System::Void plus9_Click(System::Object^ sender, System::EventArgs^ e) {
- inputValue->Text = inputNum(9, inputValue->Text);
- }
- private: System::Void addDot_Click(System::Object^ sender, System::EventArgs^ e) {
- if (!inputValue->Text->Contains(","))
- {
- if (inputValue->Text->Length > 0)
- inputValue->Text = inputValue->Text + ",";
- else
- inputValue->Text = inputValue->Text + "0,";
- }
- }
- //Кнопки операций
- private: System::Void equal_Click(System::Object^ sender, System::EventArgs^ e) {
- if (bufferNum->TextLength > 0 && inputValue->TextLength > 0)
- {
- inputValue->Text = conversion(bufferNum->Text, inputValue->Text, getOperator(opperatorBox->Text));
- bufferNum->Text = "";
- opperatorBox->Text = "";
- }
- }
- private: System::Void Summ_Click(System::Object^ sender, System::EventArgs^ e) {
- if (inputValue->TextLength > 0)
- {
- if (inputValue->TextLength > 0)
- {
- if (bufferNum->TextLength > 0)
- bufferNum->Text = conversion(bufferNum->Text, inputValue->Text, getOperator(opperatorBox->Text));
- else
- bufferNum->Text = inputValue->Text;
- inputValue->Text = "";
- opperatorBox->Text = "+";
- }
- }
- }
- private: System::Void diff_Click(System::Object^ sender, System::EventArgs^ e) {
- {
- if (inputValue->TextLength > 0)
- {
- if (bufferNum->TextLength > 0)
- bufferNum->Text = conversion(bufferNum->Text, inputValue->Text, getOperator(opperatorBox->Text));
- else
- bufferNum->Text = inputValue->Text;
- inputValue->Text = "";
- opperatorBox->Text = "-";
- }
- }
- }
- private: System::Void multip_Click(System::Object^ sender, System::EventArgs^ e)
- {
- if (inputValue->TextLength > 0)
- {
- if (bufferNum->TextLength > 0)
- bufferNum->Text = conversion(bufferNum->Text, inputValue->Text, getOperator(opperatorBox->Text));
- else
- bufferNum->Text = inputValue->Text;
- inputValue->Text = "";
- opperatorBox->Text = "*";
- }
- }
- private: System::Void disvion_Click(System::Object^ sender, System::EventArgs^ e) {
- if (inputValue->TextLength > 0)
- {
- if (bufferNum->Text != "0")
- {
- if (bufferNum->TextLength > 0 )
- bufferNum->Text = conversion(bufferNum->Text, inputValue->Text, getOperator(opperatorBox->Text));
- else
- bufferNum->Text = inputValue->Text;
- inputValue->Text = "";
- opperatorBox->Text = "/";
- }
- }
- }
- //Кнопки управления
- private: System::Void reset_Click(System::Object^ sender, System::EventArgs^ e) {
- inputValue->Text = "";
- bufferNum->Text = "";
- opperatorBox->Text = "";
- }
- private: System::Void sign_Click(System::Object^ sender, System::EventArgs^ e) {
- if (inputValue->TextLength > 0)
- inputValue->Text = Convert::ToString(Convert::ToDouble(inputValue->Text) * -1);
- else if (bufferNum->TextLength > 0)
- bufferNum->Text = Convert::ToString(Convert::ToDouble(bufferNum->Text) * -1);
- }
- private: System::Void resetCurrent_Click(System::Object^ sender, System::EventArgs^ e) {
- if (inputValue->TextLength > 0)
- inputValue->Text = "";
- }
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement