Subversion Repositories spk

Rev

Rev 237 | Rev 248 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 237 Rev 238
Line 23... Line 23...
23
#include "CustomiseShip.h"
23
#include "CustomiseShip.h"
24
#include "SelectGame.h"
24
#include "SelectGame.h"
25
 
25
 
26
#undef GetTempPath
26
#undef GetTempPath
27
 
27
 
28
#define DESIGNER
-
 
29
 
28
 
30
namespace Creator {
29
namespace Creator {
31
	/// <summary>
30
	/// <summary>
32
	/// Summary for PackageForm
31
	/// Summary for PackageForm
33
	///
32
	///
Line 36... Line 35...
36
	///          associated with all .resx files this class depends on.  Otherwise,
35
	///          associated with all .resx files this class depends on.  Otherwise,
37
	///          the designers will not be able to interact properly with localized
36
	///          the designers will not be able to interact properly with localized
38
	///          resources associated with this form.
37
	///          resources associated with this form.
39
	/// </summary>
38
	/// </summary>
40
	/// 
39
	/// 
-
 
40
	
-
 
41
	/*
41
	public ref class PackageForm : public System::Windows::Forms::Form
42
	public ref class PackageForm : public System::Windows::Forms::Form
-
 
43
	#define DESIGNER
-
 
44
	*/
42
 
45
 
43
		/*
46
		
44
#ifdef DESIGNER
47
#ifdef DESIGNER
45
	public ref class PackageForm : public System::Windows::Forms::Form
48
	public ref class PackageForm : public System::Windows::Forms::Form
46
#else
49
#else
47
	public ref class PackageForm : public Creator::BaseForm
50
	public ref class PackageForm : public Creator::BaseForm
48
#endif	
51
#endif	
49
*/
52
 
50
	{
53
	{
51
	public:
54
	public:
52
		PackageForm(System::Windows::Forms::Form ^parent, System::Windows::Forms::TabControl ^ctrl, System::Windows::Forms::TabPage ^page, System::Windows::Forms::ToolStripMenuItem ^tool, CPackages *p, Windows::Forms::ImageList ^imagelist, SSettings *set)			
55
		PackageForm(System::Windows::Forms::Form ^parent, System::Windows::Forms::TabControl ^ctrl, System::Windows::Forms::TabPage ^page, System::Windows::Forms::ToolStripMenuItem ^tool, CPackages *p, Windows::Forms::ImageList ^imagelist, SSettings *set)			
53
#ifndef DESIGNER
56
#ifndef DESIGNER
54
			: BaseForm(parent, ctrl, page, tool, p, imagelist, set),
57
			: BaseForm(parent, ctrl, page, tool, p, imagelist, set),
Line 3423... Line 3426...
3423
			this->tabGlobals->Text = L"Globals";
3426
			this->tabGlobals->Text = L"Globals";
3424
			this->tabGlobals->UseVisualStyleBackColor = true;
3427
			this->tabGlobals->UseVisualStyleBackColor = true;
3425
			// 
3428
			// 
3426
			// butGlobalClear
3429
			// butGlobalClear
3427
			// 
3430
			// 
-
 
3431
			this->butGlobalClear->Dock = System::Windows::Forms::DockStyle::Right;
3428
			this->butGlobalClear->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"butGlobalClear.Image")));
3432
			this->butGlobalClear->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"butGlobalClear.Image")));
3429
			this->butGlobalClear->Location = System::Drawing::Point(621, 156);
3433
			this->butGlobalClear->Location = System::Drawing::Point(624, 156);
3430
			this->butGlobalClear->Name = L"butGlobalClear";
3434
			this->butGlobalClear->Name = L"butGlobalClear";
3431
			this->butGlobalClear->Size = System::Drawing::Size(121, 36);
3435
			this->butGlobalClear->Size = System::Drawing::Size(121, 39);
3432
			this->butGlobalClear->TabIndex = 2;
3436
			this->butGlobalClear->TabIndex = 2;
3433
			this->butGlobalClear->Text = L"Clear All";
3437
			this->butGlobalClear->Text = L"Clear All";
3434
			this->butGlobalClear->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
3438
			this->butGlobalClear->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
3435
			this->butGlobalClear->UseVisualStyleBackColor = true;
3439
			this->butGlobalClear->UseVisualStyleBackColor = true;
3436
			this->butGlobalClear->Click += gcnew System::EventHandler(this, &PackageForm::butGlobalClear_Click);
3440
			this->butGlobalClear->Click += gcnew System::EventHandler(this, &PackageForm::butGlobalClear_Click);
3437
			// 
3441
			// 
3438
			// butAddGlobal
3442
			// butAddGlobal
3439
			// 
3443
			// 
-
 
3444
			this->butAddGlobal->Dock = System::Windows::Forms::DockStyle::Left;
3440
			this->butAddGlobal->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"butAddGlobal.Image")));
3445
			this->butAddGlobal->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"butAddGlobal.Image")));
3441
			this->butAddGlobal->Location = System::Drawing::Point(6, 156);
3446
			this->butAddGlobal->Location = System::Drawing::Point(3, 156);
3442
			this->butAddGlobal->Name = L"butAddGlobal";
3447
			this->butAddGlobal->Name = L"butAddGlobal";
3443
			this->butAddGlobal->Size = System::Drawing::Size(121, 36);
3448
			this->butAddGlobal->Size = System::Drawing::Size(121, 39);
3444
			this->butAddGlobal->TabIndex = 1;
3449
			this->butAddGlobal->TabIndex = 1;
3445
			this->butAddGlobal->Text = L"Add New";
3450
			this->butAddGlobal->Text = L"Add New";
3446
			this->butAddGlobal->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
3451
			this->butAddGlobal->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
3447
			this->butAddGlobal->UseVisualStyleBackColor = true;
3452
			this->butAddGlobal->UseVisualStyleBackColor = true;
3448
			this->butAddGlobal->Click += gcnew System::EventHandler(this, &PackageForm::butAddGlobal_Click);
3453
			this->butAddGlobal->Click += gcnew System::EventHandler(this, &PackageForm::butAddGlobal_Click);
Line 3452... Line 3457...
3452
			this->listGlobals->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(2) {
3457
			this->listGlobals->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(2) {
3453
				this->ColGlobalName,
3458
				this->ColGlobalName,
3454
					this->ColGlobalValue
3459
					this->ColGlobalValue
3455
			});
3460
			});
3456
			this->listGlobals->ContextMenuStrip = this->contextGlobal;
3461
			this->listGlobals->ContextMenuStrip = this->contextGlobal;
-
 
3462
			this->listGlobals->Dock = System::Windows::Forms::DockStyle::Top;
-
 
3463
			this->listGlobals->FullRowSelect = true;
3457
			this->listGlobals->HideSelection = false;
3464
			this->listGlobals->HideSelection = false;
3458
			this->listGlobals->Location = System::Drawing::Point(6, 6);
3465
			this->listGlobals->Location = System::Drawing::Point(3, 3);
-
 
3466
			this->listGlobals->Margin = System::Windows::Forms::Padding(10);
-
 
3467
			this->listGlobals->MultiSelect = false;
3459
			this->listGlobals->Name = L"listGlobals";
3468
			this->listGlobals->Name = L"listGlobals";
3460
			this->listGlobals->Size = System::Drawing::Size(736, 144);
3469
			this->listGlobals->Size = System::Drawing::Size(742, 153);
3461
			this->listGlobals->TabIndex = 0;
3470
			this->listGlobals->TabIndex = 0;
3462
			this->listGlobals->UseCompatibleStateImageBehavior = false;
3471
			this->listGlobals->UseCompatibleStateImageBehavior = false;
3463
			this->listGlobals->View = System::Windows::Forms::View::Details;
3472
			this->listGlobals->View = System::Windows::Forms::View::Details;
3464
			// 
3473
			// 
3465
			// ColGlobalName
3474
			// ColGlobalName
Line 3477... Line 3486...
3477
				this->addNewToolStripMenuItem,
3486
				this->addNewToolStripMenuItem,
3478
					this->toolStripSeparator6, this->editSelectedToolStripMenuItem1, this->removeSelectedToolStripMenuItem, this->toolStripSeparator7,
3487
					this->toolStripSeparator6, this->editSelectedToolStripMenuItem1, this->removeSelectedToolStripMenuItem, this->toolStripSeparator7,
3479
					this->clearAllToolStripMenuItem2
3488
					this->clearAllToolStripMenuItem2
3480
			});
3489
			});
3481
			this->contextGlobal->Name = L"contextGlobal";
3490
			this->contextGlobal->Name = L"contextGlobal";
3482
			this->contextGlobal->Size = System::Drawing::Size(169, 120);
3491
			this->contextGlobal->Size = System::Drawing::Size(185, 142);
-
 
3492
			this->contextGlobal->Opening += gcnew System::ComponentModel::CancelEventHandler(this, &PackageForm::contextGlobal_Opening);
3483
			// 
3493
			// 
3484
			// addNewToolStripMenuItem
3494
			// addNewToolStripMenuItem
3485
			// 
3495
			// 
3486
			this->addNewToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"addNewToolStripMenuItem.Image")));
3496
			this->addNewToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"addNewToolStripMenuItem.Image")));
3487
			this->addNewToolStripMenuItem->Name = L"addNewToolStripMenuItem";
3497
			this->addNewToolStripMenuItem->Name = L"addNewToolStripMenuItem";
3488
			this->addNewToolStripMenuItem->Size = System::Drawing::Size(168, 26);
3498
			this->addNewToolStripMenuItem->Size = System::Drawing::Size(184, 26);
3489
			this->addNewToolStripMenuItem->Text = L"Add New";
3499
			this->addNewToolStripMenuItem->Text = L"Add New";
-
 
3500
			this->addNewToolStripMenuItem->Click += gcnew System::EventHandler(this, &PackageForm::addNewToolStripMenuItem_Click);
3490
			// 
3501
			// 
3491
			// toolStripSeparator6
3502
			// toolStripSeparator6
3492
			// 
3503
			// 
3493
			this->toolStripSeparator6->Name = L"toolStripSeparator6";
3504
			this->toolStripSeparator6->Name = L"toolStripSeparator6";
3494
			this->toolStripSeparator6->Size = System::Drawing::Size(165, 6);
3505
			this->toolStripSeparator6->Size = System::Drawing::Size(181, 6);
3495
			// 
3506
			// 
3496
			// editSelectedToolStripMenuItem1
3507
			// editSelectedToolStripMenuItem1
3497
			// 
3508
			// 
3498
			this->editSelectedToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"editSelectedToolStripMenuItem1.Image")));
3509
			this->editSelectedToolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"editSelectedToolStripMenuItem1.Image")));
3499
			this->editSelectedToolStripMenuItem1->Name = L"editSelectedToolStripMenuItem1";
3510
			this->editSelectedToolStripMenuItem1->Name = L"editSelectedToolStripMenuItem1";
3500
			this->editSelectedToolStripMenuItem1->Size = System::Drawing::Size(168, 26);
3511
			this->editSelectedToolStripMenuItem1->Size = System::Drawing::Size(184, 26);
3501
			this->editSelectedToolStripMenuItem1->Text = L"Edit Selected";
3512
			this->editSelectedToolStripMenuItem1->Text = L"Edit Selected";
-
 
3513
			this->editSelectedToolStripMenuItem1->Click += gcnew System::EventHandler(this, &PackageForm::editSelectedToolStripMenuItem1_Click);
3502
			// 
3514
			// 
3503
			// removeSelectedToolStripMenuItem
3515
			// removeSelectedToolStripMenuItem
3504
			// 
3516
			// 
3505
			this->removeSelectedToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"removeSelectedToolStripMenuItem.Image")));
3517
			this->removeSelectedToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"removeSelectedToolStripMenuItem.Image")));
3506
			this->removeSelectedToolStripMenuItem->Name = L"removeSelectedToolStripMenuItem";
3518
			this->removeSelectedToolStripMenuItem->Name = L"removeSelectedToolStripMenuItem";
3507
			this->removeSelectedToolStripMenuItem->Size = System::Drawing::Size(168, 26);
3519
			this->removeSelectedToolStripMenuItem->Size = System::Drawing::Size(184, 26);
3508
			this->removeSelectedToolStripMenuItem->Text = L"Remove Selected";
3520
			this->removeSelectedToolStripMenuItem->Text = L"Remove Selected";
-
 
3521
			this->removeSelectedToolStripMenuItem->Click += gcnew System::EventHandler(this, &PackageForm::removeSelectedToolStripMenuItem_Click);
3509
			// 
3522
			// 
3510
			// toolStripSeparator7
3523
			// toolStripSeparator7
3511
			// 
3524
			// 
3512
			this->toolStripSeparator7->Name = L"toolStripSeparator7";
3525
			this->toolStripSeparator7->Name = L"toolStripSeparator7";
3513
			this->toolStripSeparator7->Size = System::Drawing::Size(165, 6);
3526
			this->toolStripSeparator7->Size = System::Drawing::Size(181, 6);
3514
			// 
3527
			// 
3515
			// clearAllToolStripMenuItem2
3528
			// clearAllToolStripMenuItem2
3516
			// 
3529
			// 
3517
			this->clearAllToolStripMenuItem2->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"clearAllToolStripMenuItem2.Image")));
3530
			this->clearAllToolStripMenuItem2->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"clearAllToolStripMenuItem2.Image")));
3518
			this->clearAllToolStripMenuItem2->Name = L"clearAllToolStripMenuItem2";
3531
			this->clearAllToolStripMenuItem2->Name = L"clearAllToolStripMenuItem2";
3519
			this->clearAllToolStripMenuItem2->Size = System::Drawing::Size(168, 26);
3532
			this->clearAllToolStripMenuItem2->Size = System::Drawing::Size(184, 26);
3520
			this->clearAllToolStripMenuItem2->Text = L"Clear All";
3533
			this->clearAllToolStripMenuItem2->Text = L"Clear All";
-
 
3534
			this->clearAllToolStripMenuItem2->Click += gcnew System::EventHandler(this, &PackageForm::clearAllToolStripMenuItem2_Click);
3521
			// 
3535
			// 
3522
			// CheckShipID
3536
			// CheckShipID
3523
			// 
3537
			// 
3524
			this->CheckShipID->AutoSize = true;
3538
			this->CheckShipID->AutoSize = true;
3525
			this->CheckShipID->Dock = System::Windows::Forms::DockStyle::Left;
3539
			this->CheckShipID->Dock = System::Windows::Forms::DockStyle::Left;
Line 5619... Line 5633...
5619
private: System::Void butGlobalClear_Click(System::Object^ sender, System::EventArgs^ e) {
5633
private: System::Void butGlobalClear_Click(System::Object^ sender, System::EventArgs^ e) {
5620
			m_pPackage->clearGlobals();
5634
			m_pPackage->clearGlobals();
5621
			this->UpdateGlobals();
5635
			this->UpdateGlobals();
5622
			this->UpdateChanged();
5636
			this->UpdateChanged();
5623
		}
5637
		}
-
 
5638
private: System::Void addNewToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
-
 
5639
			this->AddNewGlobal();
-
 
5640
		}
-
 
5641
private: System::Void editSelectedToolStripMenuItem1_Click(System::Object^ sender, System::EventArgs^ e) {
-
 
5642
			this->EditGlobal();
-
 
5643
		}
-
 
5644
private: System::Void removeSelectedToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
-
 
5645
			m_pPackage->removeGlobal(_WS(m_pSelectedItem->Text));
-
 
5646
			this->UpdateGlobals();
-
 
5647
			this->UpdateChanged();
-
 
5648
		}
-
 
5649
private: System::Void clearAllToolStripMenuItem2_Click(System::Object^ sender, System::EventArgs^ e) {
-
 
5650
			m_pPackage->clearGlobals();
-
 
5651
			this->UpdateGlobals();
-
 
5652
			this->UpdateChanged();
-
 
5653
		}
-
 
5654
private: System::Void contextGlobal_Opening(System::Object^ sender, System::ComponentModel::CancelEventArgs^ e) {
-
 
5655
			Point^ mousePoint = this->listGlobals->PointToClient(this->contextGlobal->MousePosition);
-
 
5656
			ListViewItem^ item = this->listGlobals->GetItemAt(mousePoint->X, mousePoint->Y);
-
 
5657
 
-
 
5658
			this->editSelectedToolStripMenuItem1->Visible = (item) ? true : false;
-
 
5659
			this->removeSelectedToolStripMenuItem->Visible = (item) ? true : false;
-
 
5660
			this->toolStripSeparator6->Visible = (item) ? true : false;
-
 
5661
 
-
 
5662
			bool clear = (this->listGlobals->Items->Count) ? true : false;
-
 
5663
 
-
 
5664
			this->clearAllToolStripMenuItem2->Visible = clear;
-
 
5665
			this->toolStripSeparator7->Visible = clear;
-
 
5666
 
-
 
5667
			m_pSelectedItem = item;
-
 
5668
			e->Cancel = false;
-
 
5669
		}
5624
};
5670
};
5625
}
5671
}