|
This is all the code of my interface in C++
#pragma once
namespace Interfatafinala {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::IO;
using namespace System::Globalization;
using namespace System::Text;
using namespace System::Collections::Generic;
using namespace System::Data::SqlClient;
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.
///
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;
}
}
private: System::Windows::Forms::MenuStrip^ menuStrip1;
protected:
private: System::Windows::Forms::ToolStripMenuItem^ fileToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ newToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ openToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator;
private: System::Windows::Forms::ToolStripMenuItem^ saveToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ saveAsToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator1;
private: System::Windows::Forms::ToolStripMenuItem^ printToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ printPreviewToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator2;
private: System::Windows::Forms::ToolStripMenuItem^ exitToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ editToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ undoToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ redoToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator3;
private: System::Windows::Forms::ToolStripMenuItem^ cutToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ copyToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ pasteToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator4;
private: System::Windows::Forms::ToolStripMenuItem^ selectAllToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ viewToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ benchmarksToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ toolsToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ customizeToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ optionsToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ helpToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ contentsToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator5;
private: System::Windows::Forms::ToolStripMenuItem^ aboutToolStripMenuItem;
private: System::Windows::Forms::ToolStrip^ toolStrip1;
private: System::Windows::Forms::ToolStripButton^ newToolStripButton;
private: System::Windows::Forms::ToolStripButton^ openToolStripButton;
private: System::Windows::Forms::ToolStripButton^ saveToolStripButton;
private: System::Windows::Forms::ToolStripButton^ printToolStripButton;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator6;
private: System::Windows::Forms::ToolStripButton^ cutToolStripButton;
private: System::Windows::Forms::ToolStripButton^ copyToolStripButton;
private: System::Windows::Forms::ToolStripButton^ pasteToolStripButton;
private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator7;
private: System::Windows::Forms::ToolStripButton^ helpToolStripButton;
private: System::Windows::Forms::StatusStrip^ statusStrip1;
private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel1;
private: System::Windows::Forms::ProgressBar^ progressBar1;
private: System::Windows::Forms::PictureBox^ TourDiagram;
private: System::Windows::Forms::Panel^ Output;
private: System::Windows::Forms::Button^ Start;
private: System::Windows::Forms::Button^ Stop;
private: System::Windows::Forms::Button^ Results;
private: System::Windows::Forms::Label^ CapacityLabel;
private: System::Windows::Forms::TextBox^ capacitytextbox;
private: System::Windows::Forms::OpenFileDialog^ openf;
private: System::Windows::Forms::OpenFileDialog^ sfdas;
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)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
this->fileToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->newToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->openToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator = (gcnew System::Windows::Forms::ToolStripSeparator());
this->saveToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->saveAsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->printToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->printPreviewToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->exitToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->editToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->undoToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->redoToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->cutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->copyToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->pasteToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator4 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->selectAllToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->viewToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->benchmarksToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->customizeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->optionsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->helpToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->contentsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripSeparator5 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->aboutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStrip1 = (gcnew System::Windows::Forms::ToolStrip());
this->newToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->openToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->saveToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->printToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->toolStripSeparator6 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->cutToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->copyToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->pasteToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->toolStripSeparator7 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->helpToolStripButton = (gcnew System::Windows::Forms::ToolStripButton());
this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
this->toolStripStatusLabel1 = (gcnew System::Windows::Forms::ToolStripStatusLabel());
this->progressBar1 = (gcnew System::Windows::Forms::ProgressBar());
this->TourDiagram = (gcnew System::Windows::Forms::PictureBox());
this->Output = (gcnew System::Windows::Forms::Panel());
this->Start = (gcnew System::Windows::Forms::Button());
this->Stop = (gcnew System::Windows::Forms::Button());
this->Results = (gcnew System::Windows::Forms::Button());
this->CapacityLabel = (gcnew System::Windows::Forms::Label());
this->capacitytextbox = (gcnew System::Windows::Forms::TextBox());
this->openf = (gcnew System::Windows::Forms::OpenFileDialog());
this->sfdas = (gcnew System::Windows::Forms::OpenFileDialog());
this->menuStrip1->SuspendLayout();
this->toolStrip1->SuspendLayout();
this->statusStrip1->SuspendLayout();
(cli::safe_cast<system::componentmodel::isupportinitialize^>(this->TourDiagram))->BeginInit();
this->SuspendLayout();
//
// menuStrip1
//
this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(5) {this->fileToolStripMenuItem,
this->editToolStripMenuItem, this->viewToolStripMenuItem, this->toolsToolStripMenuItem, this->helpToolStripMenuItem});
this->menuStrip1->Location = System::Drawing::Point(0, 0);
this->menuStrip1->Name = L"menuStrip1";
this->menuStrip1->Size = System::Drawing::Size(762, 24);
this->menuStrip1->TabIndex = 0;
this->menuStrip1->Text = L"menuStrip1";
//
// fileToolStripMenuItem
//
this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(10) {this->newToolStripMenuItem,
this->openToolStripMenuItem, this->toolStripSeparator, this->saveToolStripMenuItem, this->saveAsToolStripMenuItem, this->toolStripSeparator1,
this->printToolStripMenuItem, this->printPreviewToolStripMenuItem, this->toolStripSeparator2, this->exitToolStripMenuItem});
this->fileToolStripMenuItem->Name = L"fileToolStripMenuItem";
this->fileToolStripMenuItem->Size = System::Drawing::Size(35, 20);
this->fileToolStripMenuItem->Text = L"&File";
//
// newToolStripMenuItem
//
this->newToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"newToolStripMenuItem.Image")));
this->newToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->newToolStripMenuItem->Name = L"newToolStripMenuItem";
this->newToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::N));
this->newToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->newToolStripMenuItem->Text = L"&New";
this->newToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::newToolStripMenuItem_Click);
//
// openToolStripMenuItem
//
this->openToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"openToolStripMenuItem.Image")));
this->openToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->openToolStripMenuItem->Name = L"openToolStripMenuItem";
this->openToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys: ));
this->openToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->openToolStripMenuItem->Text = L"&Open";
this->openToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::openToolStripMenuItem_Click);
//
// toolStripSeparator
//
this->toolStripSeparator->Name = L"toolStripSeparator";
this->toolStripSeparator->Size = System::Drawing::Size(148, 6);
//
// saveToolStripMenuItem
//
this->saveToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"saveToolStripMenuItem.Image")));
this->saveToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->saveToolStripMenuItem->Name = L"saveToolStripMenuItem";
this->saveToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::S));
this->saveToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->saveToolStripMenuItem->Text = L"&Save";
this->saveToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::saveToolStripMenuItem_Click);
//
// saveAsToolStripMenuItem
//
this->saveAsToolStripMenuItem->Name = L"saveAsToolStripMenuItem";
this->saveAsToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->saveAsToolStripMenuItem->Text = L"Save &As";
this->saveAsToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::saveAsToolStripMenuItem_Click);
//
// toolStripSeparator1
//
this->toolStripSeparator1->Name = L"toolStripSeparator1";
this->toolStripSeparator1->Size = System::Drawing::Size(148, 6);
//
// printToolStripMenuItem
//
this->printToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"printToolStripMenuItem.Image")));
this->printToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->printToolStripMenuItem->Name = L"printToolStripMenuItem";
this->printToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::P));
this->printToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->printToolStripMenuItem->Text = L"&Print";
//
// printPreviewToolStripMenuItem
//
this->printPreviewToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"printPreviewToolStripMenuItem.Image")));
this->printPreviewToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->printPreviewToolStripMenuItem->Name = L"printPreviewToolStripMenuItem";
this->printPreviewToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->printPreviewToolStripMenuItem->Text = L"Print Pre&view";
//
// toolStripSeparator2
//
this->toolStripSeparator2->Name = L"toolStripSeparator2";
this->toolStripSeparator2->Size = System::Drawing::Size(148, 6);
//
// exitToolStripMenuItem
//
this->exitToolStripMenuItem->Name = L"exitToolStripMenuItem";
this->exitToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::F4));
this->exitToolStripMenuItem->Size = System::Drawing::Size(151, 22);
this->exitToolStripMenuItem->Text = L"E&xit";
this->exitToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::exitToolStripMenuItem_Click);
//
// editToolStripMenuItem
//
this->editToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(8) {this->undoToolStripMenuItem,
this->redoToolStripMenuItem, this->toolStripSeparator3, this->cutToolStripMenuItem, this->copyToolStripMenuItem, this->pasteToolStripMenuItem,
this->toolStripSeparator4, this->selectAllToolStripMenuItem});
this->editToolStripMenuItem->Name = L"editToolStripMenuItem";
this->editToolStripMenuItem->Size = System::Drawing::Size(37, 20);
this->editToolStripMenuItem->Text = L"&Edit";
//
// undoToolStripMenuItem
//
this->undoToolStripMenuItem->Name = L"undoToolStripMenuItem";
this->undoToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::Z));
this->undoToolStripMenuItem->Size = System::Drawing::Size(150, 22);
this->undoToolStripMenuItem->Text = L"&Undo";
//
// redoToolStripMenuItem
//
this->redoToolStripMenuItem->Name = L"redoToolStripMenuItem";
this->redoToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::Y));
this->redoToolStripMenuItem->Size = System::Drawing::Size(150, 22);
this->redoToolStripMenuItem->Text = L"&Redo";
//
// toolStripSeparator3
//
this->toolStripSeparator3->Name = L"toolStripSeparator3";
this->toolStripSeparator3->Size = System::Drawing::Size(147, 6);
//
// cutToolStripMenuItem
//
this->cutToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"cutToolStripMenuItem.Image")));
this->cutToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->cutToolStripMenuItem->Name = L"cutToolStripMenuItem";
this->cutToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::X));
this->cutToolStripMenuItem->Size = System::Drawing::Size(150, 22);
this->cutToolStripMenuItem->Text = L"Cu&t";
this->cutToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::cutToolStripMenuItem_Click);
//
// copyToolStripMenuItem
//
this->copyToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"copyToolStripMenuItem.Image")));
this->copyToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->copyToolStripMenuItem->Name = L"copyToolStripMenuItem";
this->copyToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::C));
this->copyToolStripMenuItem->Size = System::Drawing::Size(150, 22);
this->copyToolStripMenuItem->Text = L"&Copy";
this->copyToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::copyToolStripMenuItem_Click);
//
// pasteToolStripMenuItem
//
this->pasteToolStripMenuItem->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"pasteToolStripMenuItem.Image")));
this->pasteToolStripMenuItem->ImageTransparentColor = System::Drawing::Color::Magenta;
this->pasteToolStripMenuItem->Name = L"pasteToolStripMenuItem";
this->pasteToolStripMenuItem->ShortcutKeys = static_cast<system::windows::forms::keys>((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::V));
this->pasteToolStripMenuItem->Size = System::Drawing::Size(150, 22);
this->pasteToolStripMenuItem->Text = L"&Paste";
this->pasteToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::pasteToolStripMenuItem_Click);
//
// toolStripSeparator4
//
this->toolStripSeparator4->Name = L"toolStripSeparator4";
this->toolStripSeparator4->Size = System::Drawing::Size(147, 6);
//
// selectAllToolStripMenuItem
//
this->selectAllToolStripMenuItem->Name = L"selectAllToolStripMenuItem";
this->selectAllToolStripMenuItem->Size = System::Drawing::Size(150, 22);
this->selectAllToolStripMenuItem->Text = L"Select &All";
//
// viewToolStripMenuItem
//
this->viewToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) {this->benchmarksToolStripMenuItem});
this->viewToolStripMenuItem->Name = L"viewToolStripMenuItem";
this->viewToolStripMenuItem->Size = System::Drawing::Size(41, 20);
this->viewToolStripMenuItem->Text = L"View";
//
// benchmarksToolStripMenuItem
//
this->benchmarksToolStripMenuItem->Name = L"benchmarksToolStripMenuItem";
this->benchmarksToolStripMenuItem->Size = System::Drawing::Size(142, 22);
this->benchmarksToolStripMenuItem->Text = L"Benchmarks";
//
// toolsToolStripMenuItem
//
this->toolsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->customizeToolStripMenuItem,
this->optionsToolStripMenuItem});
this->toolsToolStripMenuItem->Name = L"toolsToolStripMenuItem";
this->toolsToolStripMenuItem->Size = System::Drawing::Size(44, 20);
this->toolsToolStripMenuItem->Text = L"&Tools";
//
// customizeToolStripMenuItem
//
this->customizeToolStripMenuItem->Name = L"customizeToolStripMenuItem";
this->customizeToolStripMenuItem->Size = System::Drawing::Size(134, 22);
this->customizeToolStripMenuItem->Text = L"&Customize";
//
// optionsToolStripMenuItem
//
this->optionsToolStripMenuItem->Name = L"optionsToolStripMenuItem";
this->optionsToolStripMenuItem->Size = System::Drawing::Size(134, 22);
this->optionsToolStripMenuItem->Text = L"&Options";
//
// helpToolStripMenuItem
//
this->helpToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(3) {this->contentsToolStripMenuItem,
this->toolStripSeparator5, this->aboutToolStripMenuItem});
this->helpToolStripMenuItem->Name = L"helpToolStripMenuItem";
this->helpToolStripMenuItem->Size = System::Drawing::Size(40, 20);
this->helpToolStripMenuItem->Text = L"&Help";
//
// contentsToolStripMenuItem
//
this->contentsToolStripMenuItem->Name = L"contentsToolStripMenuItem";
this->contentsToolStripMenuItem->Size = System::Drawing::Size(129, 22);
this->contentsToolStripMenuItem->Text = L"&Contents";
//
// toolStripSeparator5
//
this->toolStripSeparator5->Name = L"toolStripSeparator5";
this->toolStripSeparator5->Size = System::Drawing::Size(126, 6);
//
// aboutToolStripMenuItem
//
this->aboutToolStripMenuItem->Name = L"aboutToolStripMenuItem";
this->aboutToolStripMenuItem->Size = System::Drawing::Size(129, 22);
this->aboutToolStripMenuItem->Text = L"&About...";
//
// toolStrip1
//
this->toolStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(10) {this->newToolStripButton,
this->openToolStripButton, this->saveToolStripButton, this->printToolStripButton, this->toolStripSeparator6, this->cutToolStripButton,
this->copyToolStripButton, this->pasteToolStripButton, this->toolStripSeparator7, this->helpToolStripButton});
this->toolStrip1->Location = System::Drawing::Point(0, 24);
this->toolStrip1->Name = L"toolStrip1";
this->toolStrip1->Size = System::Drawing::Size(762, 25);
this->toolStrip1->TabIndex = 1;
this->toolStrip1->Text = L"toolStrip1";
//
// newToolStripButton
//
this->newToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->newToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"newToolStripButton.Image")));
this->newToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->newToolStripButton->Name = L"newToolStripButton";
this->newToolStripButton->Size = System::Drawing::Size(23, 22);
this->newToolStripButton->Text = L"&New";
this->newToolStripButton->Click += gcnew System::EventHandler(this, &Form1::newToolStripButton_Click);
//
// openToolStripButton
//
this->openToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->openToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"openToolStripButton.Image")));
this->openToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->openToolStripButton->Name = L"openToolStripButton";
this->openToolStripButton->Size = System::Drawing::Size(23, 22);
this->openToolStripButton->Text = L"&Open";
this->openToolStripButton->Click += gcnew System::EventHandler(this, &Form1::openToolStripButton_Click);
//
// saveToolStripButton
//
this->saveToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->saveToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"saveToolStripButton.Image")));
this->saveToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->saveToolStripButton->Name = L"saveToolStripButton";
this->saveToolStripButton->Size = System::Drawing::Size(23, 22);
this->saveToolStripButton->Text = L"&Save";
this->saveToolStripButton->Click += gcnew System::EventHandler(this, &Form1::saveToolStripButton_Click);
//
// printToolStripButton
//
this->printToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->printToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"printToolStripButton.Image")));
this->printToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->printToolStripButton->Name = L"printToolStripButton";
this->printToolStripButton->Size = System::Drawing::Size(23, 22);
this->printToolStripButton->Text = L"&Print";
//
// toolStripSeparator6
//
this->toolStripSeparator6->Name = L"toolStripSeparator6";
this->toolStripSeparator6->Size = System::Drawing::Size(6, 25);
//
// cutToolStripButton
//
this->cutToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->cutToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"cutToolStripButton.Image")));
this->cutToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->cutToolStripButton->Name = L"cutToolStripButton";
this->cutToolStripButton->Size = System::Drawing::Size(23, 22);
this->cutToolStripButton->Text = L"C&ut";
this->cutToolStripButton->Click += gcnew System::EventHandler(this, &Form1::cutToolStripButton_Click);
//
// copyToolStripButton
//
this->copyToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->copyToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"copyToolStripButton.Image")));
this->copyToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->copyToolStripButton->Name = L"copyToolStripButton";
this->copyToolStripButton->Size = System::Drawing::Size(23, 22);
this->copyToolStripButton->Text = L"&Copy";
this->copyToolStripButton->Click += gcnew System::EventHandler(this, &Form1::copyToolStripButton_Click);
//
// pasteToolStripButton
//
this->pasteToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->pasteToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"pasteToolStripButton.Image")));
this->pasteToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->pasteToolStripButton->Name = L"pasteToolStripButton";
this->pasteToolStripButton->Size = System::Drawing::Size(23, 22);
this->pasteToolStripButton->Text = L"&Paste";
this->pasteToolStripButton->Click += gcnew System::EventHandler(this, &Form1::pasteToolStripButton_Click);
//
// toolStripSeparator7
//
this->toolStripSeparator7->Name = L"toolStripSeparator7";
this->toolStripSeparator7->Size = System::Drawing::Size(6, 25);
//
// helpToolStripButton
//
this->helpToolStripButton->DisplayStyle = System::Windows::Forms::ToolStripItemDisplayStyle::Image;
this->helpToolStripButton->Image = (cli::safe_cast<system::drawing::image^>(resources->GetObject(L"helpToolStripButton.Image")));
this->helpToolStripButton->ImageTransparentColor = System::Drawing::Color::Magenta;
this->helpToolStripButton->Name = L"helpToolStripButton";
this->helpToolStripButton->Size = System::Drawing::Size(23, 22);
this->helpToolStripButton->Text = L"He&lp";
//
// statusStrip1
//
this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(1) {this->toolStripStatusLabel1});
this->statusStrip1->Location = System::Drawing::Point(0, 578);
this->statusStrip1->Name = L"statusStrip1";
this->statusStrip1->Size = System::Drawing::Size(762, 22);
this->statusStrip1->TabIndex = 2;
this->statusStrip1->Text = L"statusStrip1";
//
// toolStripStatusLabel1
//
this->toolStripStatusLabel1->Name = L"toolStripStatusLabel1";
this->toolStripStatusLabel1->Size = System::Drawing::Size(235, 17);
this->toolStripStatusLabel1->Text = L"Open a City List or click the map to place cities. ";
//
// progressBar1
//
this->progressBar1->Anchor = static_cast<system::windows::forms::anchorstyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Right));
this->progressBar1->Location = System::Drawing::Point(659, 584);
this->progressBar1->Name = L"progressBar1";
this->progressBar1->Size = System::Drawing::Size(91, 16);
this->progressBar1->TabIndex = 3;
//
// TourDiagram
//
this->TourDiagram->Anchor = static_cast<system::windows::forms::anchorstyles>((((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Bottom)
| System::Windows::Forms::AnchorStyles::Left)
| System::Windows::Forms::AnchorStyles::Right));
this->TourDiagram->BackColor = System::Drawing::SystemColors::ActiveCaptionText;
this->TourDiagram->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->TourDiagram->Location = System::Drawing::Point(8, 52);
this->TourDiagram->Name = L"TourDiagram";
this->TourDiagram->Size = System::Drawing::Size(618, 339);
this->TourDiagram->TabIndex = 4;
this->TourDiagram->TabStop = false;
//
// Output
//
this->Output->Anchor = static_cast<system::windows::forms::anchorstyles>(((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Left)
| System::Windows::Forms::AnchorStyles::Right));
this->Output->BackColor = System::Drawing::SystemColors::ActiveCaptionText;
this->Output->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->Output->Location = System::Drawing::Point(8, 397);
this->Output->Name = L"Output";
this->Output->Size = System::Drawing::Size(617, 181);
this->Output->TabIndex = 5;
//
// Start
//
this->Start->Anchor = static_cast<system::windows::forms::anchorstyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Right));
this->Start->Location = System::Drawing::Point(654, 479);
this->Start->Name = L"Start";
this->Start->Size = System::Drawing::Size(97, 27);
this->Start->TabIndex = 6;
this->Start->Text = L"Start";
this->Start->UseVisualStyleBackColor = true;
this->Start->Click += gcnew System::EventHandler(this, &Form1::Start_Click);
//
// Stop
//
this->Stop->Anchor = static_cast<system::windows::forms::anchorstyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Right));
this->Stop->Location = System::Drawing::Point(654, 512);
this->Stop->Name = L"Stop";
this->Stop->Size = System::Drawing::Size(96, 27);
this->Stop->TabIndex = 7;
this->Stop->Text = L"Stop";
this->Stop->UseVisualStyleBackColor = true;
//
// Results
//
this->Results->Anchor = static_cast<system::windows::forms::anchorstyles>((System::Windows::Forms::AnchorStyles::Bottom | System::Windows::Forms::AnchorStyles::Right));
this->Results->Location = System::Drawing::Point(654, 545);
this->Results->Name = L"Results";
this->Results->Size = System::Drawing::Size(96, 23);
this->Results->TabIndex = 8;
this->Results->Text = L"Results";
this->Results->UseVisualStyleBackColor = true;
this->Results->Click += gcnew System::EventHandler(this, &Form1::Results_Click);
//
// CapacityLabel
//
this->CapacityLabel->Anchor = static_cast<system::windows::forms::anchorstyles>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
this->CapacityLabel->AutoSize = true;
this->CapacityLabel->Location = System::Drawing::Point(655, 71);
this->CapacityLabel->Name = L"CapacityLabel";
this->CapacityLabel->Size = System::Drawing::Size(86, 13);
this->CapacityLabel->TabIndex = 9;
this->CapacityLabel->Text = L"Vehicle Capacity";
//
// capacitytextbox
//
this->capacitytextbox->Anchor = static_cast<system::windows::forms::anchorstyles>((System::Windows::Forms::AnchorStyles::Top | System::Windows::Forms::AnchorStyles::Right));
this->capacitytextbox->Location = System::Drawing::Point(659, 87);
this->capacitytextbox->Name = L"capacitytextbox";
this->capacitytextbox->Size = System::Drawing::Size(65, 20);
this->capacitytextbox->TabIndex = 10;
this->capacitytextbox->Text = L"100";
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(762, 600);
this->Controls->Add(this->capacitytextbox);
this->Controls->Add(this->CapacityLabel);
this->Controls->Add(this->Results);
this->Controls->Add(this->Stop);
this->Controls->Add(this->Start);
this->Controls->Add(this->Output);
this->Controls->Add(this->TourDiagram);
this->Controls->Add(this->progressBar1);
this->Controls->Add(this->statusStrip1);
this->Controls->Add(this->toolStrip1);
this->Controls->Add(this->menuStrip1);
this->MainMenuStrip = this->menuStrip1;
this->Name = L"Form1";
this->Text = L"Vehicle Routing Problem";
this->menuStrip1->ResumeLayout(false);
this->menuStrip1->PerformLayout();
this->toolStrip1->ResumeLayout(false);
this->toolStrip1->PerformLayout();
this->statusStrip1->ResumeLayout(false);
this->statusStrip1->PerformLayout();
(cli::safe_cast<system::componentmodel::isupportinitialize^>(this->TourDiagram))->EndInit();
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
Stream^ myStream;
String^ filename;
//////// Region Declaration MenuItem
private: System::Void newToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
String^ currentFile;
try
{
if (currentFile == "")
{
System::Windows::Forms::DialogResult answer;
answer = MessageBox::Show("Save current document before creating new document?", "Unsaved Document", MessageBoxButtons::YesNo, MessageBoxIcon::Question);
if (answer == System::Windows::Forms::DialogResult::No)
{
currentFile = "";
return;
}
else
{
saveToolStripMenuItem_Click(this, gcnew EventArgs());
currentFile = "";
return;
}
}
else
{
currentFile = "";
return;
}
}
catch (Exception^ ex)
{
MessageBox::Show(ex->Message->ToString(), "Error");
}
}
private: System::Void openToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
String^ ofd;
OpenFileDialog^ openf = gcnew OpenFileDialog();
openf->Title = "Open file";
openf->InitialDirectory = "C:\\";
openf->Filter = "TSP Files (*.tsp)|*.tsp|All files (*.*)|*.*|XML Files (*.xml)|*.xml|Text Files (*.txt)|*.txt";
openf->FilterIndex = 2;
openf->RestoreDirectory = true;
if ((openf->ShowDialog())== System::Windows::Forms::DialogResult::OK)
{
// txtContents.Load(openf->FileName);
//textBox1.Text = openf->FileName;
}
//MessageBox.Show(String.Format("Filen skapades: {0}", File.GetCreationTime(textBox1.Text)));
ofd = openf->FileName;
try
{
}
catch (System::IO::FileNotFoundException())
{
MessageBox::Show("File not found: " + ofd, "Error", MessageBoxButtons::OK, MessageBoxIcon::Error, MessageBoxDefaultButton::Button1);
}
catch (System::InvalidCastException())
{
MessageBox::Show("Cities XML file is not valid", "Error", MessageBoxButtons::OK, MessageBoxIcon::Error, MessageBoxDefaultButton::Button1);
}
}
private: System::Void saveToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
/*using (FileStream f = new FileStream(sfd.FileName, FileMode.Create, FileAccess.Write))
{
// scribbleBox1.Document.Save(f);
}
*/
SaveFileDialog^ sfd = gcnew SaveFileDialog();
sfd->InitialDirectory = "c:\\";
sfd->DefaultExt = ".xml";
sfd->Filter = "TSP Files (*.tsp)|*.tsp|All files (*.*)|*.*|XML Files (*.xml)|*.xml|Text Files (*.txt)|*.txt";
sfd->Title = "Save";
sfd->RestoreDirectory = true;
if (sfd->ShowDialog() == System::Windows::Forms::DialogResult::OK)
{
if ((myStream = sfd->OpenFile()) != nullptr)
{
// Code to write the stream goes here.
myStream->Close();
}
}
filename = sfd->FileName;
}
private: System::Void saveAsToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
/*using (FileStream f = new FileStream(sfd.FileName, FileMode.Create, FileAccess.Write))
{
// scribbleBox1.Document.Save(f);
}
*/
SaveFileDialog^ sfdas = gcnew SaveFileDialog();
sfdas->InitialDirectory = "c:\\";
sfdas->Filter = "TSP Files (*.tsp)|*.tsp|All files (*.*)|*.*|XML Files (*.xml)|*.xml|Text Files (*.txt)|*.txt";
sfdas->FilterIndex = 2;
sfdas->FileName = filename;
sfdas->Title = "Save As...";
sfdas->RestoreDirectory = true;
sfdas->OverwritePrompt = true;
sfdas->CreatePrompt = true;
System::Windows::Forms::DialogResult dia = sfdas->ShowDialog();
if (dia != System::Windows::Forms::DialogResult::OK)
return;
}
private: System::Void exitToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
/*if (filename.modified == true)
{
MessageBox.Show("Save this document before closing?", "Unsaved document", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (System.Windows.Forms.DialogResult.Yes)
{
return;
}
else
{
filename.modified == false;
Application.Exit();
}
}
else
{
filename.modified == false;
Application.Exit();
}*/
Application::Exit();
}
private: System::Void cutToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
Clipboard::Clear();
Clipboard::SetText(this->ActiveControl->Text);
this->ActiveControl->Text = "";
}
private: System::Void copyToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
Clipboard::Clear();
Clipboard::SetText(this->ActiveControl->Text);
}
private: System::Void pasteToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e)
{
this->ActiveControl->Text = Clipboard::GetText();
}
//// Sfarsit Region Declaration MenuItem
///// Region Declaratia Butoane
private: System::Void Start_Click(System::Object^ sender, System::EventArgs^ e)
{
int vehiclecapacity = 0;
try
{
vehiclecapacity = Convert::ToInt32(capacitytextbox->Text, CultureInfo::CurrentCulture);
}
catch (System::FormatException())
{
}
if (vehiclecapacity <= 0)
{
MessageBox::Show("You must specify a Vehicle Capacity greater then 0", "Error", MessageBoxButtons::OK, MessageBoxIcon::Error, MessageBoxDefaultButton::Button1/*, MessageBoxOptions.DefaultDesktopOnly*/);
return;
}
}
///// Sfarsit Regiune Declaratie Butoane
////////////#region Toolbar Methods
private: System::Void newToolStripButton_Click(System::Object^ sender, System::EventArgs^ e)
{
newToolStripMenuItem_Click(this, e);
}
private: System::Void openToolStripButton_Click(System::Object^ sender, System::EventArgs^ e)
{
openToolStripMenuItem_Click(this, e);
}
private: System::Void saveToolStripButton_Click(System::Object^ sender, System::EventArgs^ e)
{
saveToolStripMenuItem_Click(this, e);
}
private: System::Void cutToolStripButton_Click(System::Object^ sender, System::EventArgs^ e)
{
cutToolStripMenuItem_Click(this, e);
}
private: System::Void copyToolStripButton_Click(System::Object^ sender, System::EventArgs^ e)
{
copyToolStripMenuItem_Click(this, e);
}
private: System::Void pasteToolStripButton_Click(System::Object^ sender, System::EventArgs^ e)
{
pasteToolStripMenuItem_Click(this, e);
}
//////////// Sfarsit #region Toolbar Methods
private: System::Void Results_Click(System::Object^ sender, System::EventArgs^ e)
{
}
};
}
|
|
|
|