?? idlesseclassroom.h
字號(hào):
#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 文件關(guān)聯(lián)的托管資源編譯器工具的
/// “資源文件名”屬性。否則,
/// 設(shè)計(jì)器將不能與此窗體的關(guān)聯(lián)
/// 本地化資源正確交互。
/// </summary>
public ref class IdlesseClassRoom : public System::Windows::Forms::Form
{
public:
String^ picturePath;//圖片路徑
String^ filePath_Subject;//課表文件路徑
String^ filePath_State;//教室狀態(tài)文件路徑
Int32^ ClassRoomNumber;//教室的個(gè)數(shù),M樓 20個(gè),G樓5個(gè)
IdlesseClassRoom(void)
{
InitializeComponent();
DateIndex = -1;
TimeSegmentIndex = -1;
DateArray = gcnew array<String^>{"星期一","星期二","星期三","星期四",
"星期五","星期六","星期日"};
TimeSegmentArray = gcnew array<String^>{"上午第一大節(jié)","上午第二大節(jié)",
"下午第一大節(jié)","下午第二大節(jié)","晚上第一大節(jié)"};
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: 在此處添加構(gòu)造函數(shù)代碼
//
}
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>
/// 必需的設(shè)計(jì)器變量。
/// </summary>
System::ComponentModel::Container ^components;
array<String^>^ DateArray;//存放星期的數(shù)組
array<String^>^ TimeSegmentArray;//存放大節(jié)課數(shù)的數(shù)組
int DateIndex ;//返回星期的編號(hào),用在下拉菜單中
int TimeSegmentIndex ;//返回大課節(jié)數(shù)的編號(hào),下拉菜單中
FileRW^ file ;//讀取文件的對(duì)象
ArrayList^ IdlesseClassRoomList ;//存放空閑教室的數(shù)組列表
#pragma region Windows Form Designer generated code
/// <summary>
/// 設(shè)計(jì)器支持所需的方法 - 不要
/// 使用代碼編輯器修改此方法的內(nèi)容。
/// </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" 大課節(jié)數(shù)";
//
// 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" 星期編號(hào) ";
//
// 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"教學(xué)樓簡(jiǎn)介";
//
// 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樓位于主樓以西。仿照俄式風(fēng)格的外形,外觀酷似\r\n教堂一般作為學(xué)校的一個(gè)小型的多媒體教學(xué)樓,設(shè)施相\r\n對(duì)其它的教學(xué)樓要優(yōu)越,濃厚的學(xué)習(xí)氛圍勾勒出大家美\r\n好"
L"的前程。在這里,你可以享受上自習(xí)的樂(lè)趣,因?yàn)榇骪r\n家都埋頭于知識(shí)的海洋。此外,G樓202是全校設(shè)施最好\r\n的會(huì)場(chǎng)。凡重要會(huì)議、學(xué)術(shù)報(bào)告等基本都在這里舉行。\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
/*下拉菜單函數(shù)---選擇星期編號(hào),返回對(duì)應(yīng)的整數(shù)值*/
private: System::Void comboBox1_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) ;
/*下拉菜單函數(shù)---選擇大課節(jié)數(shù)編號(hào),返回對(duì)應(yīng)的整數(shù)值*/
private: System::Void comboBox2_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) ;
/*按鈕函數(shù)函數(shù)---根據(jù)用戶選擇的星期編號(hào)和大課節(jié)數(shù)編號(hào),查詢空閑教室*/
private: System::Void Button1_Click(System::Object^ sender, System::EventArgs^ e) ;
private: System::Void IdlesseClassRoom_Load(System::Object^ sender, System::EventArgs^ e) ;
//作為模板修改一些屬性的函數(shù)
public : void ChangeTabPageText(String^ text);
public : void AddTableText(String^ text);
//狀態(tài)初始化函數(shù)
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) {
}
};
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -