Rev 1 | Rev 193 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#pragma onceusing namespace System;using namespace System::ComponentModel;using namespace System::Collections;using namespace System::Windows::Forms;using namespace System::Data;using namespace System::Drawing;namespace Creator {/// <summary>/// Summary for CustomiseTurret/// </summary>public ref class CustomiseTurret : public System::Windows::Forms::UserControl{public:CustomiseTurret(Windows::Forms::Form ^parent, ImageList ^imagesSmall, ImageList ^imagesLarge, CyStringList *pModels, CShipData *shipData, CXspFile *shipFile){InitializeComponent();this->ListTurret->SmallImageList = imagesSmall;this->ListTurret->LargeImageList = imagesLarge;m_pCurrentCockpit = NULL;m_pParent = parent;m_pModels = pModels;m_pShipData = shipData;m_pShipFile = shipFile;m_bUpdateing = false;this->SetupControls();}void AddGameEntry(String ^game) { this->ComboGameCockpit->Items->Add(game); }String ^GetPosition(int dir);void SetupControlsEnd();void SetupControls();void UpdateDisplay();void UpdateTurrets();void UpdateCockpitDisplay();void UpdateCockpitDisplay2();void UpdateCockpitWeaponsList();void UpdateCockpits();String ^EditTurret(int id);void EditTurret(ListViewItem ^item);void SaveCockpitWeaponsList();protected:ListViewItem ^m_pSelectedItem;bool m_bUpdateing;CyStringList *m_pModels;CXspFile *m_pShipFile;CShipData *m_pShipData;Windows::Forms::Form ^m_pParent;SCockpit *m_pCurrentCockpit;/// <summary>/// Clean up any resources being used./// </summary>~CustomiseTurret(){if (components){delete components;}}private:/// <summary>/// Required designer variable./// </summary>private: System::ComponentModel::IContainer^ components;private: System::Windows::Forms::GroupBox^ GroupCockpit;private: System::Windows::Forms::Panel^ PanelCockpit;private: System::Windows::Forms::ListView^ ListWeaponCockpit;private: System::Windows::Forms::ColumnHeader^ columnHeader7;private: System::Windows::Forms::ColumnHeader^ columnHeader8;private: System::Windows::Forms::Panel^ panel39;private: System::Windows::Forms::ComboBox^ ComboGameCockpit;private: System::Windows::Forms::CheckBox^ CheckWeaponDefaultCockpit;private: System::Windows::Forms::Label^ label54;private: System::Windows::Forms::Panel^ panel38;private: System::Windows::Forms::TextBox^ TextCockpitScene;private: System::Windows::Forms::Label^ label53;private: System::Windows::Forms::Panel^ panel37;private: System::Windows::Forms::ComboBox^ ComboCockpitCustom;private: System::Windows::Forms::Button^ ButNewCockpit;private: System::Windows::Forms::RadioButton^ RadioCockpitCustom;private: System::Windows::Forms::Panel^ panel35;private: System::Windows::Forms::ComboBox^ ComboCockpitStd;private: System::Windows::Forms::RadioButton^ RadioCockpitStd;private: System::Windows::Forms::ListView^ ListTurret;private: System::Windows::Forms::ColumnHeader^ columnHeader3;private: System::Windows::Forms::ColumnHeader^ columnHeader4;private: System::Windows::Forms::ColumnHeader^ columnHeader5;private: System::Windows::Forms::ColumnHeader^ columnHeader6;private: System::Windows::Forms::Panel^ panel36;private: System::Windows::Forms::ComboBox^ ComboCockpit;private: System::Windows::Forms::Label^ label52;private: System::Windows::Forms::ContextMenuStrip^ contextMenuStrip1;private: System::Windows::Forms::ToolStripMenuItem^ ContextTurretAdd;private: System::Windows::Forms::ToolStripMenuItem^ leftToolStripMenuItem;private: System::Windows::Forms::ToolStripMenuItem^ rightToolStripMenuItem;private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator3;private: System::Windows::Forms::ToolStripMenuItem^ frontToolStripMenuItem;private: System::Windows::Forms::ToolStripMenuItem^ rearToolStripMenuItem;private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator4;private: System::Windows::Forms::ToolStripMenuItem^ upToolStripMenuItem;private: System::Windows::Forms::ToolStripMenuItem^ downToolStripMenuItem;private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator1;private: System::Windows::Forms::ToolStripMenuItem^ editTurretToolStripMenuItem;private: System::Windows::Forms::ToolStripMenuItem^ changePositionToolStripMenuItem;private: System::Windows::Forms::ToolStripMenuItem^ leftToolStripMenuItem1;private: System::Windows::Forms::ToolStripMenuItem^ rightToolStripMenuItem1;private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator5;private: System::Windows::Forms::ToolStripMenuItem^ frontToolStripMenuItem1;private: System::Windows::Forms::ToolStripMenuItem^ rearToolStripMenuItem1;private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator6;private: System::Windows::Forms::ToolStripMenuItem^ upToolStripMenuItem1;private: System::Windows::Forms::ToolStripMenuItem^ downToolStripMenuItem1;private: System::Windows::Forms::ToolStripMenuItem^ removeSelectedToolStripMenuItem;private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator2;private: System::Windows::Forms::ToolStripMenuItem^ clearAllToolStripMenuItem;#pragma region Windows Form Designer generated code/// <summary>/// Required method for Designer support - do not modify/// the contents of this method with the code editor./// </summary>void InitializeComponent(void){this->components = (gcnew System::ComponentModel::Container());System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(CustomiseTurret::typeid));this->GroupCockpit = (gcnew System::Windows::Forms::GroupBox());this->PanelCockpit = (gcnew System::Windows::Forms::Panel());this->ListWeaponCockpit = (gcnew System::Windows::Forms::ListView());this->columnHeader7 = (gcnew System::Windows::Forms::ColumnHeader());this->columnHeader8 = (gcnew System::Windows::Forms::ColumnHeader());this->panel39 = (gcnew System::Windows::Forms::Panel());this->ComboGameCockpit = (gcnew System::Windows::Forms::ComboBox());this->CheckWeaponDefaultCockpit = (gcnew System::Windows::Forms::CheckBox());this->label54 = (gcnew System::Windows::Forms::Label());this->panel38 = (gcnew System::Windows::Forms::Panel());this->TextCockpitScene = (gcnew System::Windows::Forms::TextBox());this->label53 = (gcnew System::Windows::Forms::Label());this->panel37 = (gcnew System::Windows::Forms::Panel());this->ComboCockpitCustom = (gcnew System::Windows::Forms::ComboBox());this->ButNewCockpit = (gcnew System::Windows::Forms::Button());this->RadioCockpitCustom = (gcnew System::Windows::Forms::RadioButton());this->panel35 = (gcnew System::Windows::Forms::Panel());this->ComboCockpitStd = (gcnew System::Windows::Forms::ComboBox());this->RadioCockpitStd = (gcnew System::Windows::Forms::RadioButton());this->ListTurret = (gcnew System::Windows::Forms::ListView());this->columnHeader3 = (gcnew System::Windows::Forms::ColumnHeader());this->columnHeader4 = (gcnew System::Windows::Forms::ColumnHeader());this->columnHeader5 = (gcnew System::Windows::Forms::ColumnHeader());this->columnHeader6 = (gcnew System::Windows::Forms::ColumnHeader());this->contextMenuStrip1 = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));this->ContextTurretAdd = (gcnew System::Windows::Forms::ToolStripMenuItem());this->leftToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());this->rightToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());this->frontToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());this->rearToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());this->toolStripSeparator4 = (gcnew System::Windows::Forms::ToolStripSeparator());this->upToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());this->downToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());this->editTurretToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());this->changePositionToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());this->leftToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());this->rightToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());this->toolStripSeparator5 = (gcnew System::Windows::Forms::ToolStripSeparator());this->frontToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());this->rearToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());this->toolStripSeparator6 = (gcnew System::Windows::Forms::ToolStripSeparator());this->upToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());this->downToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());this->removeSelectedToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());this->clearAllToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());this->panel36 = (gcnew System::Windows::Forms::Panel());this->ComboCockpit = (gcnew System::Windows::Forms::ComboBox());this->label52 = (gcnew System::Windows::Forms::Label());this->GroupCockpit->SuspendLayout();this->PanelCockpit->SuspendLayout();this->panel39->SuspendLayout();this->panel38->SuspendLayout();this->panel37->SuspendLayout();this->panel35->SuspendLayout();this->contextMenuStrip1->SuspendLayout();this->panel36->SuspendLayout();this->SuspendLayout();//// GroupCockpit//this->GroupCockpit->Controls->Add(this->PanelCockpit);this->GroupCockpit->Controls->Add(this->panel37);this->GroupCockpit->Controls->Add(this->panel35);this->GroupCockpit->Dock = System::Windows::Forms::DockStyle::Fill;this->GroupCockpit->Location = System::Drawing::Point(0, 169);this->GroupCockpit->Name = L"GroupCockpit";this->GroupCockpit->Size = System::Drawing::Size(520, 400);this->GroupCockpit->TabIndex = 6;this->GroupCockpit->TabStop = false;this->GroupCockpit->Text = L"Cockpits";//// PanelCockpit//this->PanelCockpit->Controls->Add(this->ListWeaponCockpit);this->PanelCockpit->Controls->Add(this->panel39);this->PanelCockpit->Controls->Add(this->panel38);this->PanelCockpit->Dock = System::Windows::Forms::DockStyle::Fill;this->PanelCockpit->Location = System::Drawing::Point(3, 68);this->PanelCockpit->Name = L"PanelCockpit";this->PanelCockpit->Padding = System::Windows::Forms::Padding(5);this->PanelCockpit->Size = System::Drawing::Size(514, 329);this->PanelCockpit->TabIndex = 3;//// ListWeaponCockpit//this->ListWeaponCockpit->CheckBoxes = true;this->ListWeaponCockpit->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^ >(2) {this->columnHeader7,this->columnHeader8});this->ListWeaponCockpit->Dock = System::Windows::Forms::DockStyle::Fill;this->ListWeaponCockpit->FullRowSelect = true;this->ListWeaponCockpit->Location = System::Drawing::Point(5, 51);this->ListWeaponCockpit->Name = L"ListWeaponCockpit";this->ListWeaponCockpit->Size = System::Drawing::Size(504, 273);this->ListWeaponCockpit->TabIndex = 11;this->ListWeaponCockpit->UseCompatibleStateImageBehavior = false;this->ListWeaponCockpit->View = System::Windows::Forms::View::Details;this->ListWeaponCockpit->ItemChecked += gcnew System::Windows::Forms::ItemCheckedEventHandler(this, &CustomiseTurret::ListWeaponCockpit_ItemChecked);//// columnHeader7//this->columnHeader7->Text = L"Group";//// columnHeader8//this->columnHeader8->Text = L"Weapons";//// panel39//this->panel39->Controls->Add(this->ComboGameCockpit);this->panel39->Controls->Add(this->CheckWeaponDefaultCockpit);this->panel39->Controls->Add(this->label54);this->panel39->Dock = System::Windows::Forms::DockStyle::Top;this->panel39->Location = System::Drawing::Point(5, 29);this->panel39->Name = L"panel39";this->panel39->Size = System::Drawing::Size(504, 22);this->panel39->TabIndex = 9;//// ComboGameCockpit//this->ComboGameCockpit->Dock = System::Windows::Forms::DockStyle::Fill;this->ComboGameCockpit->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;this->ComboGameCockpit->FormattingEnabled = true;this->ComboGameCockpit->Location = System::Drawing::Point(188, 0);this->ComboGameCockpit->Name = L"ComboGameCockpit";this->ComboGameCockpit->Size = System::Drawing::Size(234, 21);this->ComboGameCockpit->TabIndex = 0;this->ComboGameCockpit->SelectedIndexChanged += gcnew System::EventHandler(this, &CustomiseTurret::ComboGameCockpit_SelectedIndexChanged);//// CheckWeaponDefaultCockpit//this->CheckWeaponDefaultCockpit->AutoSize = true;this->CheckWeaponDefaultCockpit->Dock = System::Windows::Forms::DockStyle::Right;this->CheckWeaponDefaultCockpit->Location = System::Drawing::Point(422, 0);this->CheckWeaponDefaultCockpit->Name = L"CheckWeaponDefaultCockpit";this->CheckWeaponDefaultCockpit->Size = System::Drawing::Size(82, 22);this->CheckWeaponDefaultCockpit->TabIndex = 2;this->CheckWeaponDefaultCockpit->Text = L"Use Default";this->CheckWeaponDefaultCockpit->UseVisualStyleBackColor = true;this->CheckWeaponDefaultCockpit->CheckedChanged += gcnew System::EventHandler(this, &CustomiseTurret::CheckWeaponDefaultCockpit_CheckedChanged);//// label54//this->label54->Dock = System::Windows::Forms::DockStyle::Left;this->label54->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,static_cast<System::Byte>(0)));this->label54->Location = System::Drawing::Point(0, 0);this->label54->Name = L"label54";this->label54->Size = System::Drawing::Size(188, 22);this->label54->TabIndex = 1;this->label54->Text = L"X-Universe Game:";this->label54->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;//// panel38//this->panel38->Controls->Add(this->TextCockpitScene);this->panel38->Controls->Add(this->label53);this->panel38->Dock = System::Windows::Forms::DockStyle::Top;this->panel38->Location = System::Drawing::Point(5, 5);this->panel38->Name = L"panel38";this->panel38->Padding = System::Windows::Forms::Padding(2);this->panel38->Size = System::Drawing::Size(504, 24);this->panel38->TabIndex = 8;//// TextCockpitScene//this->TextCockpitScene->Dock = System::Windows::Forms::DockStyle::Fill;this->TextCockpitScene->Location = System::Drawing::Point(142, 2);this->TextCockpitScene->Name = L"TextCockpitScene";this->TextCockpitScene->Size = System::Drawing::Size(360, 20);this->TextCockpitScene->TabIndex = 1;this->TextCockpitScene->TextChanged += gcnew System::EventHandler(this, &CustomiseTurret::TextCockpitScene_TextChanged);//// label53//this->label53->Dock = System::Windows::Forms::DockStyle::Left;this->label53->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,static_cast<System::Byte>(0)));this->label53->Location = System::Drawing::Point(2, 2);this->label53->Name = L"label53";this->label53->Size = System::Drawing::Size(140, 20);this->label53->TabIndex = 0;this->label53->Text = L"Scene File";this->label53->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;//// panel37//this->panel37->Controls->Add(this->ComboCockpitCustom);this->panel37->Controls->Add(this->ButNewCockpit);this->panel37->Controls->Add(this->RadioCockpitCustom);this->panel37->Dock = System::Windows::Forms::DockStyle::Top;this->panel37->Location = System::Drawing::Point(3, 42);this->panel37->Name = L"panel37";this->panel37->Padding = System::Windows::Forms::Padding(3);this->panel37->Size = System::Drawing::Size(514, 26);this->panel37->TabIndex = 2;//// ComboCockpitCustom//this->ComboCockpitCustom->Dock = System::Windows::Forms::DockStyle::Fill;this->ComboCockpitCustom->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;this->ComboCockpitCustom->Enabled = false;this->ComboCockpitCustom->FormattingEnabled = true;this->ComboCockpitCustom->Location = System::Drawing::Point(102, 3);this->ComboCockpitCustom->Name = L"ComboCockpitCustom";this->ComboCockpitCustom->Size = System::Drawing::Size(370, 21);this->ComboCockpitCustom->TabIndex = 1;this->ComboCockpitCustom->SelectedIndexChanged += gcnew System::EventHandler(this, &CustomiseTurret::ComboCockpitCustom_SelectedIndexChanged);//// ButNewCockpit//this->ButNewCockpit->AutoSize = true;this->ButNewCockpit->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;this->ButNewCockpit->Dock = System::Windows::Forms::DockStyle::Right;this->ButNewCockpit->Location = System::Drawing::Point(472, 3);this->ButNewCockpit->Name = L"ButNewCockpit";this->ButNewCockpit->Size = System::Drawing::Size(39, 20);this->ButNewCockpit->TabIndex = 2;this->ButNewCockpit->Text = L"New";this->ButNewCockpit->UseVisualStyleBackColor = true;this->ButNewCockpit->Click += gcnew System::EventHandler(this, &CustomiseTurret::ButNewCockpit_Click);//// RadioCockpitCustom//this->RadioCockpitCustom->Dock = System::Windows::Forms::DockStyle::Left;this->RadioCockpitCustom->Location = System::Drawing::Point(3, 3);this->RadioCockpitCustom->Name = L"RadioCockpitCustom";this->RadioCockpitCustom->Size = System::Drawing::Size(99, 20);this->RadioCockpitCustom->TabIndex = 0;this->RadioCockpitCustom->Text = L"Custom";this->RadioCockpitCustom->UseVisualStyleBackColor = true;this->RadioCockpitCustom->CheckedChanged += gcnew System::EventHandler(this, &CustomiseTurret::RadioCockpitCustom_CheckedChanged);//// panel35//this->panel35->Controls->Add(this->ComboCockpitStd);this->panel35->Controls->Add(this->RadioCockpitStd);this->panel35->Dock = System::Windows::Forms::DockStyle::Top;this->panel35->Location = System::Drawing::Point(3, 16);this->panel35->Name = L"panel35";this->panel35->Padding = System::Windows::Forms::Padding(3);this->panel35->Size = System::Drawing::Size(514, 26);this->panel35->TabIndex = 1;//// ComboCockpitStd//this->ComboCockpitStd->Dock = System::Windows::Forms::DockStyle::Fill;this->ComboCockpitStd->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;this->ComboCockpitStd->FormattingEnabled = true;this->ComboCockpitStd->Location = System::Drawing::Point(102, 3);this->ComboCockpitStd->Name = L"ComboCockpitStd";this->ComboCockpitStd->Size = System::Drawing::Size(409, 21);this->ComboCockpitStd->TabIndex = 1;this->ComboCockpitStd->SelectedIndexChanged += gcnew System::EventHandler(this, &CustomiseTurret::ComboCockpitStd_SelectedIndexChanged);//// RadioCockpitStd//this->RadioCockpitStd->Checked = true;this->RadioCockpitStd->Dock = System::Windows::Forms::DockStyle::Left;this->RadioCockpitStd->Location = System::Drawing::Point(3, 3);this->RadioCockpitStd->Name = L"RadioCockpitStd";this->RadioCockpitStd->Size = System::Drawing::Size(99, 20);this->RadioCockpitStd->TabIndex = 0;this->RadioCockpitStd->TabStop = true;this->RadioCockpitStd->Text = L"Standard";this->RadioCockpitStd->UseVisualStyleBackColor = true;this->RadioCockpitStd->CheckedChanged += gcnew System::EventHandler(this, &CustomiseTurret::RadioCockpitStd_CheckedChanged);//// ListTurret//this->ListTurret->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^ >(4) {this->columnHeader3, this->columnHeader4,this->columnHeader5, this->columnHeader6});this->ListTurret->ContextMenuStrip = this->contextMenuStrip1;this->ListTurret->Dock = System::Windows::Forms::DockStyle::Top;this->ListTurret->FullRowSelect = true;this->ListTurret->HideSelection = false;this->ListTurret->Location = System::Drawing::Point(0, 32);this->ListTurret->Name = L"ListTurret";this->ListTurret->Size = System::Drawing::Size(520, 137);this->ListTurret->TabIndex = 5;this->ListTurret->UseCompatibleStateImageBehavior = false;this->ListTurret->View = System::Windows::Forms::View::Details;this->ListTurret->MouseDoubleClick += gcnew System::Windows::Forms::MouseEventHandler(this, &CustomiseTurret::ListTurret_MouseDoubleClick);this->ListTurret->SelectedIndexChanged += gcnew System::EventHandler(this, &CustomiseTurret::ListTurret_SelectedIndexChanged);//// columnHeader3//this->columnHeader3->Text = L"#";//// columnHeader4//this->columnHeader4->Text = L"Type";//// columnHeader5//this->columnHeader5->Text = L"Position";//// columnHeader6//this->columnHeader6->Text = L"Body";//// contextMenuStrip1//this->contextMenuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(7) {this->ContextTurretAdd,this->toolStripSeparator1, this->editTurretToolStripMenuItem, this->changePositionToolStripMenuItem, this->removeSelectedToolStripMenuItem,this->toolStripSeparator2, this->clearAllToolStripMenuItem});this->contextMenuStrip1->Name = L"contextMenuStrip1";this->contextMenuStrip1->Size = System::Drawing::Size(181, 206);this->contextMenuStrip1->Opening += gcnew System::ComponentModel::CancelEventHandler(this, &CustomiseTurret::contextMenuStrip1_Opening);//// ContextTurretAdd//this->ContextTurretAdd->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(8) {this->leftToolStripMenuItem,this->rightToolStripMenuItem, this->toolStripSeparator3, this->frontToolStripMenuItem, this->rearToolStripMenuItem, this->toolStripSeparator4,this->upToolStripMenuItem, this->downToolStripMenuItem});this->ContextTurretAdd->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"ContextTurretAdd.Image")));this->ContextTurretAdd->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;this->ContextTurretAdd->Name = L"ContextTurretAdd";this->ContextTurretAdd->Size = System::Drawing::Size(180, 38);this->ContextTurretAdd->Text = L"Add Turret";//// leftToolStripMenuItem//this->leftToolStripMenuItem->Name = L"leftToolStripMenuItem";this->leftToolStripMenuItem->Size = System::Drawing::Size(114, 22);this->leftToolStripMenuItem->Text = L"Left";this->leftToolStripMenuItem->Click += gcnew System::EventHandler(this, &CustomiseTurret::leftToolStripMenuItem_Click);//// rightToolStripMenuItem//this->rightToolStripMenuItem->Name = L"rightToolStripMenuItem";this->rightToolStripMenuItem->Size = System::Drawing::Size(114, 22);this->rightToolStripMenuItem->Text = L"Right";this->rightToolStripMenuItem->Click += gcnew System::EventHandler(this, &CustomiseTurret::rightToolStripMenuItem_Click);//// toolStripSeparator3//this->toolStripSeparator3->Name = L"toolStripSeparator3";this->toolStripSeparator3->Size = System::Drawing::Size(111, 6);//// frontToolStripMenuItem//this->frontToolStripMenuItem->Name = L"frontToolStripMenuItem";this->frontToolStripMenuItem->Size = System::Drawing::Size(114, 22);this->frontToolStripMenuItem->Text = L"Front";this->frontToolStripMenuItem->Click += gcnew System::EventHandler(this, &CustomiseTurret::frontToolStripMenuItem_Click);//// rearToolStripMenuItem//this->rearToolStripMenuItem->Name = L"rearToolStripMenuItem";this->rearToolStripMenuItem->Size = System::Drawing::Size(114, 22);this->rearToolStripMenuItem->Text = L"Rear";this->rearToolStripMenuItem->Click += gcnew System::EventHandler(this, &CustomiseTurret::rearToolStripMenuItem_Click);//// toolStripSeparator4//this->toolStripSeparator4->Name = L"toolStripSeparator4";this->toolStripSeparator4->Size = System::Drawing::Size(111, 6);//// upToolStripMenuItem//this->upToolStripMenuItem->Name = L"upToolStripMenuItem";this->upToolStripMenuItem->Size = System::Drawing::Size(114, 22);this->upToolStripMenuItem->Text = L"Top";this->upToolStripMenuItem->Click += gcnew System::EventHandler(this, &CustomiseTurret::upToolStripMenuItem_Click);//// downToolStripMenuItem//this->downToolStripMenuItem->Name = L"downToolStripMenuItem";this->downToolStripMenuItem->Size = System::Drawing::Size(114, 22);this->downToolStripMenuItem->Text = L"Bottom";this->downToolStripMenuItem->Click += gcnew System::EventHandler(this, &CustomiseTurret::downToolStripMenuItem_Click);//// toolStripSeparator1//this->toolStripSeparator1->Name = L"toolStripSeparator1";this->toolStripSeparator1->Size = System::Drawing::Size(177, 6);//// editTurretToolStripMenuItem//this->editTurretToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"editTurretToolStripMenuItem.Image")));this->editTurretToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;this->editTurretToolStripMenuItem->Name = L"editTurretToolStripMenuItem";this->editTurretToolStripMenuItem->Size = System::Drawing::Size(180, 38);this->editTurretToolStripMenuItem->Text = L"Edit Turret";this->editTurretToolStripMenuItem->Click += gcnew System::EventHandler(this, &CustomiseTurret::editTurretToolStripMenuItem_Click);//// changePositionToolStripMenuItem//this->changePositionToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(8) {this->leftToolStripMenuItem1,this->rightToolStripMenuItem1, this->toolStripSeparator5, this->frontToolStripMenuItem1, this->rearToolStripMenuItem1, this->toolStripSeparator6,this->upToolStripMenuItem1, this->downToolStripMenuItem1});this->changePositionToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"changePositionToolStripMenuItem.Image")));this->changePositionToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;this->changePositionToolStripMenuItem->Name = L"changePositionToolStripMenuItem";this->changePositionToolStripMenuItem->Size = System::Drawing::Size(180, 38);this->changePositionToolStripMenuItem->Text = L"Change Position";//// leftToolStripMenuItem1//this->leftToolStripMenuItem1->Name = L"leftToolStripMenuItem1";this->leftToolStripMenuItem1->Size = System::Drawing::Size(114, 22);this->leftToolStripMenuItem1->Text = L"Left";this->leftToolStripMenuItem1->Click += gcnew System::EventHandler(this, &CustomiseTurret::leftToolStripMenuItem1_Click);//// rightToolStripMenuItem1//this->rightToolStripMenuItem1->Name = L"rightToolStripMenuItem1";this->rightToolStripMenuItem1->Size = System::Drawing::Size(114, 22);this->rightToolStripMenuItem1->Text = L"Right";this->rightToolStripMenuItem1->Click += gcnew System::EventHandler(this, &CustomiseTurret::rightToolStripMenuItem1_Click);//// toolStripSeparator5//this->toolStripSeparator5->Name = L"toolStripSeparator5";this->toolStripSeparator5->Size = System::Drawing::Size(111, 6);//// frontToolStripMenuItem1//this->frontToolStripMenuItem1->Name = L"frontToolStripMenuItem1";this->frontToolStripMenuItem1->Size = System::Drawing::Size(114, 22);this->frontToolStripMenuItem1->Text = L"Front";this->frontToolStripMenuItem1->Click += gcnew System::EventHandler(this, &CustomiseTurret::frontToolStripMenuItem1_Click);//// rearToolStripMenuItem1//this->rearToolStripMenuItem1->Name = L"rearToolStripMenuItem1";this->rearToolStripMenuItem1->Size = System::Drawing::Size(114, 22);this->rearToolStripMenuItem1->Text = L"Rear";this->rearToolStripMenuItem1->Click += gcnew System::EventHandler(this, &CustomiseTurret::rearToolStripMenuItem1_Click);//// toolStripSeparator6//this->toolStripSeparator6->Name = L"toolStripSeparator6";this->toolStripSeparator6->Size = System::Drawing::Size(111, 6);//// upToolStripMenuItem1//this->upToolStripMenuItem1->Name = L"upToolStripMenuItem1";this->upToolStripMenuItem1->Size = System::Drawing::Size(114, 22);this->upToolStripMenuItem1->Text = L"Top";this->upToolStripMenuItem1->Click += gcnew System::EventHandler(this, &CustomiseTurret::upToolStripMenuItem1_Click);//// downToolStripMenuItem1//this->downToolStripMenuItem1->Name = L"downToolStripMenuItem1";this->downToolStripMenuItem1->Size = System::Drawing::Size(114, 22);this->downToolStripMenuItem1->Text = L"Bottom";this->downToolStripMenuItem1->Click += gcnew System::EventHandler(this, &CustomiseTurret::downToolStripMenuItem1_Click);//// removeSelectedToolStripMenuItem//this->removeSelectedToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"removeSelectedToolStripMenuItem.Image")));this->removeSelectedToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;this->removeSelectedToolStripMenuItem->Name = L"removeSelectedToolStripMenuItem";this->removeSelectedToolStripMenuItem->Size = System::Drawing::Size(180, 38);this->removeSelectedToolStripMenuItem->Text = L"Remove Selected";this->removeSelectedToolStripMenuItem->Click += gcnew System::EventHandler(this, &CustomiseTurret::removeSelectedToolStripMenuItem_Click);//// toolStripSeparator2//this->toolStripSeparator2->Name = L"toolStripSeparator2";this->toolStripSeparator2->Size = System::Drawing::Size(177, 6);//// clearAllToolStripMenuItem//this->clearAllToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"clearAllToolStripMenuItem.Image")));this->clearAllToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;this->clearAllToolStripMenuItem->Name = L"clearAllToolStripMenuItem";this->clearAllToolStripMenuItem->Size = System::Drawing::Size(180, 38);this->clearAllToolStripMenuItem->Text = L"Clear All";this->clearAllToolStripMenuItem->Click += gcnew System::EventHandler(this, &CustomiseTurret::clearAllToolStripMenuItem_Click);//// panel36//this->panel36->Controls->Add(this->ComboCockpit);this->panel36->Controls->Add(this->label52);this->panel36->Dock = System::Windows::Forms::DockStyle::Top;this->panel36->Location = System::Drawing::Point(0, 0);this->panel36->Name = L"panel36";this->panel36->Padding = System::Windows::Forms::Padding(5);this->panel36->Size = System::Drawing::Size(520, 32);this->panel36->TabIndex = 4;//// ComboCockpit//this->ComboCockpit->Dock = System::Windows::Forms::DockStyle::Fill;this->ComboCockpit->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;this->ComboCockpit->FormattingEnabled = true;this->ComboCockpit->Location = System::Drawing::Point(164, 5);this->ComboCockpit->Name = L"ComboCockpit";this->ComboCockpit->Size = System::Drawing::Size(351, 21);this->ComboCockpit->TabIndex = 1;this->ComboCockpit->SelectedIndexChanged += gcnew System::EventHandler(this, &CustomiseTurret::ComboCockpit_SelectedIndexChanged);//// label52//this->label52->Dock = System::Windows::Forms::DockStyle::Left;this->label52->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,static_cast<System::Byte>(0)));this->label52->Location = System::Drawing::Point(5, 5);this->label52->Name = L"label52";this->label52->Size = System::Drawing::Size(159, 22);this->label52->TabIndex = 0;this->label52->Text = L"Main Cockpit";this->label52->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;//// CustomiseTurret//this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;this->Controls->Add(this->GroupCockpit);this->Controls->Add(this->ListTurret);this->Controls->Add(this->panel36);this->Name = L"CustomiseTurret";this->Size = System::Drawing::Size(520, 569);this->GroupCockpit->ResumeLayout(false);this->PanelCockpit->ResumeLayout(false);this->panel39->ResumeLayout(false);this->panel39->PerformLayout();this->panel38->ResumeLayout(false);this->panel38->PerformLayout();this->panel37->ResumeLayout(false);this->panel37->PerformLayout();this->panel35->ResumeLayout(false);this->contextMenuStrip1->ResumeLayout(false);this->panel36->ResumeLayout(false);this->ResumeLayout(false);}#pragma endregionprivate: System::Void ComboCockpit_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {if ( m_pModels && !m_pModels->Empty() ){m_pShipData->lTurrets.Get(0)->iSceneNode = this->ComboCockpit->SelectedIndex;m_pShipData->lTurrets.Get(0)->sModel = m_pModels->GetAt(this->ComboCockpit->SelectedIndex)->str;}}private: System::Void ListTurret_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {this->UpdateCockpitDisplay();}private: System::Void RadioCockpitCustom_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {this->RadioCockpitStd->Checked = !this->RadioCockpitCustom->Checked;this->ComboCockpitCustom->Enabled = this->RadioCockpitCustom->Checked;this->PanelCockpit->Enabled = this->RadioCockpitCustom->Checked;this->UpdateCockpitDisplay2();}private: System::Void ComboCockpitCustom_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {if ( this->ListTurret->SelectedItems->Count ){ListViewItem ^item = this->ListTurret->SelectedItems[0];item->SubItems[1]->Text = this->ComboCockpitCustom->Text;m_pShipData->cockpits[Convert::ToInt32(item->Tag) - 1].iCockpit = -1;m_pShipData->cockpits[Convert::ToInt32(item->Tag) - 1].sCockpit = CyStringFromSystemString(this->ComboCockpitCustom->Text);this->ListTurret->AutoResizeColumns(ColumnHeaderAutoResizeStyle::HeaderSize);}this->UpdateCockpitDisplay2();}private: System::Void ComboGameCockpit_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {this->UpdateCockpitWeaponsList();}private: System::Void CheckWeaponDefaultCockpit_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {this->ListWeaponCockpit->Enabled = !this->CheckWeaponDefaultCockpit->Checked;if ( m_bUpdateing ) return;int value = (this->CheckWeaponDefaultCockpit->Checked) ? -1 : 0;bool found = false;for ( SWeaponMask *m = m_pCurrentCockpit->lWeaponMask.First(); m; m = m_pCurrentCockpit->lWeaponMask.Next() ){if ( m->iGame == this->ComboGameCockpit->SelectedIndex ){m->iMask = value;found = true;break;}}if ( !found ){SWeaponMask *m = m_pCurrentCockpit->lWeaponMask.push_back(new SWeaponMask);m->iGame = this->ComboGameCockpit->SelectedIndex;m->iMask = value;}this->UpdateCockpitWeaponsList();}private: System::Void ListTurret_MouseDoubleClick(System::Object^ sender, System::Windows::Forms::MouseEventArgs^ e) {if ( !this->ListTurret->SelectedItems->Count ) return;ListViewItem ^item = this->ListTurret->SelectedItems[0];this->EditTurret(item);}private: System::Void ComboCockpitStd_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {if ( !this->ListTurret->SelectedItems->Count ) return;ListViewItem ^item = this->ListTurret->SelectedItems[0];int t = Convert::ToInt32(item->Tag);m_pShipData->cockpits[t - 1].iCockpit = this->ComboCockpitStd->SelectedIndex;m_pShipData->cockpits[t - 1].sCockpit = "";item->SubItems[1]->Text = Convert::ToString(this->ComboCockpitStd->SelectedIndex);}private: System::Void RadioCockpitStd_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {this->RadioCockpitCustom->Checked = !this->RadioCockpitStd->Checked;this->ComboCockpitStd->Enabled = this->RadioCockpitStd->Checked;}private: System::Void ButNewCockpit_Click(System::Object^ sender, System::EventArgs^ e) {InputBox ^input = gcnew InputBox("Enter the cockpit id to add", "SS_COCKPIT_");if ( input->ShowDialog(this) == Windows::Forms::DialogResult::OK ){m_pShipFile->NewCockpit(CyStringFromSystemString(input->GetInput()).ToString(), "4512", 0);this->ComboCockpitCustom->Items->Add(input->GetInput());this->ComboCockpitCustom->Text = input->GetInput();this->RadioCockpitCustom->Checked = true;this->RadioCockpitCustom->Enabled = true;}}private: System::Void TextCockpitScene_TextChanged(System::Object^ sender, System::EventArgs^ e) {if ( m_pCurrentCockpit )m_pCurrentCockpit->sCockpit = m_pCurrentCockpit->sCockpit.replaceToken(";", 8, CyStringFromSystemString(this->TextCockpitScene->Text).ToString());}private: System::Void ListWeaponCockpit_ItemChecked(System::Object^ sender, System::Windows::Forms::ItemCheckedEventArgs^ e) {this->SaveCockpitWeaponsList();}private: System::Void contextMenuStrip1_Opening(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) {Point ^mousePoint = this->ListTurret->PointToClient(this->contextMenuStrip1->MousePosition);ListViewItem ^item = this->ListTurret->GetItemAt(mousePoint->X, mousePoint->Y);this->removeSelectedToolStripMenuItem->Enabled = (item) ? true : false;this->editTurretToolStripMenuItem->Enabled = (item && m_pModels) ? true : false;this->ContextTurretAdd->Enabled = (this->ListTurret->Items->Count < 6) ? true : false;this->clearAllToolStripMenuItem->Enabled = (this->ListTurret->Items->Count) ? true : false;this->changePositionToolStripMenuItem->Enabled = (item) ? true : false;this->leftToolStripMenuItem1->Checked = false;this->rightToolStripMenuItem1->Checked = false;this->frontToolStripMenuItem1->Checked = false;this->rearToolStripMenuItem1->Checked = false;this->upToolStripMenuItem1->Checked = false;this->downToolStripMenuItem1->Checked = false;if ( item ){switch(m_pShipData->cockpits[Convert::ToInt32(item->Tag) - 1].iPos){case 1:this->frontToolStripMenuItem1->Checked = true;break;case 2:this->rearToolStripMenuItem1->Checked = true;break;case 3:this->leftToolStripMenuItem1->Checked = true;break;case 4:this->rightToolStripMenuItem1->Checked = true;break;case 5:this->upToolStripMenuItem1->Checked = true;break;case 6:this->downToolStripMenuItem1->Checked = true;break;}}m_pSelectedItem = item;e->Cancel = false;}private: System::Void editTurretToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {if ( !m_pSelectedItem ) return;this->EditTurret(m_pSelectedItem);}private: System::Void removeSelectedToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {if ( !m_pSelectedItem ) return;m_pShipData->RemoveTurret(Convert::ToInt32(m_pSelectedItem->Tag));this->UpdateTurrets();}private: System::Void clearAllToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->ClearTurrets();this->UpdateTurrets();}private: System::Void leftToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->AddNewTurret(3);this->EditTurret(m_pShipData->iTurretCount - 1);this->UpdateTurrets();}private: System::Void rightToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->AddNewTurret(4);this->EditTurret(m_pShipData->iTurretCount - 1);this->UpdateTurrets();}private: System::Void frontToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->AddNewTurret(1);this->EditTurret(m_pShipData->iTurretCount - 1);this->UpdateTurrets();}private: System::Void rearToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->AddNewTurret(2);this->EditTurret(m_pShipData->iTurretCount - 1);this->UpdateTurrets();}private: System::Void upToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->AddNewTurret(5);this->EditTurret(m_pShipData->iTurretCount - 1);this->UpdateTurrets();}private: System::Void downToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->AddNewTurret(6);this->EditTurret(m_pShipData->iTurretCount - 1);this->UpdateTurrets();}private: System::Void leftToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->cockpits[Convert::ToInt32(m_pSelectedItem->Tag) - 1].iPos = 3;m_pSelectedItem->SubItems[2]->Text = this->GetPosition(3);}private: System::Void rightToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->cockpits[Convert::ToInt32(m_pSelectedItem->Tag) - 1].iPos = 4;m_pSelectedItem->SubItems[2]->Text = this->GetPosition(4);}private: System::Void frontToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->cockpits[Convert::ToInt32(m_pSelectedItem->Tag) - 1].iPos = 1;m_pSelectedItem->SubItems[2]->Text = this->GetPosition(1);}private: System::Void rearToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->cockpits[Convert::ToInt32(m_pSelectedItem->Tag) - 1].iPos = 2;m_pSelectedItem->SubItems[2]->Text = this->GetPosition(2);}private: System::Void upToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->cockpits[Convert::ToInt32(m_pSelectedItem->Tag) - 1].iPos = 5;m_pSelectedItem->SubItems[2]->Text = this->GetPosition(5);}private: System::Void downToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) {m_pShipData->cockpits[Convert::ToInt32(m_pSelectedItem->Tag) - 1].iPos = 6;m_pSelectedItem->SubItems[2]->Text = this->GetPosition(6);}};}