📄 idlesseclassroom.h
字号:
#pragma once
#include "FileRW.h"
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::IO;
namespace ClassRoom {
/// <summary>
/// IdlesseClassRoom 摘要
///
/// 警告: 如果更改此类的名称,则需要更改
/// 与此类所依赖的所有 .resx 文件关联的托管资源编译器工具的
/// “资源文件名”属性。否则,
/// 设计器将不能与此窗体的关联
/// 本地化资源正确交互。
/// </summary>
public ref class IdlesseClassRoom : public System::Windows::Forms::Form
{
public:
String^ picturePath;//图片路径
String^ filePath_Subject;//课表文件路径
String^ filePath_State;//教室状态文件路径
Int32^ ClassRoomNumber;//教室的个数,M楼 20个,G楼5个
IdlesseClassRoom(void)
{
InitializeComponent();
DateIndex = -1;
TimeSegmentIndex = -1;
DateArray = gcnew array<String^>{"星期一","星期二","星期三","星期四",
"星期五","星期六","星期日"};
TimeSegmentArray = gcnew array<String^>{"上午第一大节","上午第二大节",
"下午第一大节","下午第二大节","晚上第一大节"};
this->comboBox1->Items->AddRange( DateArray );
this->comboBox2->Items->AddRange( TimeSegmentArray );
file = gcnew FileRW();
filePath_Subject = gcnew String("");
filePath_State = gcnew String("");
/*String^ CurrTime = gcnew String("");
CurrTime = Convert::ToString(System::DateTime::Now::get());
array<Char>^c = gcnew array<Char>(10);
StreamWriter^ sw = gcnew StreamWriter( ".\\Data\\systemTime.txt" );
try
{
sw->Write(CurrTime->Substring(0,10));
}
finally
{
delete sw;
}*/
//
//TODO: 在此处添加构造函数代码
//
}
protected:
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
~IdlesseClassRoom()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::TabPage^ tabPage1;
private: System::Windows::Forms::TabPage^ tabPage2;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::ComboBox^ comboBox1;
private: System::Windows::Forms::DataGridView^ dataGridView1;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::ComboBox^ comboBox2;
private: System::Windows::Forms::GroupBox^ groupBox1;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::DataGridViewTextBoxColumn^ Column1;
private: System::Windows::Forms::PictureBox^ pictureBox1;
private: System::Windows::Forms::TabControl^ tabControl1;
private:
/// <summary>
/// 必需的设计器变量。
/// </summary>
System::ComponentModel::Container ^components;
array<String^>^ DateArray;//存放星期的数组
array<String^>^ TimeSegmentArray;//存放大节课数的数组
int DateIndex ;//返回星期的编号,用在下拉菜单中
int TimeSegmentIndex ;//返回大课节数的编号,下拉菜单中
FileRW^ file ;//读取文件的对象
ArrayList^ IdlesseClassRoomList ;//存放空闲教室的数组列表
#pragma region Windows Form Designer generated code
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
void InitializeComponent(void)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(IdlesseClassRoom::typeid));
this->tabControl1 = (gcnew System::Windows::Forms::TabControl());
this->tabPage1 = (gcnew System::Windows::Forms::TabPage());
this->button1 = (gcnew System::Windows::Forms::Button());
this->label2 = (gcnew System::Windows::Forms::Label());
this->comboBox2 = (gcnew System::Windows::Forms::ComboBox());
this->label1 = (gcnew System::Windows::Forms::Label());
this->comboBox1 = (gcnew System::Windows::Forms::ComboBox());
this->dataGridView1 = (gcnew System::Windows::Forms::DataGridView());
this->Column1 = (gcnew System::Windows::Forms::DataGridViewTextBoxColumn());
this->tabPage2 = (gcnew System::Windows::Forms::TabPage());
this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
this->label3 = (gcnew System::Windows::Forms::Label());
this->tabControl1->SuspendLayout();
this->tabPage1->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->dataGridView1))->BeginInit();
this->tabPage2->SuspendLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->pictureBox1))->BeginInit();
this->groupBox1->SuspendLayout();
this->SuspendLayout();
//
// tabControl1
//
this->tabControl1->Controls->Add(this->tabPage1);
this->tabControl1->Controls->Add(this->tabPage2);
this->tabControl1->Location = System::Drawing::Point(5, 5);
this->tabControl1->Name = L"tabControl1";
this->tabControl1->SelectedIndex = 0;
this->tabControl1->Size = System::Drawing::Size(453, 400);
this->tabControl1->TabIndex = 0;
//
// tabPage1
//
this->tabPage1->BackgroundImage = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"tabPage1.BackgroundImage")));
this->tabPage1->Controls->Add(this->button1);
this->tabPage1->Controls->Add(this->label2);
this->tabPage1->Controls->Add(this->comboBox2);
this->tabPage1->Controls->Add(this->label1);
this->tabPage1->Controls->Add(this->comboBox1);
this->tabPage1->Controls->Add(this->dataGridView1);
this->tabPage1->Location = System::Drawing::Point(4, 21);
this->tabPage1->Name = L"tabPage1";
this->tabPage1->Padding = System::Windows::Forms::Padding(3);
this->tabPage1->Size = System::Drawing::Size(445, 375);
this->tabPage1->TabIndex = 0;
this->tabPage1->Text = L" 全部查询 ";
this->tabPage1->UseVisualStyleBackColor = true;
this->tabPage1->Click += gcnew System::EventHandler(this, &IdlesseClassRoom::tabPage1_Click);
//
// button1
//
this->button1->Location = System::Drawing::Point(270, 222);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(75, 23);
this->button1->TabIndex = 5;
this->button1->Text = L" 查询 ";
this->button1->UseVisualStyleBackColor = true;
this->button1->Click += gcnew System::EventHandler(this, &IdlesseClassRoom::Button1_Click);
//
// label2
//
this->label2->AutoSize = true;
this->label2->Font = (gcnew System::Drawing::Font(L"宋体", 10.5F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(134)));
this->label2->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
static_cast<System::Int32>(static_cast<System::Byte>(0)));
this->label2->Location = System::Drawing::Point(229, 97);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(70, 14);
this->label2->TabIndex = 4;
this->label2->Text = L" 大课节数";
//
// comboBox2
//
this->comboBox2->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
this->comboBox2->FormattingEnabled = true;
this->comboBox2->Location = System::Drawing::Point(316, 90);
this->comboBox2->Name = L"comboBox2";
this->comboBox2->Size = System::Drawing::Size(99, 20);
this->comboBox2->TabIndex = 3;
this->comboBox2->SelectedIndexChanged += gcnew System::EventHandler(this, &IdlesseClassRoom::comboBox2_SelectedIndexChanged);
//
// label1
//
this->label1->AutoSize = true;
this->label1->Font = (gcnew System::Drawing::Font(L"宋体", 10.5F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(134)));
this->label1->ForeColor = System::Drawing::SystemColors::HotTrack;
this->label1->Location = System::Drawing::Point(226, 32);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(77, 14);
this->label1->TabIndex = 2;
this->label1->Text = L" 星期编号 ";
//
// comboBox1
//
this->comboBox1->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;
this->comboBox1->FormattingEnabled = true;
this->comboBox1->Location = System::Drawing::Point(316, 29);
this->comboBox1->Name = L"comboBox1";
this->comboBox1->Size = System::Drawing::Size(99, 20);
this->comboBox1->TabIndex = 1;
this->comboBox1->SelectedIndexChanged += gcnew System::EventHandler(this, &IdlesseClassRoom::comboBox1_SelectedIndexChanged);
//
// dataGridView1
//
this->dataGridView1->ColumnHeadersHeightSizeMode = System::Windows::Forms::DataGridViewColumnHeadersHeightSizeMode::AutoSize;
this->dataGridView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::DataGridViewColumn^ >(1) {this->Column1});
this->dataGridView1->Location = System::Drawing::Point(15, 26);
this->dataGridView1->Name = L"dataGridView1";
this->dataGridView1->RowTemplate->Height = 23;
this->dataGridView1->Size = System::Drawing::Size(143, 287);
this->dataGridView1->TabIndex = 0;
//
// Column1
//
this->Column1->HeaderText = L" 空闲教室 ";
this->Column1->Name = L"Column1";
this->Column1->ReadOnly = true;
//
// tabPage2
//
this->tabPage2->Controls->Add(this->pictureBox1);
this->tabPage2->Controls->Add(this->groupBox1);
this->tabPage2->Location = System::Drawing::Point(4, 21);
this->tabPage2->Name = L"tabPage2";
this->tabPage2->Padding = System::Windows::Forms::Padding(3);
this->tabPage2->Size = System::Drawing::Size(445, 375);
this->tabPage2->TabIndex = 1;
this->tabPage2->Text = L" 制定教室查询";
this->tabPage2->UseVisualStyleBackColor = true;
//
// pictureBox1
//
this->pictureBox1->BackgroundImage = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"pictureBox1.BackgroundImage")));
this->pictureBox1->Location = System::Drawing::Point(16, 136);
this->pictureBox1->Name = L"pictureBox1";
this->pictureBox1->Size = System::Drawing::Size(404, 233);
this->pictureBox1->TabIndex = 1;
this->pictureBox1->TabStop = false;
this->pictureBox1->Click += gcnew System::EventHandler(this, &IdlesseClassRoom::pictureBox1_Click);
//
// groupBox1
//
this->groupBox1->Controls->Add(this->label3);
this->groupBox1->Location = System::Drawing::Point(16, 14);
this->groupBox1->Name = L"groupBox1";
this->groupBox1->Size = System::Drawing::Size(404, 116);
this->groupBox1->TabIndex = 0;
this->groupBox1->TabStop = false;
this->groupBox1->Text = L"教学楼简介";
//
// label3
//
this->label3->AutoSize = true;
this->label3->Font = (gcnew System::Drawing::Font(L"宋体", 10.5F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast<System::Byte>(134)));
this->label3->Location = System::Drawing::Point(16, 17);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(343, 98);
this->label3->TabIndex = 0;
this->label3->Text = L" G楼位于主楼以西。仿照俄式风格的外形,外观酷似\r\n教堂一般作为学校的一个小型的多媒体教学楼,设施相\r\n对其它的教学楼要优越,浓厚的学习氛围勾勒出大家美\r\n好"
L"的前程。在这里,你可以享受上自习的乐趣,因为大\r\n家都埋头于知识的海洋。此外,G楼202是全校设施最好\r\n的会场。凡重要会议、学术报告等基本都在这里举行。\r\n\r"
L"\n";
//
// IdlesseClassRoom
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 12);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(461, 417);
this->Controls->Add(this->tabControl1);
this->Name = L"IdlesseClassRoom";
this->Text = L"空闲教室查询";
this->Load += gcnew System::EventHandler(this, &IdlesseClassRoom::IdlesseClassRoom_Load);
this->tabControl1->ResumeLayout(false);
this->tabPage1->ResumeLayout(false);
this->tabPage1->PerformLayout();
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->dataGridView1))->EndInit();
this->tabPage2->ResumeLayout(false);
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->pictureBox1))->EndInit();
this->groupBox1->ResumeLayout(false);
this->groupBox1->PerformLayout();
this->ResumeLayout(false);
}
#pragma endregion
/*下拉菜单函数---选择星期编号,返回对应的整数值*/
private: System::Void comboBox1_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) ;
/*下拉菜单函数---选择大课节数编号,返回对应的整数值*/
private: System::Void comboBox2_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) ;
/*按钮函数函数---根据用户选择的星期编号和大课节数编号,查询空闲教室*/
private: System::Void Button1_Click(System::Object^ sender, System::EventArgs^ e) ;
private: System::Void IdlesseClassRoom_Load(System::Object^ sender, System::EventArgs^ e) ;
//作为模板修改一些属性的函数
public : void ChangeTabPageText(String^ text);
public : void AddTableText(String^ text);
//状态初始化函数
public : void InitializeRoomState() ;
private: System::Void pictureBox1_Click(System::Object^ sender, System::EventArgs^ e) {
this->pictureBox1->Load(picturePath);
}
private: System::Void tabPage1_Click(System::Object^ sender, System::EventArgs^ e) {
}
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -