Rev 211 | 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 CustomiseGuns/// </summary>public ref class CustomiseGuns : public System::Windows::Forms::UserControl{public:CustomiseGuns(Windows::Forms::Form ^parent, ImageList ^imagesSmall, ImageList ^imagesLarge, CShipData *shipData, const Utils::WStringList *models){InitializeComponent();m_bUpdatingGunLists = false;m_pParent = parent;m_pShipData = shipData;_pModels = models;this->ListTurrets->SmallImageList = imagesSmall;this->ListGuns->SmallImageList = imagesSmall;this->ListTurrets->LargeImageList = imagesLarge;this->ListGuns->LargeImageList = imagesLarge;this->SetupControls();}String ^GetPosition(int dir);void UpdateDisplay();void SetupControls();void ChangeGunValues();void UpdateGunEntrys();void UpdateGunsList();void UpdateGunTurrets();protected:Windows::Forms::Form ^m_pParent;CShipData *m_pShipData;bool m_bUpdatingGunLists;const Utils::WStringList *_pModels;/// <summary>/// Clean up any resources being used./// </summary>~CustomiseGuns(){if (components){delete components;}}private: System::Windows::Forms::ListView^ ListGuns;private: System::Windows::Forms::ContextMenuStrip^ contextMenuStrip2;private: System::Windows::Forms::ToolStripMenuItem^ addGunToolStripMenuItem;private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator7;private: System::Windows::Forms::ToolStripMenuItem^ removeGunToolStripMenuItem;private: System::Windows::Forms::ToolStripSeparator^ toolStripSeparator8;private: System::Windows::Forms::ToolStripMenuItem^ clearAllToolStripMenuItem1;private: System::Windows::Forms::ColumnHeader^ columnHeader14;private: System::Windows::Forms::ColumnHeader^ columnHeader18;private: System::Windows::Forms::ColumnHeader^ columnHeader15;private: System::Windows::Forms::ColumnHeader^ columnHeader16;private: System::Windows::Forms::ColumnHeader^ columnHeader17;private: System::Windows::Forms::TabControl^ tabControl2;private: System::Windows::Forms::TabPage^ PageAuto;private: System::Windows::Forms::TableLayoutPanel^ tableLayoutPanel8;private: System::Windows::Forms::ComboBox^ ComboAutoSecondary;private: System::Windows::Forms::Label^ label56;private: System::Windows::Forms::Label^ label55;private: System::Windows::Forms::ComboBox^ ComboAutoPrimary;private: System::Windows::Forms::TabPage^ tabPage9;private: System::Windows::Forms::TableLayoutPanel^ tableLayoutPanel9;private: System::Windows::Forms::CheckBox^ CheckManualSecondary;private: System::Windows::Forms::Label^ label58;private: System::Windows::Forms::Label^ label57;private: System::Windows::Forms::Button^ button14;private: System::Windows::Forms::TextBox^ TextManualPrimary;private: System::Windows::Forms::TextBox^ TextManualSecondary;private: System::Windows::Forms::NumericUpDown^ NumManualPrimary;private: System::Windows::Forms::NumericUpDown^ NumManualSecondary;private: System::Windows::Forms::CheckBox^ CheckManualPrimary;private: System::Windows::Forms::ListView^ ListTurrets;private: System::Windows::Forms::ColumnHeader^ columnHeader9;private: System::Windows::Forms::ColumnHeader^ columnHeader10;private: System::Windows::Forms::ColumnHeader^ columnHeader11;private: System::Windows::Forms::ColumnHeader^ columnHeader12;private: System::Windows::Forms::ColumnHeader^ columnHeader13;private: System::ComponentModel::IContainer^ components;private:/// <summary>/// Required designer variable./// </summary>#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(CustomiseGuns::typeid));this->ListGuns = (gcnew System::Windows::Forms::ListView());this->columnHeader14 = (gcnew System::Windows::Forms::ColumnHeader());this->columnHeader18 = (gcnew System::Windows::Forms::ColumnHeader());this->columnHeader15 = (gcnew System::Windows::Forms::ColumnHeader());this->columnHeader16 = (gcnew System::Windows::Forms::ColumnHeader());this->columnHeader17 = (gcnew System::Windows::Forms::ColumnHeader());this->contextMenuStrip2 = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));this->addGunToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());this->toolStripSeparator7 = (gcnew System::Windows::Forms::ToolStripSeparator());this->removeGunToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());this->toolStripSeparator8 = (gcnew System::Windows::Forms::ToolStripSeparator());this->clearAllToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());this->tabControl2 = (gcnew System::Windows::Forms::TabControl());this->PageAuto = (gcnew System::Windows::Forms::TabPage());this->tableLayoutPanel8 = (gcnew System::Windows::Forms::TableLayoutPanel());this->ComboAutoSecondary = (gcnew System::Windows::Forms::ComboBox());this->label56 = (gcnew System::Windows::Forms::Label());this->label55 = (gcnew System::Windows::Forms::Label());this->ComboAutoPrimary = (gcnew System::Windows::Forms::ComboBox());this->tabPage9 = (gcnew System::Windows::Forms::TabPage());this->tableLayoutPanel9 = (gcnew System::Windows::Forms::TableLayoutPanel());this->CheckManualSecondary = (gcnew System::Windows::Forms::CheckBox());this->label58 = (gcnew System::Windows::Forms::Label());this->label57 = (gcnew System::Windows::Forms::Label());this->button14 = (gcnew System::Windows::Forms::Button());this->TextManualPrimary = (gcnew System::Windows::Forms::TextBox());this->TextManualSecondary = (gcnew System::Windows::Forms::TextBox());this->NumManualPrimary = (gcnew System::Windows::Forms::NumericUpDown());this->NumManualSecondary = (gcnew System::Windows::Forms::NumericUpDown());this->CheckManualPrimary = (gcnew System::Windows::Forms::CheckBox());this->ListTurrets = (gcnew System::Windows::Forms::ListView());this->columnHeader9 = (gcnew System::Windows::Forms::ColumnHeader());this->columnHeader10 = (gcnew System::Windows::Forms::ColumnHeader());this->columnHeader11 = (gcnew System::Windows::Forms::ColumnHeader());this->columnHeader12 = (gcnew System::Windows::Forms::ColumnHeader());this->columnHeader13 = (gcnew System::Windows::Forms::ColumnHeader());this->contextMenuStrip2->SuspendLayout();this->tabControl2->SuspendLayout();this->PageAuto->SuspendLayout();this->tableLayoutPanel8->SuspendLayout();this->tabPage9->SuspendLayout();this->tableLayoutPanel9->SuspendLayout();(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->NumManualPrimary))->BeginInit();(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->NumManualSecondary))->BeginInit();this->SuspendLayout();//// ListGuns//this->ListGuns->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^ >(5) {this->columnHeader14, this->columnHeader18,this->columnHeader15, this->columnHeader16, this->columnHeader17});this->ListGuns->ContextMenuStrip = this->contextMenuStrip2;this->ListGuns->Dock = System::Windows::Forms::DockStyle::Fill;this->ListGuns->FullRowSelect = true;this->ListGuns->HideSelection = false;this->ListGuns->Location = System::Drawing::Point(0, 147);this->ListGuns->MultiSelect = false;this->ListGuns->Name = L"ListGuns";this->ListGuns->Size = System::Drawing::Size(427, 283);this->ListGuns->TabIndex = 1;this->ListGuns->UseCompatibleStateImageBehavior = false;this->ListGuns->View = System::Windows::Forms::View::Details;this->ListGuns->SelectedIndexChanged += gcnew System::EventHandler(this, &CustomiseGuns::ListGuns_SelectedIndexChanged);//// columnHeader14//this->columnHeader14->Text = L"#";//// columnHeader18//this->columnHeader18->Text = L"Index";//// columnHeader15//this->columnHeader15->Text = L"Count";//// columnHeader16//this->columnHeader16->Text = L"Primary Body";//// columnHeader17//this->columnHeader17->Text = L"Secondary Body";//// contextMenuStrip2//this->contextMenuStrip2->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(5) {this->addGunToolStripMenuItem,this->toolStripSeparator7, this->removeGunToolStripMenuItem, this->toolStripSeparator8, this->clearAllToolStripMenuItem1});this->contextMenuStrip2->Name = L"contextMenuStrip2";this->contextMenuStrip2->Size = System::Drawing::Size(159, 130);this->contextMenuStrip2->Opening += gcnew System::ComponentModel::CancelEventHandler(this, &CustomiseGuns::contextMenuStrip2_Opening);//// addGunToolStripMenuItem//this->addGunToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"addGunToolStripMenuItem.Image")));this->addGunToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;this->addGunToolStripMenuItem->Name = L"addGunToolStripMenuItem";this->addGunToolStripMenuItem->Size = System::Drawing::Size(158, 38);this->addGunToolStripMenuItem->Text = L"Add Gun";this->addGunToolStripMenuItem->Click += gcnew System::EventHandler(this, &CustomiseGuns::addGunToolStripMenuItem_Click);//// toolStripSeparator7//this->toolStripSeparator7->Name = L"toolStripSeparator7";this->toolStripSeparator7->Size = System::Drawing::Size(155, 6);//// removeGunToolStripMenuItem//this->removeGunToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"removeGunToolStripMenuItem.Image")));this->removeGunToolStripMenuItem->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;this->removeGunToolStripMenuItem->Name = L"removeGunToolStripMenuItem";this->removeGunToolStripMenuItem->Size = System::Drawing::Size(158, 38);this->removeGunToolStripMenuItem->Text = L"Remove Gun";this->removeGunToolStripMenuItem->Click += gcnew System::EventHandler(this, &CustomiseGuns::removeGunToolStripMenuItem_Click);//// toolStripSeparator8//this->toolStripSeparator8->Name = L"toolStripSeparator8";this->toolStripSeparator8->Size = System::Drawing::Size(155, 6);//// clearAllToolStripMenuItem1//this->clearAllToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^ >(resources->GetObject(L"clearAllToolStripMenuItem1.Image")));this->clearAllToolStripMenuItem1->ImageScaling = System::Windows::Forms::ToolStripItemImageScaling::None;this->clearAllToolStripMenuItem1->Name = L"clearAllToolStripMenuItem1";this->clearAllToolStripMenuItem1->Size = System::Drawing::Size(158, 38);this->clearAllToolStripMenuItem1->Text = L"Clear All";this->clearAllToolStripMenuItem1->Click += gcnew System::EventHandler(this, &CustomiseGuns::clearAllToolStripMenuItem1_Click);//// tabControl2//this->tabControl2->Controls->Add(this->PageAuto);this->tabControl2->Controls->Add(this->tabPage9);this->tabControl2->Dock = System::Windows::Forms::DockStyle::Bottom;this->tabControl2->Enabled = false;this->tabControl2->Location = System::Drawing::Point(0, 430);this->tabControl2->Name = L"tabControl2";this->tabControl2->SelectedIndex = 0;this->tabControl2->Size = System::Drawing::Size(427, 103);this->tabControl2->TabIndex = 2;//// PageAuto//this->PageAuto->Controls->Add(this->tableLayoutPanel8);this->PageAuto->Location = System::Drawing::Point(4, 22);this->PageAuto->Name = L"PageAuto";this->PageAuto->Padding = System::Windows::Forms::Padding(10);this->PageAuto->Size = System::Drawing::Size(419, 77);this->PageAuto->TabIndex = 0;this->PageAuto->Text = L"Automatic Entry";this->PageAuto->UseVisualStyleBackColor = true;//// tableLayoutPanel8//this->tableLayoutPanel8->ColumnCount = 2;this->tableLayoutPanel8->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Absolute,180)));this->tableLayoutPanel8->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent,100)));this->tableLayoutPanel8->Controls->Add(this->ComboAutoSecondary, 1, 1);this->tableLayoutPanel8->Controls->Add(this->label56, 0, 1);this->tableLayoutPanel8->Controls->Add(this->label55, 0, 0);this->tableLayoutPanel8->Controls->Add(this->ComboAutoPrimary, 1, 0);this->tableLayoutPanel8->Dock = System::Windows::Forms::DockStyle::Fill;this->tableLayoutPanel8->Location = System::Drawing::Point(10, 10);this->tableLayoutPanel8->Name = L"tableLayoutPanel8";this->tableLayoutPanel8->RowCount = 2;this->tableLayoutPanel8->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 50)));this->tableLayoutPanel8->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 50)));this->tableLayoutPanel8->Size = System::Drawing::Size(399, 57);this->tableLayoutPanel8->TabIndex = 0;//// ComboAutoSecondary//this->ComboAutoSecondary->Dock = System::Windows::Forms::DockStyle::Fill;this->ComboAutoSecondary->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;this->ComboAutoSecondary->FormattingEnabled = true;this->ComboAutoSecondary->Location = System::Drawing::Point(183, 31);this->ComboAutoSecondary->Name = L"ComboAutoSecondary";this->ComboAutoSecondary->Size = System::Drawing::Size(213, 21);this->ComboAutoSecondary->TabIndex = 3;this->ComboAutoSecondary->SelectedIndexChanged += gcnew System::EventHandler(this, &CustomiseGuns::ComboAutoSecondary_SelectedIndexChanged);//// label56//this->label56->Dock = System::Windows::Forms::DockStyle::Fill;this->label56->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->label56->Location = System::Drawing::Point(3, 28);this->label56->Name = L"label56";this->label56->Size = System::Drawing::Size(174, 29);this->label56->TabIndex = 1;this->label56->Text = L"Secondary Body";this->label56->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;//// label55//this->label55->Dock = System::Windows::Forms::DockStyle::Fill;this->label55->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->label55->Location = System::Drawing::Point(3, 0);this->label55->Name = L"label55";this->label55->Size = System::Drawing::Size(174, 28);this->label55->TabIndex = 0;this->label55->Text = L"Primary Body";this->label55->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;//// ComboAutoPrimary//this->ComboAutoPrimary->Dock = System::Windows::Forms::DockStyle::Fill;this->ComboAutoPrimary->DropDownStyle = System::Windows::Forms::ComboBoxStyle::DropDownList;this->ComboAutoPrimary->FormattingEnabled = true;this->ComboAutoPrimary->Location = System::Drawing::Point(183, 3);this->ComboAutoPrimary->Name = L"ComboAutoPrimary";this->ComboAutoPrimary->Size = System::Drawing::Size(213, 21);this->ComboAutoPrimary->TabIndex = 2;this->ComboAutoPrimary->SelectedIndexChanged += gcnew System::EventHandler(this, &CustomiseGuns::ComboAutoPrimary_SelectedIndexChanged);//// tabPage9//this->tabPage9->Controls->Add(this->tableLayoutPanel9);this->tabPage9->Location = System::Drawing::Point(4, 22);this->tabPage9->Name = L"tabPage9";this->tabPage9->Padding = System::Windows::Forms::Padding(10);this->tabPage9->Size = System::Drawing::Size(419, 77);this->tabPage9->TabIndex = 1;this->tabPage9->Text = L"Manual Entry";this->tabPage9->UseVisualStyleBackColor = true;//// tableLayoutPanel9//this->tableLayoutPanel9->ColumnCount = 5;this->tableLayoutPanel9->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Absolute,180)));this->tableLayoutPanel9->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Absolute,20)));this->tableLayoutPanel9->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Percent,100)));this->tableLayoutPanel9->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Absolute,60)));this->tableLayoutPanel9->ColumnStyles->Add((gcnew System::Windows::Forms::ColumnStyle(System::Windows::Forms::SizeType::Absolute,80)));this->tableLayoutPanel9->Controls->Add(this->CheckManualSecondary, 1, 1);this->tableLayoutPanel9->Controls->Add(this->label58, 0, 1);this->tableLayoutPanel9->Controls->Add(this->label57, 0, 0);this->tableLayoutPanel9->Controls->Add(this->button14, 4, 0);this->tableLayoutPanel9->Controls->Add(this->TextManualPrimary, 2, 0);this->tableLayoutPanel9->Controls->Add(this->TextManualSecondary, 2, 1);this->tableLayoutPanel9->Controls->Add(this->NumManualPrimary, 3, 0);this->tableLayoutPanel9->Controls->Add(this->NumManualSecondary, 3, 1);this->tableLayoutPanel9->Controls->Add(this->CheckManualPrimary, 1, 0);this->tableLayoutPanel9->Dock = System::Windows::Forms::DockStyle::Fill;this->tableLayoutPanel9->Location = System::Drawing::Point(10, 10);this->tableLayoutPanel9->Name = L"tableLayoutPanel9";this->tableLayoutPanel9->RowCount = 2;this->tableLayoutPanel9->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 50)));this->tableLayoutPanel9->RowStyles->Add((gcnew System::Windows::Forms::RowStyle(System::Windows::Forms::SizeType::Percent, 50)));this->tableLayoutPanel9->Size = System::Drawing::Size(399, 57);this->tableLayoutPanel9->TabIndex = 0;//// CheckManualSecondary//this->CheckManualSecondary->Dock = System::Windows::Forms::DockStyle::Fill;this->CheckManualSecondary->Location = System::Drawing::Point(183, 31);this->CheckManualSecondary->Name = L"CheckManualSecondary";this->CheckManualSecondary->Size = System::Drawing::Size(14, 23);this->CheckManualSecondary->TabIndex = 9;this->CheckManualSecondary->UseVisualStyleBackColor = true;this->CheckManualSecondary->CheckedChanged += gcnew System::EventHandler(this, &CustomiseGuns::CheckManualSecondary_CheckedChanged);//// label58//this->label58->Dock = System::Windows::Forms::DockStyle::Fill;this->label58->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->label58->Location = System::Drawing::Point(3, 28);this->label58->Name = L"label58";this->label58->Size = System::Drawing::Size(174, 29);this->label58->TabIndex = 2;this->label58->Text = L"Secondary Body";this->label58->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;//// label57//this->label57->Dock = System::Windows::Forms::DockStyle::Fill;this->label57->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->label57->Location = System::Drawing::Point(3, 0);this->label57->Name = L"label57";this->label57->Size = System::Drawing::Size(174, 28);this->label57->TabIndex = 1;this->label57->Text = L"Primary Body";this->label57->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;//// button14//this->button14->Dock = System::Windows::Forms::DockStyle::Fill;this->button14->Location = System::Drawing::Point(322, 3);this->button14->Name = L"button14";this->tableLayoutPanel9->SetRowSpan(this->button14, 2);this->button14->Size = System::Drawing::Size(74, 51);this->button14->TabIndex = 3;this->button14->Text = L"Update";this->button14->UseVisualStyleBackColor = true;this->button14->Click += gcnew System::EventHandler(this, &CustomiseGuns::button14_Click);//// TextManualPrimary//this->TextManualPrimary->Dock = System::Windows::Forms::DockStyle::Fill;this->TextManualPrimary->Location = System::Drawing::Point(203, 3);this->TextManualPrimary->Name = L"TextManualPrimary";this->TextManualPrimary->Size = System::Drawing::Size(53, 20);this->TextManualPrimary->TabIndex = 4;//// TextManualSecondary//this->TextManualSecondary->Dock = System::Windows::Forms::DockStyle::Fill;this->TextManualSecondary->Location = System::Drawing::Point(203, 31);this->TextManualSecondary->Name = L"TextManualSecondary";this->TextManualSecondary->Size = System::Drawing::Size(53, 20);this->TextManualSecondary->TabIndex = 5;//// NumManualPrimary//this->NumManualPrimary->Dock = System::Windows::Forms::DockStyle::Fill;this->NumManualPrimary->Location = System::Drawing::Point(262, 3);this->NumManualPrimary->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1000, 0, 0, 0});this->NumManualPrimary->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, System::Int32::MinValue});this->NumManualPrimary->Name = L"NumManualPrimary";this->NumManualPrimary->Size = System::Drawing::Size(54, 20);this->NumManualPrimary->TabIndex = 6;//// NumManualSecondary//this->NumManualSecondary->Dock = System::Windows::Forms::DockStyle::Fill;this->NumManualSecondary->Location = System::Drawing::Point(262, 31);this->NumManualSecondary->Maximum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1000, 0, 0, 0});this->NumManualSecondary->Minimum = System::Decimal(gcnew cli::array< System::Int32 >(4) {1, 0, 0, System::Int32::MinValue});this->NumManualSecondary->Name = L"NumManualSecondary";this->NumManualSecondary->Size = System::Drawing::Size(54, 20);this->NumManualSecondary->TabIndex = 7;//// CheckManualPrimary//this->CheckManualPrimary->Dock = System::Windows::Forms::DockStyle::Fill;this->CheckManualPrimary->Location = System::Drawing::Point(183, 3);this->CheckManualPrimary->Name = L"CheckManualPrimary";this->CheckManualPrimary->Size = System::Drawing::Size(14, 22);this->CheckManualPrimary->TabIndex = 8;this->CheckManualPrimary->UseVisualStyleBackColor = true;this->CheckManualPrimary->CheckedChanged += gcnew System::EventHandler(this, &CustomiseGuns::CheckManualPrimary_CheckedChanged);//// ListTurrets//this->ListTurrets->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^ >(5) {this->columnHeader9,this->columnHeader10, this->columnHeader11, this->columnHeader12, this->columnHeader13});this->ListTurrets->Dock = System::Windows::Forms::DockStyle::Top;this->ListTurrets->FullRowSelect = true;this->ListTurrets->HideSelection = false;this->ListTurrets->Location = System::Drawing::Point(0, 0);this->ListTurrets->MultiSelect = false;this->ListTurrets->Name = L"ListTurrets";this->ListTurrets->Size = System::Drawing::Size(427, 147);this->ListTurrets->TabIndex = 0;this->ListTurrets->UseCompatibleStateImageBehavior = false;this->ListTurrets->View = System::Windows::Forms::View::Details;this->ListTurrets->SelectedIndexChanged += gcnew System::EventHandler(this, &CustomiseGuns::ListTurrets_SelectedIndexChanged);//// columnHeader9//this->columnHeader9->Text = L"#";this->columnHeader9->Width = 30;//// columnHeader10//this->columnHeader10->Text = L"Pos";//// columnHeader11//this->columnHeader11->Text = L"Guns";//// columnHeader12//this->columnHeader12->Text = L"Entries";//// columnHeader13//this->columnHeader13->Text = L"Position";//// CustomiseGuns//this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;this->Controls->Add(this->ListGuns);this->Controls->Add(this->tabControl2);this->Controls->Add(this->ListTurrets);this->Name = L"CustomiseGuns";this->Size = System::Drawing::Size(427, 533);this->contextMenuStrip2->ResumeLayout(false);this->tabControl2->ResumeLayout(false);this->PageAuto->ResumeLayout(false);this->tableLayoutPanel8->ResumeLayout(false);this->tabPage9->ResumeLayout(false);this->tableLayoutPanel9->ResumeLayout(false);this->tableLayoutPanel9->PerformLayout();(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->NumManualPrimary))->EndInit();(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->NumManualSecondary))->EndInit();this->ResumeLayout(false);}#pragma endregionprivate: System::Void ListGuns_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {this->tabControl2->Enabled = (this->ListGuns->SelectedItems->Count) ? true : false;this->UpdateGunEntrys();}private: System::Void ListTurrets_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {this->UpdateGunsList();if ( this->ListGuns->SelectedItems->Count )this->ListGuns->SelectedItems[0]->Selected = false;}private: System::Void ComboAutoPrimary_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {this->ComboAutoSecondary->Enabled = (this->ComboAutoPrimary->SelectedIndex == 0) ? false : true;if ( m_bUpdatingGunLists ) return;if ( !this->ListTurrets->SelectedItems->Count || !this->ListGuns->SelectedItems->Count )return;SGunGroup *g = m_pShipData->lGuns.Get(Convert::ToInt32(this->ListTurrets->SelectedItems[0]->Tag));SWeaponGroup *w = g->lWeapons.Get(Convert::ToInt32(this->ListGuns->SelectedItems[0]->Tag));if ( this->ComboAutoPrimary->SelectedIndex == 0 ){w->iNode1 = 0;w->sModel1 = L"0";}else{w->iNode1 = this->ComboAutoPrimary->SelectedIndex - 1;w->sModel1 = _pModels->get(w->iNode1)->str;}m_pShipData->UpdateGunEntries();this->ChangeGunValues();}private: System::Void ComboAutoSecondary_SelectedIndexChanged(System::Object^ sender, System::EventArgs^ e) {if ( m_bUpdatingGunLists ) return;if ( !this->ListTurrets->SelectedItems->Count || !this->ListGuns->SelectedItems->Count )return;SGunGroup *g = m_pShipData->lGuns.Get(Convert::ToInt32(this->ListTurrets->SelectedItems[0]->Tag));SWeaponGroup *w = g->lWeapons.Get(Convert::ToInt32(this->ListGuns->SelectedItems[0]->Tag));if ( this->ComboAutoSecondary->SelectedIndex == 0 ){w->iNode2 = -1;w->sModel2 = L"";}else{w->iNode2 = this->ComboAutoSecondary->SelectedIndex - 1;w->sModel2 = _pModels->get(w->iNode2)->str;}m_pShipData->UpdateGunEntries();this->ChangeGunValues();}private: System::Void contextMenuStrip2_Opening(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) {Point ^mousePoint = this->ListGuns->PointToClient(this->contextMenuStrip2->MousePosition);ListViewItem ^item = this->ListGuns->GetItemAt(mousePoint->X, mousePoint->Y);this->removeGunToolStripMenuItem->Enabled = (item) ? true : false;this->clearAllToolStripMenuItem1->Enabled = (this->ListGuns->Items->Count) ? true : false;e->Cancel = false;}private: System::Void addGunToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {SGunGroup *g = m_pShipData->lGuns.Get(Convert::ToInt32(this->ListTurrets->SelectedItems[0]->Tag));SWeaponGroup *w = new SWeaponGroup;w->iNode1 = 0;w->sModel1 = L"0";w->iNode2 = -1;g->lWeapons.push_back(w);m_pShipData->UpdateGunEntries();this->ChangeGunValues();if ( this->ListGuns->Items->Count )this->ListGuns->Items[this->ListGuns->Items->Count - 1]->Selected = true;}private: System::Void removeGunToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {SGunGroup *g = m_pShipData->lGuns.Get(Convert::ToInt32(this->ListTurrets->SelectedItems[0]->Tag));SWeaponGroup *w = g->lWeapons.Get(Convert::ToInt32(this->ListGuns->SelectedItems[0]->Tag));g->lWeapons.remove(w);m_pShipData->UpdateGunEntries();this->ChangeGunValues();}private: System::Void clearAllToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) {if ( MessageBox::Show(this, "Are you sure you want to remove all the gun entries?", "Clear Entrys", MessageBoxButtons::YesNo, MessageBoxIcon::Question) == Windows::Forms::DialogResult::Yes ){SGunGroup *g = m_pShipData->lGuns.Get(Convert::ToInt32(this->ListTurrets->SelectedItems[0]->Tag));g->lWeapons.MemoryClear();m_pShipData->UpdateGunEntries();this->ChangeGunValues();}}private: System::Void button14_Click(System::Object^ sender, System::EventArgs^ e) {if ( !this->ListTurrets->SelectedItems->Count || !this->ListGuns->SelectedItems->Count )return;SGunGroup *g = m_pShipData->lGuns.Get(Convert::ToInt32(this->ListTurrets->SelectedItems[0]->Tag));SWeaponGroup *w = g->lWeapons.Get(Convert::ToInt32(this->ListGuns->SelectedItems[0]->Tag));if ( this->CheckManualPrimary->Checked ){w->iNode1 = Convert::ToInt32(this->NumManualPrimary->Value);w->sModel1 = _WS(this->TextManualPrimary->Text);}else{w->iNode1 = 0;w->sModel1 = L"0";}if ( this->CheckManualSecondary->Checked ){w->iNode2 = Convert::ToInt32(this->NumManualSecondary->Value);w->sModel2 = _WS(this->TextManualSecondary->Text);}else{w->iNode2 = -1;w->sModel2 = L"";}m_pShipData->UpdateGunEntries();this->ChangeGunValues();}private: System::Void CheckManualPrimary_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {this->TextManualPrimary->Enabled = this->CheckManualPrimary->Checked;this->NumManualPrimary->Enabled = this->CheckManualPrimary->Checked;}private: System::Void CheckManualSecondary_CheckedChanged(System::Object^ sender, System::EventArgs^ e) {this->TextManualSecondary->Enabled = this->CheckManualSecondary->Checked;this->NumManualSecondary->Enabled = this->CheckManualSecondary->Checked;}};}