Добавлен: 02.04.2023
Просмотров: 463
Скачиваний: 1
СОДЕРЖАНИЕ
1 Теоретические основы организации работы с файлами в MS Visual C++
1.1 Организация работы с файлами средствами C++
1.2 Возможности компонента RichTextBox по работе с файлами
2 Разработка электронного учебника по курсу JavaScript
2.1 Логическая структура приложения
2.4 Разработка программного кода
this->button14->Name = L"button14";
this->button14->Size = System::Drawing::Size(105, 35);
this->button14->TabIndex = 14;
this->button14->Text = L"Задание № 6";
this->button14->UseVisualStyleBackColor = true;
this->button14->Click += gcnew System::EventHandler(this, &Form1::button14_Click);
this->button23->Location = System::Drawing::Point(117, 135);
this->button23->Name = L"button23";
this->button23->Size = System::Drawing::Size(105, 35);
this->button23->TabIndex = 14;
this->button23->Text = L"Задание № 12";
this->button23->UseVisualStyleBackColor = true;
this->button23->Click += gcnew System::EventHandler(this, &Form1::button23_Click);
this->button13->Location = System::Drawing::Point(6, 257);
this->button13->Name = L"button13";
this->button13->Size = System::Drawing::Size(105, 35);
this->button13->TabIndex = 15;
this->button13->Text = L"Задание № 7";
this->button13->UseVisualStyleBackColor = true;
this->button13->Click += gcnew System::EventHandler(this, &Form1::button13_Click);
this->button22->Location = System::Drawing::Point(117, 177);
this->button22->Name = L"button22";
this->button22->Size = System::Drawing::Size(105, 35);
this->button22->TabIndex = 15;
this->button22->Text = L"Задание № 13";
this->button22->UseVisualStyleBackColor = true;
this->button22->Click += gcnew System::EventHandler(this, &Form1::button22_Click);
this->button12->Location = System::Drawing::Point(6, 297);
this->button12->Name = L"button12";
this->button12->Size = System::Drawing::Size(105, 35);
this->button12->TabIndex = 16;
this->button12->Text = L"Задание № 8";
this->button12->UseVisualStyleBackColor = true;
this->button12->Click += gcnew System::EventHandler(this, &Form1::button12_Click);
this->button21->Location = System::Drawing::Point(117, 218);
this->button21->Name = L"button21";
this->button21->Size = System::Drawing::Size(105, 35);
this->button21->TabIndex = 16;
this->button21->Text = L"Задание № 14";
this->button21->UseVisualStyleBackColor = true;
this->button21->Click += gcnew System::EventHandler(this, &Form1::button21_Click);
this->button11->Location = System::Drawing::Point(117, 19);
this->button11->Name = L"button11";
this->button11->Size = System::Drawing::Size(105, 35);
this->button11->TabIndex = 17;
this->button11->Text = L"Задание № 9";
this->button11->UseVisualStyleBackColor = true;
this->button11->Click += gcnew System::EventHandler(this, &Form1::button11_Click);
this->button20->Location = System::Drawing::Point(117, 257);
this->button20->Name = L"button20";
this->button20->Size = System::Drawing::Size(105, 35);
this->button20->TabIndex = 17;
this->button20->Text = L"Задание № 15";
this->button20->UseVisualStyleBackColor = true;
this->button20->Click += gcnew System::EventHandler(this, &Form1::button20_Click);
this->groupBox2->Controls->Add(this->button20);
this->groupBox2->Controls->Add(this->button11);
this->groupBox2->Controls->Add(this->button21);
this->groupBox2->Controls->Add(this->button12);
this->groupBox2->Controls->Add(this->button22);
this->groupBox2->Controls->Add(this->button13);
this->groupBox2->Controls->Add(this->button23);
this->groupBox2->Controls->Add(this->button14);
this->groupBox2->Controls->Add(this->button24);
this->groupBox2->Controls->Add(this->button15);
this->groupBox2->Controls->Add(this->button25);
this->groupBox2->Controls->Add(this->button16);
this->groupBox2->Controls->Add(this->button17);
this->groupBox2->Controls->Add(this->button18);
this->groupBox2->Controls->Add(this->button19);
this->groupBox2->ForeColor = System::Drawing::Color::MediumBlue;
this->groupBox2->Location = System::Drawing::Point(279, 53);
this->groupBox2->Name = L"groupBox2";
this->groupBox2->Size = System::Drawing::Size(232, 394);
this->groupBox2->TabIndex = 11;
this->groupBox2->TabStop = false;
this->groupBox2->Text = L"Практика";
this->button28->Location = System::Drawing::Point(13, 28);
this->button28->Name = L"button28";
this->button28->Size = System::Drawing::Size(206, 35);
this->button28->TabIndex = 9;
this->button28->Text = L"Тест № 1";
this->button28->UseVisualStyleBackColor = true;
this->button28->Click += gcnew System::EventHandler(this, &Form1::button28_Click);
this->button27->Location = System::Drawing::Point(13, 76);
this->button27->Name = L"button27";
this->button27->Size = System::Drawing::Size(206, 35);
this->button27->TabIndex = 10;
this->button27->Text = L"Тест № 2";
this->button27->UseVisualStyleBackColor = true;
this->button27->Click += gcnew System::EventHandler(this, &Form1::button27_Click);
this->button26->Location = System::Drawing::Point(13, 121);
this->button26->Name = L"button26";
this->button26->Size = System::Drawing::Size(206, 35);
this->button26->TabIndex = 11;
this->button26->Text = L"Тест № 3";
this->button26->UseVisualStyleBackColor = true;
this->button26->Click += gcnew System::EventHandler(this, &Form1::button26_Click);
this->groupBox3->Controls->Add(this->button26);
this->groupBox3->Controls->Add(this->button27);
this->groupBox3->Controls->Add(this->button28);
this->groupBox3->ForeColor = System::Drawing::Color::MediumBlue;
this->groupBox3->Location = System::Drawing::Point(515, 53);
this->groupBox3->Name = L"groupBox3";
this->groupBox3->Size = System::Drawing::Size(233, 394);
this->groupBox3->TabIndex = 12;
this->groupBox3->TabStop = false;
this->groupBox3->Text = L"Тесты";
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackColor = System::Drawing::Color::SkyBlue;
this->ClientSize = System::Drawing::Size(775, 459);
this->Controls->Add(this->groupBox3);
this->Controls->Add(this->groupBox2);
this->Controls->Add(this->groupBox1);
this->Controls->Add(this->label1);
this->Controls->Add(this->richTextBox2);
this->Controls->Add(this->button1);
this->Controls->Add(this->radioButton4);
this->Controls->Add(this->radioButton3);
this->Controls->Add(this->radioButton2);
this->Controls->Add(this->radioButton1);
this->Controls->Add(this->richTextBox1);
this->Controls->Add(this->menuStrip1);
this->MainMenuStrip = this->menuStrip1;
this->Name = L"Form1";
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
this->Text = L"Вводный курс в JavaScript";
this->Activated += gcnew System::EventHandler(this, &Form1::Form1_Activated);
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->SizeChanged += gcnew System::EventHandler(this, &Form1::Form1_SizeChanged);
this->Leave += gcnew System::EventHandler(this, &Form1::Form1_Leave);
this->menuStrip1->ResumeLayout(false);
this->menuStrip1->PerformLayout();
this->groupBox1->ResumeLayout(false);
this->groupBox2->ResumeLayout(false);
this->groupBox3->ResumeLayout(false);
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
this->groupBox1->Visible=true;
this->groupBox2->Visible=true;
this->groupBox3->Visible=true;
this->richTextBox1->Visible=false;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
}
private: System::Void структураHtnlToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Data/Lection2.rtf");
num=2;
}
private: System::Void выходToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
Close();
}
private: System::Void основыЯзыкаHtmlToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Data/Lection1.rtf");
num=1;
}
private: System::Void лекToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Data/Lection3.rtf");
num=3;
}
private: System::Void лекцияПоJavaScript2ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=4;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Data/Lection4.rtf");
}
private: System::Void лекцияПоJavaScript3ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=5;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Data/Lection5.rtf");
}
private: System::Void лекцияПоJavaScript4ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=6;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Data/Lection6.rtf");
}
private: System::Void лекцияПоJavaScript5ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=7;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Data/Lection7.rtf");
}
private: System::Void лекцияПоJavaScript6ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=8;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Data/Lection8.rtf");
}
private: System::Void лекцияПоJavaScript7ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=9;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Data/Lection9.rtf");
}
private: System::Void лабораторнаяРабота1ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show("Для выполнения задания должны быть изучены лекции 1 - 2","Внимание!", MessageBoxButtons::OK,MessageBoxIcon::Question);
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=10;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Labs/Lr1.rtf");
}
private: System::Void лабораторнаяРабота2ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show("Для выполнения задания должны быть изучены лекции 1 - 2","Внимание!", MessageBoxButtons::OK,MessageBoxIcon::Question);
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=11;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Labs/Lr2.rtf");
}
private: System::Void лабораторнаяРабота3ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show("Для выполнения задания должны быть изучены лекции 2 - 3","Внимание!", MessageBoxButtons::OK,MessageBoxIcon::Question);
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=12;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Labs/Lr3.rtf");
}
private: System::Void лабораторнаяРабота4ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show("Для выполнения задания должны быть изучены лекции 2 - 3","Внимание!", MessageBoxButtons::OK,MessageBoxIcon::Question);
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=13;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Labs/Lr4.rtf");
}
private: System::Void лабораторнаяРабота5ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show("Для выполнения задания должны быть изучены лекции 3 - 4","Внимание!", MessageBoxButtons::OK,MessageBoxIcon::Question);
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=14;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Labs/Lr5.rtf");
}
private: System::Void лабораторнаяРабота6ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show("Для выполнения задания должны быть изучены лекции 3 - 4","Внимание!", MessageBoxButtons::OK,MessageBoxIcon::Question);
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=15;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Labs/Lr6.rtf");
}
private: System::Void лабораторнаяРабота7ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
MessageBox::Show("Для выполнения задания должны быть изучены лекции 4 - 5","Внимание!", MessageBoxButtons::OK,MessageBoxIcon::Question);
this->groupBox1->Visible=false;
this->groupBox2->Visible=false;
this->groupBox3->Visible=false;
num=16;
this->richTextBox1->Visible=true;
this->richTextBox2->Visible=false;
this->button1->Visible=false;
this->radioButton1->Visible=false;
this->radioButton2->Visible=false;
this->radioButton3->Visible=false;
this->radioButton4->Visible=false;
this->label1->Visible=false;
this->richTextBox1->LoadFile(L"Labs/Lr7.rtf");
}
private: System::Void лабораторнаяРабота8ToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {