#pragma once #ifndef DEF_FORM #define DEF_FORM #include "dotnetInterface.h" #include "FormAddFile.h" namespace MPEG2_TS_Gui { 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 for Form1 /// /// WARNING: If you change the name of this class, you will need to change the /// 'Resource File Name' property for the managed resource compiler tool /// associated with all .resx files this class depends on. Otherwise, /// the designers will not be able to interact properly with localized /// resources associated with this form. /// ref class FormAddFile; public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// /// Clean up any resources being used. /// ~Form1() { if (components) { delete components; } } protected: public: FormAddFile^ fAddFile; private: System::Windows::Forms::GroupBox^ gBCatalogue; private: System::Windows::Forms::ListBox^ lBFileTS; private: System::Windows::Forms::Label^ lDescription; private:System::Windows::Forms::TextBox^ tBDescription; private: System::Windows::Forms::Button^ bAddTSFile; private: System::Windows::Forms::Button^ bRemoveTSFile; private: /// /// Required designer variable. /// System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// void InitializeComponent(void) { this->gBCatalogue = (gcnew System::Windows::Forms::GroupBox()); this->tBDescription = (gcnew System::Windows::Forms::TextBox()); this->lDescription = (gcnew System::Windows::Forms::Label()); this->lBFileTS = (gcnew System::Windows::Forms::ListBox()); this->bAddTSFile = (gcnew System::Windows::Forms::Button()); this->bRemoveTSFile = (gcnew System::Windows::Forms::Button()); this->gBCatalogue->SuspendLayout(); this->SuspendLayout(); // // gBCatalogue // this->gBCatalogue->Controls->Add(this->bRemoveTSFile); this->gBCatalogue->Controls->Add(this->bAddTSFile); this->gBCatalogue->Controls->Add(this->tBDescription); this->gBCatalogue->Controls->Add(this->lDescription); this->gBCatalogue->Controls->Add(this->lBFileTS); this->gBCatalogue->Location = System::Drawing::Point(18, 12); this->gBCatalogue->Name = L"gBCatalogue"; this->gBCatalogue->Size = System::Drawing::Size(273, 296); this->gBCatalogue->TabIndex = 0; this->gBCatalogue->TabStop = false; this->gBCatalogue->Text = L"Catalogue"; // // tBDescription // this->tBDescription->Enabled = false; this->tBDescription->Location = System::Drawing::Point(13, 106); this->tBDescription->Multiline = true; this->tBDescription->Name = L"tBDescription"; this->tBDescription->Size = System::Drawing::Size(241, 100); this->tBDescription->TabIndex = 2; // // lDescription // this->lDescription->AutoSize = true; this->lDescription->Location = System::Drawing::Point(14, 79); this->lDescription->Name = L"lDescription"; this->lDescription->Size = System::Drawing::Size(60, 13); this->lDescription->TabIndex = 1; this->lDescription->Text = L"Description"; // // lBFileTS // this->lBFileTS->FormattingEnabled = true; this->lBFileTS->Items->AddRange(gcnew cli::array< System::Object^ >(3) {L"P1-lake.m2t", L"P3-summer.m2t", L"PSI-NAB.m2t"}); this->lBFileTS->Location = System::Drawing::Point(13, 26); this->lBFileTS->Name = L"lBFileTS"; this->lBFileTS->Size = System::Drawing::Size(143, 30); this->lBFileTS->TabIndex = 0; this->lBFileTS->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::lBFileTS_SelectedIndexChanged); // // bAddTSFile // this->bAddTSFile->Location = System::Drawing::Point(15, 218); this->bAddTSFile->Name = L"bAddTSFile"; this->bAddTSFile->Size = System::Drawing::Size(105, 32); this->bAddTSFile->TabIndex = 3; this->bAddTSFile->Text = L"Add"; this->bAddTSFile->UseVisualStyleBackColor = true; this->bAddTSFile->Click += gcnew System::EventHandler(this, &Form1::bAddTSFile_Click); // // bRemoveTSFile // this->bRemoveTSFile->Location = System::Drawing::Point(146, 218); this->bRemoveTSFile->Name = L"bRemoveTSFile"; this->bRemoveTSFile->Size = System::Drawing::Size(108, 32); this->bRemoveTSFile->TabIndex = 4; this->bRemoveTSFile->Text = L"Remove"; this->bRemoveTSFile->UseVisualStyleBackColor = true; // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(756, 326); this->Controls->Add(this->gBCatalogue); this->Name = L"Form1"; this->Text = L"*MPEG2 Modelizer*"; this->gBCatalogue->ResumeLayout(false); this->gBCatalogue->PerformLayout(); this->ResumeLayout(false); } #pragma endregion static dotnetInterface^ dotnetInt = gcnew dotnetInterface(); // evenement click sur un nom du fichier TS va renvoyer la description instantanement private: System::Void lBFileTS_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) { this->tBDescription->Text = gcnew String(this->dotnetInt->GetCatalogueDescription(this->lBFileTS->SelectedIndex).c_str()); } private: System::Void bAddTSFile_Click(System::Object^ sender, System::EventArgs^ e) { this->fAddFile = gcnew FormAddFile(this); this->fAddFile->Show(); } }; } #endif