Subversion Repositories spk

Rev

Rev 222 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 cycrow 1
#pragma once
2
 
3
#include "SpkForm.h"
4
#include "AddDialog.h"
5
 
6
#include "../../common/InputBox.h"
7
#include "PackageInfo.h"
8
#include "ConvertFile.h"
9
 
10
#undef GetTempPath
11
 
128 cycrow 12
#define VERSION 1.30
1 cycrow 13
#define BETA 0
14
 
15
namespace SpkExplorer {
16
 
17
	using namespace System;
18
	using namespace System::ComponentModel;
19
	using namespace System::Collections;
20
	using namespace System::Windows::Forms;
21
	using namespace System::Data;
22
	using namespace System::Drawing;
23
 
24
	/// <summary>
25
	/// Summary for Form1
26
	///
27
	/// WARNING: If you change the name of this class, you will need to change the
28
	///          'Resource File Name' property for the managed resource compiler tool
29
	///          associated with all .resx files this class depends on.  Otherwise,
30
	///          the designers will not be able to interact properly with localized
31
	///          resources associated with this form.
32
	/// </summary>
33
	public ref class Form1 : public System::Windows::Forms::Form
34
	{
35
	public:
36
		Form1(array<System::String ^> ^args)
37
		{
38
			InitializeComponent();
39
			this->AllowDrop = true;
40
			this->DoToolTips();
41
 
42
			this->Closed += gcnew System::EventHandler(this, &Form1::CloseEvent);
43
 
44
			this->Text = "SPK Explorer " + GetProgramVersionString((float)VERSION, (int)BETA);
222 cycrow 45
			m_pLoadedList = new Utils::WStringList;
1 cycrow 46
 
47
			m_pPackages = new CPackages;
224 cycrow 48
			m_pPackages->startup(L".", _WS(IO::Path::GetTempPath()), _WS(Environment::GetFolderPath(Environment::SpecialFolder::Personal)));
1 cycrow 49
 
50
			this->UpdateDisplay();
51
 
52
			m_curView = System::Windows::Forms::View::Details;
53
			m_lCopiedFiles = new CLinkList<C_File>;
54
			m_pCutFrom = nullptr;
55
			m_lDraggedFiles = new CLinkList<C_File>;
56
			m_pDraggedFrom = nullptr;
57
 
58
			m_iLocX = m_iLocY = -1;
59
 
60
			this->LoadData();
61
 
62
			if ( args )
63
				this->OpenFiles(args, true, true);
64
		}
65
 
66
		CLinkList<C_File> *CopiedFiles() { return m_lCopiedFiles; }
67
		void PastedFiles() { m_lCopiedFiles->clear(); this->ToolPaste->Enabled = false; }
68
 
69
		void DoToolTips()
70
		{
71
			this->toolTip1->SetToolTip(this->button1, "Click to close all open windows");
72
		}
73
 
74
		void RemoveCopied(bool deleteFrom)
75
		{
76
			if ( m_lCopiedFiles->size() )
77
			{
78
				// restore the file
79
				if ( m_pCutFrom && !deleteFrom )
80
					m_pCutFrom->RestoreCut(m_lCopiedFiles);
81
				else
82
					m_lCopiedFiles->MemoryClear();
83
 
84
				m_pCutFrom = nullptr;
85
				m_lCopiedFiles->clear();
86
				this->ToolPaste->Enabled = false;
87
			}
88
		}
89
		void CopyFile(C_File *f, bool first)
90
		{
91
			if ( first )
92
				this->RemoveCopied(false);
93
			C_File *newFile = new C_File();
94
			newFile->CopyData(f);
95
			m_lCopiedFiles->push_back(newFile);
96
			this->ToolPaste->Enabled = true;
97
		}
98
 
99
		void CutFile(C_File *f, SpkForm ^From, bool first)
100
		{
101
			if ( first || From != m_pCutFrom )
102
				this->RemoveCopied(false);
103
			m_lCopiedFiles->push_back(f);
104
			m_pCutFrom = From;
105
			this->ToolPaste->Enabled = true;
106
		}
107
 
108
		void DragFile(C_File *f, SpkForm ^From)
109
		{
110
			if ( m_pDraggedFrom != From )
111
				m_lDraggedFiles->clear();
112
			m_lDraggedFiles->push_back(f);
113
			m_pDraggedFrom = From;
114
		}
115
 
116
		SpkForm ^DragFromForm()
117
		{
118
			return m_pDraggedFrom;
119
		}
120
 
121
		void Dragged(SpkForm ^ToForm, bool copy)
122
		{
123
			if ( !m_pDraggedFrom || m_lDraggedFiles->empty() )
124
				return;
125
			if ( m_pDraggedFrom != ToForm )
126
			{
127
				if ( copy )
128
				{
129
					for ( C_File *f = m_lDraggedFiles->First(); f; f = m_lDraggedFiles->Next() )
130
					{
131
						C_File *newFile = new C_File();
132
						newFile->CopyData(f);
133
						ToForm->DroppedFile(newFile);
134
					}
135
				}
136
				else
137
				{
138
					for ( C_File *f = m_lDraggedFiles->First(); f; f = m_lDraggedFiles->Next() )
139
					{
140
						m_pDraggedFrom->DraggedFile(f);
141
						ToForm->DroppedFile(f);
142
					}
143
				}
144
			}
145
			m_pDraggedFrom = nullptr;
146
			m_lDraggedFiles->clear();
147
		}
148
 
149
		void LoadData()
150
		{
151
			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
152
			CFileIO Config;
222 cycrow 153
			if ( Config.open(_WS(mydoc) + L"/Egosoft/spkexplorer.dat") )
1 cycrow 154
			{
222 cycrow 155
				std::vector<Utils::WString> lines;
156
				if(Config.readLines(lines))
1 cycrow 157
				{
222 cycrow 158
					for (size_t i = 0; i < lines.size(); i++ )
1 cycrow 159
					{
222 cycrow 160
						Utils::WString line(lines.at(i));
161
						Utils::WString start = line.token(L":", 1).lower();
162
						Utils::WString rest = line.tokens(L":", 2).removeFirstSpace();
163
						if ( start.Compare(L"ExplorerSize") )
164
							this->Size = System::Drawing::Size(rest.token(L" ", 1).toInt(), rest.token(L" ", 2).toInt());
165
						else if ( start.Compare(L"ExplorerPos") )
1 cycrow 166
						{
222 cycrow 167
							m_iLocX = rest.token(L" ", 1).toInt();
168
							m_iLocY = rest.token(L" ", 2).toInt();
1 cycrow 169
						}
222 cycrow 170
						else if ( start.Compare(L"Loaded") )
171
							m_pLoadedList->pushBack(rest);
172
						else if ( start.Compare(L"ExplorerMax") )
1 cycrow 173
							this->WindowState = FormWindowState::Maximized;
174
					}
175
				}
176
			}
177
		}
178
 
179
 
180
		void UpdateDisplay()
181
		{
182
			bool e = (this->tabControl1->HasChildren) ? true : false;
183
 
184
			SpkForm ^active = this->GetActiveChild();
185
			CBaseFile *activePackage = NULL;
186
			if ( active )
187
				activePackage = active->GetPackage();
188
			else
189
				e = false;
190
 
191
			this->panel1->Visible = e;
192
			this->tabControl1->Visible = e;
193
			this->ToolPaste->Enabled = false;
194
 
195
			bool e2 = (activePackage) ? e : false;
196
 
197
			this->ToolExtract->Visible = false;
198
			this->ToolExtract2->Visible = false;
199
			this->ToolExtractAll2->Visible = false;
200
			this->toolStripButton1->Visible = false;
201
			this->ToolAdd->Visible = false;
202
			this->ToolAdd2->Visible = false;
203
			this->ToolRemove->Visible = false;
204
			this->ToolRemove2->Visible = false;
205
 
206
			if ( active &&  active->IsMultiPackage() )
207
			{
208
				this->ToolExtract2->Visible = true;
209
				this->ToolExtractAll2->Visible = true;
210
				this->ToolAdd2->Visible = true;
211
				this->ToolRemove2->Visible = true;
212
			}
213
			else
214
			{
215
				this->ToolExtract->Visible = true;
216
				this->toolStripButton1->Visible = true;
217
				this->ToolAdd->Visible = true;
218
				this->ToolRemove->Visible = true;
219
			}
220
 
221
			this->toolStripMenuItem1->Enabled = e;
222
			this->ToolExtractAll2->Enabled = e;
223
			this->toolStripButton1->Enabled = e2;
224
			this->ToolAdd->Enabled = e;
225
			this->ToolAdd2->Enabled = e;
226
			this->ToolInfo->Enabled = e2;
227
			this->toolStripMenuItem3->Enabled = e;
228
			if ( e && m_lCopiedFiles->size() )
229
				this->ToolPaste->Enabled = e2;
230
 
231
			this->UpdateDropDownOpen();
232
 
233
			if ( !e )
234
			{
235
				this->SelectedFile(false);
236
				this->SelectedPackage(false, false);
237
			}
238
 
239
			if ( !e || !activePackage )
240
				this->StatusFiles->Text = "";
241
			else
170 cycrow 242
				this->StatusFiles->Text = "Files: " + activePackage->fileList().size() + " (" + _US(activePackage->fileSizeString()) + ")";
1 cycrow 243
		}
244
 
245
		void SelectedFile(bool selected)
246
		{
247
			this->ToolExtract->Enabled = selected;
248
			this->ToolRemove->Enabled = selected;
249
		}
250
 
251
		void SelectedPackage(bool fSelected, bool pSelected)
252
		{
253
			this->ToolInfo->Enabled = pSelected;
254
			this->ToolExtract2->Enabled = (fSelected || pSelected) ? true : false;
255
			this->packagesToolStripMenuItem->Enabled = pSelected;
256
			this->filesToolStripMenuItem->Enabled = fSelected;
257
			this->ToolRemove2->Enabled = (fSelected || pSelected) ? true : false;
258
			this->toolStripMenuItem2->Enabled = pSelected;
259
			this->toolStripMenuItem4->Enabled = pSelected;
260
			this->toolStripMenuItem5->Enabled = pSelected;
261
			this->toolStripMenuItem6->Enabled = fSelected;
262
		}
263
 
264
 
265
		void UpdateDropDownOpen()
266
		{
267
			// clear them all
268
			this->toolStripSplitButton1->DropDownItems->Clear();
269
 
270
			System::Windows::Forms::ToolStripMenuItem ^newItem = gcnew System::Windows::Forms::ToolStripMenuItem;
271
			newItem->Text = "Open Directory";
272
			newItem->Tag = "$DIR";
273
			newItem->Click += gcnew System::EventHandler(this, &Form1::Event_Open);
274
			this->toolStripSplitButton1->DropDownItems->Add(newItem);
275
 
276
			this->toolStripSplitButton1->DropDownItems->Add(gcnew System::Windows::Forms::ToolStripSeparator());
277
 
278
			// add all none open items
222 cycrow 279
			for (auto itr = m_pLoadedList->begin(); itr != m_pLoadedList->end(); itr++)
1 cycrow 280
			{
281
				// check if we have it open
222 cycrow 282
				System::String ^sFile = _US((*itr)->str.findReplace(L"/", L"\\"));
1 cycrow 283
				if ( this->IsOpen(sFile) )
284
					continue;
222 cycrow 285
				if ( this->IsOpen(_US((*itr)->str.findReplace(L"\\", L"/"))) )
1 cycrow 286
					continue;
287
 
288
				// otherwise add it to the list
289
				System::Windows::Forms::ToolStripMenuItem ^newItem = gcnew System::Windows::Forms::ToolStripMenuItem;
290
				newItem->Text = sFile;
291
				newItem->Tag = newItem->Text;
292
				newItem->Click += gcnew System::EventHandler(this, &Form1::Event_Open);
293
				this->toolStripSplitButton1->DropDownItems->Add(newItem);
294
			}
295
		}
296
 
297
		void SaveData()
298
		{
299
			System::String ^mydoc = Environment::GetFolderPath(Environment::SpecialFolder::Personal );
222 cycrow 300
			CFileIO Config(_WS(mydoc) + L"/Egosoft/spkexplorer.dat");
301
			Utils::WStringList lines;
1 cycrow 302
 
303
			if ( this->WindowState == FormWindowState::Normal )
304
			{
222 cycrow 305
				lines.pushBack(Utils::WString(L"ExplorerSize:") + (long)this->Size.Width + L" " + (long)this->Size.Height);
306
				lines.pushBack(Utils::WString(L"ExplorerPos:") + (long)this->Location.X + L" " + (long)this->Location.Y);
1 cycrow 307
			}
308
			else
309
			{
222 cycrow 310
				lines.pushBack(Utils::WString(L"ExplorerPos:") + (long)this->RestoreBounds.Location.X + L" " + (long)this->RestoreBounds.Location.Y);
311
				lines.pushBack(Utils::WString(L"ExplorerSize:") + (long)this->RestoreBounds.Size.Width + L" " + (long)this->RestoreBounds.Size.Height);
1 cycrow 312
			}
313
 
314
			if ( this->WindowState == FormWindowState::Maximized )
222 cycrow 315
				lines.pushBack(L"ExplorerMax:");
1 cycrow 316
 
222 cycrow 317
			for (auto itr = m_pLoadedList->begin(); itr != m_pLoadedList->end(); itr++)
318
				lines.pushBack(Utils::WString(L"Loaded:") + (*itr)->data + L" " + (*itr)->str);
160 cycrow 319
			Config.writeFile(&lines);
1 cycrow 320
		}
321
		void CloseEvent(System::Object ^Sender, System::EventArgs ^E) 
322
		{
323
			this->CloseAll();
324
			this->SaveData();
325
		}
326
 
327
	protected:
328
		int		m_iLocX;
329
		int		m_iLocY;
330
 
331
		CPackages *m_pPackages;
332
 
333
private: System::Windows::Forms::Panel^  panel1;
334
protected: 
335
private: System::Windows::Forms::Button^  button1;
336
private: System::Windows::Forms::ToolTip^  toolTip1;
337
private: System::Windows::Forms::Timer^  timer1;
338
private: System::Windows::Forms::ToolStripButton^  ToolAdd;
339
private: System::Windows::Forms::ToolStripButton^  ToolRemove;
340
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator4;
341
private: System::Windows::Forms::ToolStripButton^  ToolPaste;
342
private: System::Windows::Forms::ImageList^  imageList1;
343
private: System::Windows::Forms::StatusStrip^  statusStrip1;
344
private: System::Windows::Forms::ToolStripStatusLabel^  StatusFiles;
345
private: System::Windows::Forms::ToolStripMenuItem^  layoutToolStripMenuItem;
346
private: System::Windows::Forms::ToolStripMenuItem^  maximisedToolStripMenuItem;
347
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator5;
348
private: System::Windows::Forms::ToolStripMenuItem^  cascadeToolStripMenuItem;
349
private: System::Windows::Forms::ToolStripMenuItem^  tileVerticallyToolStripMenuItem;
350
private: System::Windows::Forms::ToolStripMenuItem^  tileHorizontalToolStripMenuItem;
351
private: System::Windows::Forms::ToolStripMenuItem^  ToolWindows;
352
 
353
private: System::Windows::Forms::ToolStripMenuItem^  closeAllToolStripMenuItem;
354
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator6;
355
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator7;
356
private: System::Windows::Forms::ToolStripButton^  ToolInfo;
357
private: System::Windows::Forms::ToolStripButton^  ToolExtract;
358
private: System::Windows::Forms::ToolStripButton^  toolStripButton1;
359
private: System::Windows::Forms::ContextMenuStrip^  contextMenuStrip1;
360
private: System::Windows::Forms::ToolStripMenuItem^  packageToolStripMenuItem;
361
private: System::Windows::Forms::ToolStripMenuItem^  fileToolStripMenuItem1;
362
private: System::Windows::Forms::ToolStripDropDownButton^  ToolExtract2;
363
 
364
private: System::Windows::Forms::ToolStripMenuItem^  packagesToolStripMenuItem;
365
private: System::Windows::Forms::ToolStripMenuItem^  filesToolStripMenuItem;
366
private: System::Windows::Forms::ToolStripDropDownButton^  ToolExtractAll2;
367
private: System::Windows::Forms::ToolStripMenuItem^  toolStripMenuItem1;
368
private: System::Windows::Forms::ToolStripMenuItem^  toolStripMenuItem2;
369
private: System::Windows::Forms::ToolStripDropDownButton^  ToolAdd2;
370
private: System::Windows::Forms::ToolStripMenuItem^  toolStripMenuItem3;
371
private: System::Windows::Forms::ToolStripMenuItem^  toolStripMenuItem4;
372
private: System::Windows::Forms::ToolStripDropDownButton^  ToolRemove2;
373
private: System::Windows::Forms::ToolStripMenuItem^  toolStripMenuItem5;
374
private: System::Windows::Forms::ToolStripMenuItem^  toolStripMenuItem6;
375
private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator3;
376
		/// <summary>
377
		/// Clean up any resources being used.
378
		/// </summary>
379
		~Form1()
380
		{
381
			if (components)
382
			{
383
				delete components;
384
			}
385
			delete m_pLoadedList;
386
		}
387
	private: System::Windows::Forms::MenuStrip^  menuStrip1;
388
	protected: 
389
	private: System::Windows::Forms::ToolStripMenuItem^  fileToolStripMenuItem;
390
	private: System::Windows::Forms::ToolStripMenuItem^  openToolStripMenuItem;
391
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator1;
392
	private: System::Windows::Forms::ToolStripMenuItem^  exitToolStripMenuItem;
393
	private: System::Windows::Forms::ToolStrip^  toolStrip1;
394
	private: System::Windows::Forms::ToolStripSplitButton^  toolStripSplitButton1;
395
	private: System::Windows::Forms::ToolStripMenuItem^  viewToolStripMenuItem;
396
	private: System::Windows::Forms::ToolStripMenuItem^  detailsToolStripMenuItem;
397
	private: System::Windows::Forms::ToolStripMenuItem^  largeIconToolStripMenuItem;
398
 
399
	private: System::Windows::Forms::ToolStripMenuItem^  listToolStripMenuItem;
400
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator2;
401
 
402
 
403
	private: System::Windows::Forms::TabControl^  tabControl1;
404
 
405
	private:
406
		SpkForm ^GetActiveChild()
407
		{
408
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
409
			 for ( int i = 0; i < children->Length; i++ )
410
			 {
411
				 SpkForm ^childForm = (SpkForm ^)children[i];
412
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
413
					 return childForm;
414
			 }
415
 
416
			 return nullptr;
417
		}
418
 
419
		bool IsOpen(System::String ^file)
420
		{
421
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
422
			 for ( int i = 0; i < children->Length; i++ )
423
			 {
424
				 SpkForm ^childForm = (SpkForm ^)children[i];
425
				 if ( childForm->CheckFilename(file) )
426
					 return true;
427
			 }
428
 
429
			 return false;
430
		}
431
 
432
		void ExtractSelected()
433
		{
434
			SpkForm ^child = this->GetActiveChild();
435
			if ( child )
436
			{
437
				System::String ^toDir = GetExtractDir(false);
438
				if ( toDir )
439
					child->ExtractSelected(toDir);
440
			}
441
		}
442
		void ExtractSelectedPackage()
443
		{
444
			SpkForm ^child = this->GetActiveChild();
445
			if ( child && child->IsMultiPackage() )
446
			{
447
				System::String ^toDir = GetExtractDir(true);
448
				if ( toDir )
449
					child->ExtractSelectedPackage(toDir);
450
			}
451
		}
452
 
453
		System::String ^GetExtractDir(bool package)
454
		{
455
			SpkForm ^child = this->GetActiveChild();
456
			if ( child )
457
				return child->GetExtractDir(package);
458
 
459
			return nullptr;
460
		}
461
 
462
		void ExtractAll()
463
		{
464
			SpkForm ^child = this->GetActiveChild();
465
			if ( child )
466
			{
467
				System::String ^toDir = GetExtractDir(false);
468
				if ( toDir )
469
					child->ExtractAll(toDir);
470
			}
471
		}
472
 
473
		void ExtractAllPackage()
474
		{
475
			SpkForm ^child = this->GetActiveChild();
476
			if ( child && child->IsMultiPackage() )
477
			{
478
				System::String ^toDir = GetExtractDir(false);
479
				if ( toDir )
480
					child->ExtractAllPackage(toDir);
481
			}
482
		}
483
 
484
		void OpenDirectory(System::String ^dir)
485
		{
486
			if ( !System::IO::Directory::Exists(dir) )
487
			{
488
				MessageBox::Show(this, "Unable to open packages from directory\nDirectory not found\n\n" + dir, "Load Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
489
				return;
490
			}
491
 
492
			this->OpenFiles(System::IO::Directory::GetFiles(dir, "*.spk"), false, false);
493
			this->OpenFiles(System::IO::Directory::GetFiles(dir, "*.xsp"), false, false);
494
		}
495
 
496
		void OpenFiles(cli::array<System::String ^> ^list, bool checkExtension, bool display)
497
		{
498
			if ( !list )
499
				return;
500
 
501
			for ( int i = 0; i < list->Length; i++ )
502
				this->Open(list[i], display, checkExtension);
503
 
504
			cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
505
			for ( int i = 0; i < children->Length; i++ )
506
			{
507
				SpkForm ^childForm = (SpkForm ^)children[i];
508
				if ( !childForm->TabPage()->Visible )
509
				{
510
					childForm->Show();
511
					childForm->TabPage()->Show();
512
				}
513
			}
514
		}
515
 
516
		void OpenFiles(ArrayList ^list, bool checkExtension, bool display)
517
		{
518
			if ( !list )
519
				return;
520
 
521
			for ( int i = 0; i < list->Count; i++ )
522
				this->Open(cli::safe_cast<String ^>(list[i]), display, checkExtension);
523
 
524
			cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
525
			for ( int i = 0; i < children->Length; i++ )
526
			{
527
				SpkForm ^childForm = (SpkForm ^)children[i];
528
				if ( !childForm->TabPage()->Visible )
529
				{
530
					childForm->Show();
531
					childForm->TabPage()->Show();
532
				}
533
			}
534
		}
535
 
536
		void Open(System::String ^file, bool display, bool checkExtension)
537
		{
538
			if ( checkExtension )
539
			{
540
				if ( String::Compare(IO::FileInfo(file).Extension, ".spk") != 0 && String::Compare(IO::FileInfo(file).Extension, ".xsp") != 0 )
541
					return;
542
			}
543
 
544
			if ( !System::IO::File::Exists(file) )
545
			{
546
				if ( display )
547
					MessageBox::Show(this, "Unable to open package file:\n" + file + "\n\nFile doesn't exist", "Load Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
548
				return;
549
			}
550
 
551
			float fVersion;
222 cycrow 552
			Utils::WString sFile = _WS(file);
1 cycrow 553
			int fileType = CSpkFile::CheckFile(sFile, &fVersion);
554
 
555
			if ( fVersion > (float)FILEVERSION )
556
			{
557
				if ( display )
558
					MessageBox::Show(this, "Package file is created with a newer version, unable to open", "Load Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
559
				return;
560
			}
561
 
562
			if ( fileType == SPKFILE_INVALID )
563
			{
564
				if ( display )
565
				{
566
					if ( String::Compare(IO::FileInfo(file).Extension, ".xsp") == 0)
567
					{
568
						if ( MessageBox::Show(this, "Invalid package file:\n" + file + "\n\nThis could be an old format XSP file, would u like to attempt to convert the file?\nThis will overright the existing file", "Load Error", MessageBoxButtons::YesNo, MessageBoxIcon::Error) == Windows::Forms::DialogResult::Yes )
569
						{
570
							ConvertFile ^convert = gcnew ConvertFile(file);
571
							if ( convert->ShowDialog(this) == Windows::Forms::DialogResult::OK )
572
								this->Open(file, display, checkExtension);
573
							else
574
								MessageBox::Show(this, "Invalid package file:\n" + file + "\n\nUnable to convert package\nDoesn't appear to be a valid package", "Load Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
575
						}
576
					}
577
					else
578
						MessageBox::Show(this, "Invalid package file:\n" + file + "\n\nDoesn't appear to be a valid package", "Load Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
579
				}
580
				return;				
581
			}
582
 
583
			// open multi package
584
			TabPage ^tp;
585
			SpkForm ^childForm;
586
 
587
			int error;
588
			if ( fileType == SPKFILE_MULTI )
589
			{
182 cycrow 590
				CMultiSpkFile *mspk = m_pPackages->openMultiPackage(sFile, &error);
1 cycrow 591
				if ( mspk )
592
				{
593
					tp = gcnew TabPage();
129 cycrow 594
					childForm = gcnew SpkForm(this, tabControl1, tp, m_pPackages);
1 cycrow 595
					childForm->SetMultiPackage(mspk, file);
596
					tp->ImageIndex = this->imageList1->Images->IndexOfKey("multi");
597
					if ( tp->ImageIndex == -1 )
598
						tp->ImageIndex = 0;
599
				}
600
			}
601
			else
602
			{
182 cycrow 603
				CBaseFile *package = m_pPackages->openPackage(sFile, &error, 0, SPKREAD_NODATA);
1 cycrow 604
				if ( package )
605
				{
606
					tp = gcnew TabPage();
607
					if ( this->imageList1->Images->IndexOfKey(file) == -1 )
608
					{
170 cycrow 609
						if (package->icon())
1 cycrow 610
						{
611
							package->ReadIconFileToMemory();
197 cycrow 612
							Utils::WString sIconFile = _WS(IO::Path::GetTempPath()) + L"\\" + CFileIO(sFile).baseName() + L"." + package->iconExt();
224 cycrow 613
							if ( package->extractFile(package->icon(), CFileIO(sIconFile).fullFilename(), false))
1 cycrow 614
							{
170 cycrow 615
								String ^iconFile = _US(sIconFile);
1 cycrow 616
								if ( IO::File::Exists(iconFile) )
617
								{
618
									String ^ext = System::IO::FileInfo(iconFile).Extension;
619
									if ( !String::Compare(ext, "bmp", false) || !String::Compare(ext, "ico", false) )
620
										this->imageList1->Images->Add(file, Bitmap::FromFile(iconFile));
621
									else
622
									{
623
										Bitmap ^myBitmap = gcnew Bitmap(iconFile);
624
										if ( myBitmap )
625
											this->imageList1->Images->Add(file, myBitmap);
626
									}
627
								}
628
							}
629
						}
630
					}
631
 
632
					tp->ImageIndex = this->imageList1->Images->IndexOfKey(file);
633
					if ( tp->ImageIndex == -1 )
634
						tp->ImageIndex = 0;
635
 
129 cycrow 636
					childForm = gcnew SpkForm(this, tabControl1, tp, m_pPackages);
1 cycrow 637
					childForm->SetPackage(package, file);
638
				}
639
			}
640
 
641
			if ( tp && childForm )
642
			{
643
				ToolStripMenuItem ^toolBut = gcnew ToolStripMenuItem(file, this->imageList1->Images[tp->ImageIndex], gcnew System::EventHandler(this, &Form1::WindowSelectEvent));
644
				childForm->SetToolButton(toolBut);
645
				this->ToolWindows->DropDownItems->Add(toolBut);
646
				tp->Parent = tabControl1;
647
				childForm->Text = file;
648
				if ( display || !this->HasChildren )
649
				{
650
					tp->Show();
651
					childForm->Show();
652
					tabControl1->SelectedTab = tp;
653
				}
654
				childForm->WindowState = FormWindowState::Maximized;
655
				childForm->ChangeView(m_curView);
656
 
657
				// adjust the loaded list
222 cycrow 658
				sFile = sFile.findReplace(L"/", L"\\").remove(9).remove('\r').remove('\n');
659
				m_pLoadedList->remove(sFile);
660
				m_pLoadedList->pushFront(sFile);
1 cycrow 661
 
222 cycrow 662
				while ( m_pLoadedList->size() > 15 )
663
					m_pLoadedList->popBack();
1 cycrow 664
 
665
				this->SaveData();
666
 
667
				this->UpdateDropDownOpen();
668
			}	
669
			else
670
			{
671
				if ( display )
672
				{
191 cycrow 673
					System::String ^sError = "Unknown Error (" + _US(Utils::WString::Number(error)) + ")";
1 cycrow 674
					switch ( error )
675
					{
676
						case INSTALLERR_OLD:
677
							sError = "Old unsupported package file";
678
							break;
679
						case INSTALLERR_INVALID:
680
							sError = "Invalid Package File";
681
							break;
682
						case INSTALLERR_NOMULTI:
683
							sError = "Multi-Packages not currently supported";
684
							break;
685
					}
686
					MessageBox::Show(this, "Unable to open package file:\n" + file + "\n\nError: " + sError, "Load Error", MessageBoxButtons::OK, MessageBoxIcon::Error);
687
				}
688
			}
689
		}
690
 
691
		void Open()
692
		{
693
			OpenFileDialog ^ofd = gcnew OpenFileDialog();
694
			ofd->Filter = "All (*.spk *.xsp)|*.spk;*.xsp|Package Files (*.spk)|*.spk|Ship Files (*.xsp)|*.xsp";
695
			ofd->FilterIndex = 1;
696
			ofd->RestoreDirectory = true;
697
			ofd->Multiselect = true;
698
 
699
			if ( ofd->ShowDialog() == System::Windows::Forms::DialogResult::OK )
700
				this->OpenFiles(ofd->FileNames, false, true);
701
		}
702
 
703
		void CloseAll()
704
		{
705
			cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
706
			for ( int i = 0; i < children->Length; i++ )
707
			{
708
				delete ((SpkForm ^)children[i])->TabPage();
709
				delete children[i];
710
			}
711
			this->RemoveCopied(true);
712
			this->UpdateDisplay();
713
		}
714
 
715
		void ChangeView(System::Windows::Forms::View view)
716
		{
717
			this->listToolStripMenuItem->Checked = false;
718
			this->largeIconToolStripMenuItem->Checked = false;
719
			this->detailsToolStripMenuItem->Checked = false;
720
 
721
			cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
722
			for ( int i = 0; i < children->Length; i++ )
723
			{
724
				SpkForm ^childForm = (SpkForm ^)children[i];
725
				childForm->ChangeView(view);
726
			}
727
 
728
			m_curView = view;
729
		}
730
 
731
		void LoadFiles(String ^loadFrom)
732
		{
733
			if ( System::IO::File::Exists(loadFrom) )
734
			{
735
				System::String ^lines = System::IO::File::ReadAllText(loadFrom);
736
				try { System::IO::File::Delete(loadFrom); }
737
				catch (System::IO::IOException ^) {}
738
				catch (System::Exception ^) {}
739
 
740
				if ( lines )
741
				{
742
					CyString strLines = CyStringFromSystemString(lines);
743
					int num;
744
					CyString *aLines = strLines.SplitToken("\n", &num);
745
					if ( num && aLines )
746
					{
747
						ArrayList ^list = gcnew ArrayList();
748
						for ( int i = 0; i < num; i++ )
749
						{
750
							CyString l = aLines[i];
751
							l = l.Remove("\r");
752
							CyString first = l.GetToken(":", 1, 1);
753
							CyString rest = l.GetToken(":", 2);
754
							rest.RemoveFirstSpace();
755
 
756
							if ( first.Compare("File") )
191 cycrow 757
								list->Add(_US(rest.ToString()));
1 cycrow 758
						}
759
 
760
						this->OpenFiles(list, true, true);
761
 
762
						CLEANSPLIT(aLines, num);
763
					}
764
				}
765
			}			
766
		}
767
 
768
		void AddPackage()
769
		{
770
			SpkForm ^active = this->GetActiveChild();
771
			if ( !active )
772
				return;
773
 
774
			if ( !active->IsMultiPackage() )
775
				return;
776
 
777
			OpenFileDialog ^ofd = gcnew OpenFileDialog();
778
 
779
			ofd->Filter = "All Vaild|*.spk;*.xsp|Packages|*.spk|Ships|*.xsp";
780
			ofd->FilterIndex = 1;
781
			ofd->RestoreDirectory = true;
782
			ofd->Multiselect = true;
783
			ofd->Title = "Select packages(s) to add";
784
			if ( ofd->ShowDialog() == System::Windows::Forms::DialogResult::OK )
785
			{
786
				AddDialog ^ad = gcnew AddDialog(NULL, active->GetMultiPackage());
787
				ad->AddFileArray(ofd->FileNames, "", -1, 0);
788
				ad->ShowDialog(this);
789
 
790
				active->UpdateView(false);
791
			}
792
		}
793
 
794
		void AddFile()
795
		{
796
			SpkForm ^active = this->GetActiveChild();
797
			if ( !active )
798
				return;
799
			CBaseFile *activePackage = active->GetPackage();
800
			if ( !activePackage )
801
				return;
802
 
803
			// add filters
804
			OpenFileDialog ^ofd = gcnew OpenFileDialog();
805
 
806
			System::String ^filter;
807
			for ( int i = 0; i < FILETYPE_MAX; i++ )
808
			{
809
				if ( filter )
810
					filter += "|";
191 cycrow 811
				filter += _US(GetFileTypeString(i));
1 cycrow 812
				filter += "|";
813
				// add extensions
814
				switch ( i )
815
				{
816
					case FILETYPE_SCRIPT:
817
					case FILETYPE_UNINSTALL:
818
					case FILETYPE_MAP:
819
					case FILETYPE_TEXT:
820
					case FILETYPE_MISSION:
821
						filter += "*.pck;*.xml";
822
						break;
823
 
824
					case FILETYPE_README:
825
						filter += "*.txt;*.doc";
826
						break;
827
 
828
					case FILETYPE_MOD:
829
						filter += "*.cat";
830
						break;
831
 
832
					case FILETYPE_SOUND:
833
						filter += "*.wav";
834
						break;
835
 
836
					case FILETYPE_SCREEN:
837
					case FILETYPE_ADVERT:
838
						filter += "*.jpg;*.png";
839
						break;
840
 
841
					case FILETYPE_SHIPSCENE:
842
					case FILETYPE_COCKPITSCENE:
843
						filter += "*.pbd;*.bod";
844
						break;
845
 
846
					case FILETYPE_SHIPMODEL:
847
						filter += "*.pbd;*.bod;*.bob;*.pbb";
848
						break;
849
 
850
					default:
851
						filter += "*.*";
852
				}
853
			}
854
			ofd->Filter = filter;
855
			ofd->FilterIndex = 1;
856
			ofd->RestoreDirectory = true;
857
			ofd->Multiselect = true;
858
			ofd->Title = "Select File(s) to add to package";
859
			if ( ofd->ShowDialog() == System::Windows::Forms::DialogResult::OK )
860
			{
861
				System::String ^dir;
862
				if ( (ofd->FilterIndex - 1) == FILETYPE_EXTRA )
863
				{
864
					InputBox ^input = gcnew InputBox("Enter the directory for extra files", "PluginManager/Extras/$scriptname");
865
					if ( input->ShowDialog() == System::Windows::Forms::DialogResult::OK )
866
						dir = input->GetInput();
867
				}
868
 
869
				AddDialog ^ad = gcnew AddDialog(activePackage, active->GetMultiPackage());
870
				ad->AddFileArray(ofd->FileNames, dir, ofd->FilterIndex - 1, 0);
871
				ad->ShowDialog(this);
872
 
873
				active->UpdateView(false);
874
			}
875
		}
876
 
877
		void RemoveSelectedPackage()
878
		{
879
			SpkForm ^child = this->GetActiveChild();
880
			if ( child )
881
				child->RemoveSelectedPackage();
882
		}
883
		void RemoveSelected()
884
		{
885
			SpkForm ^child = this->GetActiveChild();
886
			if ( child )
887
				child->RemoveSelected();
888
		}
889
 
890
		System::Windows::Forms::View m_curView;
222 cycrow 891
		Utils::WStringList		*m_pLoadedList;
1 cycrow 892
		CLinkList<C_File>	*m_lCopiedFiles;
893
		SpkForm				^m_pCutFrom;
894
		CLinkList<C_File>	*m_lDraggedFiles;
895
		SpkForm				^m_pDraggedFrom;
896
 
897
private: System::ComponentModel::IContainer^  components;
898
		 /// <summary>
899
		/// Required designer variable.
900
		/// </summary>
901
 
902
 
903
#pragma region Windows Form Designer generated code
904
		/// <summary>
905
		/// Required method for Designer support - do not modify
906
		/// the contents of this method with the code editor.
907
		/// </summary>
908
		void InitializeComponent(void)
909
		{
910
			this->components = (gcnew System::ComponentModel::Container());
911
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
912
			this->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
913
			this->fileToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
914
			this->openToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
915
			this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());
916
			this->exitToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
917
			this->viewToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
918
			this->layoutToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
919
			this->maximisedToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
920
			this->cascadeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
921
			this->tileVerticallyToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
922
			this->tileHorizontalToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
923
			this->toolStripSeparator5 = (gcnew System::Windows::Forms::ToolStripSeparator());
924
			this->detailsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
925
			this->largeIconToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
926
			this->listToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
927
			this->ToolWindows = (gcnew System::Windows::Forms::ToolStripMenuItem());
928
			this->closeAllToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
929
			this->toolStripSeparator6 = (gcnew System::Windows::Forms::ToolStripSeparator());
930
			this->toolStrip1 = (gcnew System::Windows::Forms::ToolStrip());
931
			this->toolStripSplitButton1 = (gcnew System::Windows::Forms::ToolStripSplitButton());
932
			this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
933
			this->ToolAdd = (gcnew System::Windows::Forms::ToolStripButton());
934
			this->ToolAdd2 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
935
			this->toolStripMenuItem3 = (gcnew System::Windows::Forms::ToolStripMenuItem());
936
			this->toolStripMenuItem4 = (gcnew System::Windows::Forms::ToolStripMenuItem());
937
			this->ToolRemove2 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
938
			this->toolStripMenuItem5 = (gcnew System::Windows::Forms::ToolStripMenuItem());
939
			this->toolStripMenuItem6 = (gcnew System::Windows::Forms::ToolStripMenuItem());
940
			this->ToolRemove = (gcnew System::Windows::Forms::ToolStripButton());
941
			this->toolStripSeparator3 = (gcnew System::Windows::Forms::ToolStripSeparator());
942
			this->ToolExtract2 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
943
			this->packagesToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
944
			this->filesToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
945
			this->ToolExtract = (gcnew System::Windows::Forms::ToolStripButton());
946
			this->ToolExtractAll2 = (gcnew System::Windows::Forms::ToolStripDropDownButton());
947
			this->toolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
948
			this->toolStripMenuItem2 = (gcnew System::Windows::Forms::ToolStripMenuItem());
949
			this->toolStripButton1 = (gcnew System::Windows::Forms::ToolStripButton());
950
			this->toolStripSeparator4 = (gcnew System::Windows::Forms::ToolStripSeparator());
951
			this->ToolPaste = (gcnew System::Windows::Forms::ToolStripButton());
952
			this->toolStripSeparator7 = (gcnew System::Windows::Forms::ToolStripSeparator());
953
			this->ToolInfo = (gcnew System::Windows::Forms::ToolStripButton());
954
			this->tabControl1 = (gcnew System::Windows::Forms::TabControl());
955
			this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
956
			this->panel1 = (gcnew System::Windows::Forms::Panel());
957
			this->button1 = (gcnew System::Windows::Forms::Button());
958
			this->toolTip1 = (gcnew System::Windows::Forms::ToolTip(this->components));
959
			this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
960
			this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
961
			this->StatusFiles = (gcnew System::Windows::Forms::ToolStripStatusLabel());
962
			this->contextMenuStrip1 = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
963
			this->packageToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
964
			this->fileToolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
965
			this->menuStrip1->SuspendLayout();
966
			this->toolStrip1->SuspendLayout();
967
			this->panel1->SuspendLayout();
968
			this->statusStrip1->SuspendLayout();
969
			this->contextMenuStrip1->SuspendLayout();
970
			this->SuspendLayout();
971
			// 
972
			// menuStrip1
973
			// 
974
			this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(3) {this->fileToolStripMenuItem, 
975
				this->viewToolStripMenuItem, this->ToolWindows});
976
			this->menuStrip1->LayoutStyle = System::Windows::Forms::ToolStripLayoutStyle::HorizontalStackWithOverflow;
977
			this->menuStrip1->Location = System::Drawing::Point(0, 0);
978
			this->menuStrip1->Name = L"menuStrip1";
979
			this->menuStrip1->Size = System::Drawing::Size(746, 24);
980
			this->menuStrip1->TabIndex = 1;
981
			this->menuStrip1->Text = L"menuStrip1";
982
			// 
983
			// fileToolStripMenuItem
984
			// 
985
			this->fileToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(3) {this->openToolStripMenuItem, 
986
				this->toolStripSeparator1, this->exitToolStripMenuItem});
987
			this->fileToolStripMenuItem->Name = L"fileToolStripMenuItem";
988
			this->fileToolStripMenuItem->Size = System::Drawing::Size(37, 20);
989
			this->fileToolStripMenuItem->Text = L"&File";
990
			// 
991
			// openToolStripMenuItem
992
			// 
993
			this->openToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"openToolStripMenuItem.Image")));
994
			this->openToolStripMenuItem->Name = L"openToolStripMenuItem";
995
			this->openToolStripMenuItem->Size = System::Drawing::Size(103, 22);
996
			this->openToolStripMenuItem->Text = L"&Open";
997
			this->openToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::openToolStripMenuItem_Click);
998
			// 
999
			// toolStripSeparator1
1000
			// 
1001
			this->toolStripSeparator1->Name = L"toolStripSeparator1";
1002
			this->toolStripSeparator1->Size = System::Drawing::Size(100, 6);
1003
			// 
1004
			// exitToolStripMenuItem
1005
			// 
1006
			this->exitToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"exitToolStripMenuItem.Image")));
1007
			this->exitToolStripMenuItem->Name = L"exitToolStripMenuItem";
1008
			this->exitToolStripMenuItem->Size = System::Drawing::Size(103, 22);
1009
			this->exitToolStripMenuItem->Text = L"E&xit";
1010
			this->exitToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::exitToolStripMenuItem_Click);
1011
			// 
1012
			// viewToolStripMenuItem
1013
			// 
1014
			this->viewToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(5) {this->layoutToolStripMenuItem, 
1015
				this->toolStripSeparator5, this->detailsToolStripMenuItem, this->largeIconToolStripMenuItem, this->listToolStripMenuItem});
1016
			this->viewToolStripMenuItem->Name = L"viewToolStripMenuItem";
1017
			this->viewToolStripMenuItem->Size = System::Drawing::Size(44, 20);
1018
			this->viewToolStripMenuItem->Text = L"&View";
1019
			// 
1020
			// layoutToolStripMenuItem
1021
			// 
1022
			this->layoutToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(4) {this->maximisedToolStripMenuItem, 
1023
				this->cascadeToolStripMenuItem, this->tileVerticallyToolStripMenuItem, this->tileHorizontalToolStripMenuItem});
1024
			this->layoutToolStripMenuItem->Name = L"layoutToolStripMenuItem";
1025
			this->layoutToolStripMenuItem->Size = System::Drawing::Size(110, 22);
1026
			this->layoutToolStripMenuItem->Text = L"Layout";
1027
			// 
1028
			// maximisedToolStripMenuItem
1029
			// 
1030
			this->maximisedToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"maximisedToolStripMenuItem.Image")));
1031
			this->maximisedToolStripMenuItem->Name = L"maximisedToolStripMenuItem";
1032
			this->maximisedToolStripMenuItem->Size = System::Drawing::Size(151, 22);
1033
			this->maximisedToolStripMenuItem->Text = L"Maximised";
1034
			this->maximisedToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::maximisedToolStripMenuItem_Click);
1035
			// 
1036
			// cascadeToolStripMenuItem
1037
			// 
1038
			this->cascadeToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"cascadeToolStripMenuItem.Image")));
1039
			this->cascadeToolStripMenuItem->Name = L"cascadeToolStripMenuItem";
1040
			this->cascadeToolStripMenuItem->Size = System::Drawing::Size(151, 22);
1041
			this->cascadeToolStripMenuItem->Text = L"Cascade";
1042
			this->cascadeToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::cascadeToolStripMenuItem_Click);
1043
			// 
1044
			// tileVerticallyToolStripMenuItem
1045
			// 
1046
			this->tileVerticallyToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"tileVerticallyToolStripMenuItem.Image")));
1047
			this->tileVerticallyToolStripMenuItem->Name = L"tileVerticallyToolStripMenuItem";
1048
			this->tileVerticallyToolStripMenuItem->Size = System::Drawing::Size(151, 22);
1049
			this->tileVerticallyToolStripMenuItem->Text = L"Tile Vertical";
1050
			this->tileVerticallyToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::tileVerticallyToolStripMenuItem_Click);
1051
			// 
1052
			// tileHorizontalToolStripMenuItem
1053
			// 
1054
			this->tileHorizontalToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"tileHorizontalToolStripMenuItem.Image")));
1055
			this->tileHorizontalToolStripMenuItem->Name = L"tileHorizontalToolStripMenuItem";
1056
			this->tileHorizontalToolStripMenuItem->Size = System::Drawing::Size(151, 22);
1057
			this->tileHorizontalToolStripMenuItem->Text = L"Tile Horizontal";
1058
			this->tileHorizontalToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::tileHorizontalToolStripMenuItem_Click);
1059
			// 
1060
			// toolStripSeparator5
1061
			// 
1062
			this->toolStripSeparator5->Name = L"toolStripSeparator5";
1063
			this->toolStripSeparator5->Size = System::Drawing::Size(107, 6);
1064
			// 
1065
			// detailsToolStripMenuItem
1066
			// 
1067
			this->detailsToolStripMenuItem->Checked = true;
1068
			this->detailsToolStripMenuItem->CheckState = System::Windows::Forms::CheckState::Indeterminate;
1069
			this->detailsToolStripMenuItem->Name = L"detailsToolStripMenuItem";
1070
			this->detailsToolStripMenuItem->Size = System::Drawing::Size(110, 22);
1071
			this->detailsToolStripMenuItem->Text = L"Details";
1072
			this->detailsToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::detailsToolStripMenuItem_Click);
1073
			// 
1074
			// largeIconToolStripMenuItem
1075
			// 
1076
			this->largeIconToolStripMenuItem->Name = L"largeIconToolStripMenuItem";
1077
			this->largeIconToolStripMenuItem->Size = System::Drawing::Size(110, 22);
1078
			this->largeIconToolStripMenuItem->Text = L"Icons";
1079
			this->largeIconToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::largeIconToolStripMenuItem_Click);
1080
			// 
1081
			// listToolStripMenuItem
1082
			// 
1083
			this->listToolStripMenuItem->Name = L"listToolStripMenuItem";
1084
			this->listToolStripMenuItem->Size = System::Drawing::Size(110, 22);
1085
			this->listToolStripMenuItem->Text = L"List";
1086
			this->listToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::listToolStripMenuItem_Click);
1087
			// 
1088
			// ToolWindows
1089
			// 
1090
			this->ToolWindows->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->closeAllToolStripMenuItem, 
1091
				this->toolStripSeparator6});
1092
			this->ToolWindows->Name = L"ToolWindows";
1093
			this->ToolWindows->Size = System::Drawing::Size(68, 20);
1094
			this->ToolWindows->Text = L"Windows";
1095
			// 
1096
			// closeAllToolStripMenuItem
1097
			// 
1098
			this->closeAllToolStripMenuItem->Name = L"closeAllToolStripMenuItem";
1099
			this->closeAllToolStripMenuItem->Size = System::Drawing::Size(120, 22);
1100
			this->closeAllToolStripMenuItem->Text = L"Close All";
1101
			this->closeAllToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::closeAllToolStripMenuItem_Click);
1102
			// 
1103
			// toolStripSeparator6
1104
			// 
1105
			this->toolStripSeparator6->Name = L"toolStripSeparator6";
1106
			this->toolStripSeparator6->Size = System::Drawing::Size(117, 6);
1107
			// 
1108
			// toolStrip1
1109
			// 
1110
			this->toolStrip1->GripStyle = System::Windows::Forms::ToolStripGripStyle::Hidden;
1111
			this->toolStrip1->ImageScalingSize = System::Drawing::Size(32, 32);
1112
			this->toolStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(15) {this->toolStripSplitButton1, 
1113
				this->toolStripSeparator2, this->ToolAdd, this->ToolAdd2, this->ToolRemove2, this->ToolRemove, this->toolStripSeparator3, this->ToolExtract2, 
1114
				this->ToolExtract, this->ToolExtractAll2, this->toolStripButton1, this->toolStripSeparator4, this->ToolPaste, this->toolStripSeparator7, 
1115
				this->ToolInfo});
1116
			this->toolStrip1->LayoutStyle = System::Windows::Forms::ToolStripLayoutStyle::HorizontalStackWithOverflow;
1117
			this->toolStrip1->Location = System::Drawing::Point(0, 24);
1118
			this->toolStrip1->Name = L"toolStrip1";
1119
			this->toolStrip1->Size = System::Drawing::Size(746, 54);
1120
			this->toolStrip1->TabIndex = 2;
1121
			this->toolStrip1->Text = L"toolStrip1";
1122
			// 
1123
			// toolStripSplitButton1
1124
			// 
1125
			this->toolStripSplitButton1->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripSplitButton1.Image")));
1126
			this->toolStripSplitButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
1127
			this->toolStripSplitButton1->Name = L"toolStripSplitButton1";
1128
			this->toolStripSplitButton1->RightToLeft = System::Windows::Forms::RightToLeft::No;
1129
			this->toolStripSplitButton1->Size = System::Drawing::Size(84, 51);
1130
			this->toolStripSplitButton1->Text = L"Open";
1131
			this->toolStripSplitButton1->ButtonClick += gcnew System::EventHandler(this, &Form1::toolStripSplitButton1_ButtonClick);
1132
			// 
1133
			// toolStripSeparator2
1134
			// 
1135
			this->toolStripSeparator2->Name = L"toolStripSeparator2";
1136
			this->toolStripSeparator2->Size = System::Drawing::Size(6, 54);
1137
			// 
1138
			// ToolAdd
1139
			// 
1140
			this->ToolAdd->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ToolAdd.Image")));
1141
			this->ToolAdd->ImageTransparentColor = System::Drawing::Color::Magenta;
1142
			this->ToolAdd->Name = L"ToolAdd";
1143
			this->ToolAdd->Size = System::Drawing::Size(54, 51);
1144
			this->ToolAdd->Text = L"Add File";
1145
			this->ToolAdd->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageAboveText;
1146
			this->ToolAdd->Click += gcnew System::EventHandler(this, &Form1::toolStripButton2_Click);
1147
			// 
1148
			// ToolAdd2
1149
			// 
1150
			this->ToolAdd2->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->toolStripMenuItem3, 
1151
				this->toolStripMenuItem4});
1152
			this->ToolAdd2->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ToolAdd2.Image")));
1153
			this->ToolAdd2->ImageTransparentColor = System::Drawing::Color::Magenta;
1154
			this->ToolAdd2->Name = L"ToolAdd2";
1155
			this->ToolAdd2->Size = System::Drawing::Size(63, 51);
1156
			this->ToolAdd2->Text = L"Add File";
1157
			this->ToolAdd2->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageAboveText;
1158
			// 
1159
			// toolStripMenuItem3
1160
			// 
1161
			this->toolStripMenuItem3->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripMenuItem3.Image")));
1162
			this->toolStripMenuItem3->Name = L"toolStripMenuItem3";
1163
			this->toolStripMenuItem3->Size = System::Drawing::Size(123, 22);
1164
			this->toolStripMenuItem3->Text = L"Packages";
1165
			this->toolStripMenuItem3->Click += gcnew System::EventHandler(this, &Form1::toolStripMenuItem3_Click);
1166
			// 
1167
			// toolStripMenuItem4
1168
			// 
1169
			this->toolStripMenuItem4->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripMenuItem4.Image")));
1170
			this->toolStripMenuItem4->Name = L"toolStripMenuItem4";
1171
			this->toolStripMenuItem4->Size = System::Drawing::Size(123, 22);
1172
			this->toolStripMenuItem4->Text = L"Files";
1173
			this->toolStripMenuItem4->Click += gcnew System::EventHandler(this, &Form1::toolStripMenuItem4_Click);
1174
			// 
1175
			// ToolRemove2
1176
			// 
1177
			this->ToolRemove2->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->toolStripMenuItem5, 
1178
				this->toolStripMenuItem6});
1179
			this->ToolRemove2->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ToolRemove2.Image")));
1180
			this->ToolRemove2->ImageTransparentColor = System::Drawing::Color::Magenta;
1181
			this->ToolRemove2->Name = L"ToolRemove2";
1182
			this->ToolRemove2->Size = System::Drawing::Size(84, 51);
1183
			this->ToolRemove2->Text = L"Remove File";
1184
			this->ToolRemove2->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageAboveText;
1185
			// 
1186
			// toolStripMenuItem5
1187
			// 
1188
			this->toolStripMenuItem5->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripMenuItem5.Image")));
1189
			this->toolStripMenuItem5->Name = L"toolStripMenuItem5";
1190
			this->toolStripMenuItem5->Size = System::Drawing::Size(123, 22);
1191
			this->toolStripMenuItem5->Text = L"Packages";
1192
			this->toolStripMenuItem5->Click += gcnew System::EventHandler(this, &Form1::toolStripMenuItem5_Click);
1193
			// 
1194
			// toolStripMenuItem6
1195
			// 
1196
			this->toolStripMenuItem6->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripMenuItem6.Image")));
1197
			this->toolStripMenuItem6->Name = L"toolStripMenuItem6";
1198
			this->toolStripMenuItem6->Size = System::Drawing::Size(123, 22);
1199
			this->toolStripMenuItem6->Text = L"Files";
1200
			this->toolStripMenuItem6->Click += gcnew System::EventHandler(this, &Form1::toolStripMenuItem6_Click);
1201
			// 
1202
			// ToolRemove
1203
			// 
1204
			this->ToolRemove->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ToolRemove.Image")));
1205
			this->ToolRemove->ImageTransparentColor = System::Drawing::Color::Magenta;
1206
			this->ToolRemove->Name = L"ToolRemove";
1207
			this->ToolRemove->Size = System::Drawing::Size(75, 51);
1208
			this->ToolRemove->Text = L"Remove File";
1209
			this->ToolRemove->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageAboveText;
1210
			this->ToolRemove->Click += gcnew System::EventHandler(this, &Form1::ToolRemove_Click);
1211
			// 
1212
			// toolStripSeparator3
1213
			// 
1214
			this->toolStripSeparator3->Name = L"toolStripSeparator3";
1215
			this->toolStripSeparator3->Size = System::Drawing::Size(6, 54);
1216
			// 
1217
			// ToolExtract2
1218
			// 
1219
			this->ToolExtract2->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->packagesToolStripMenuItem, 
1220
				this->filesToolStripMenuItem});
1221
			this->ToolExtract2->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ToolExtract2.Image")));
1222
			this->ToolExtract2->ImageTransparentColor = System::Drawing::Color::Magenta;
1223
			this->ToolExtract2->Name = L"ToolExtract2";
1224
			this->ToolExtract2->Size = System::Drawing::Size(102, 51);
1225
			this->ToolExtract2->Text = L"Extract Selected";
1226
			this->ToolExtract2->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageAboveText;
1227
			// 
1228
			// packagesToolStripMenuItem
1229
			// 
1230
			this->packagesToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"packagesToolStripMenuItem.Image")));
1231
			this->packagesToolStripMenuItem->Name = L"packagesToolStripMenuItem";
1232
			this->packagesToolStripMenuItem->Size = System::Drawing::Size(123, 22);
1233
			this->packagesToolStripMenuItem->Text = L"Packages";
1234
			this->packagesToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::packagesToolStripMenuItem_Click);
1235
			// 
1236
			// filesToolStripMenuItem
1237
			// 
1238
			this->filesToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"filesToolStripMenuItem.Image")));
1239
			this->filesToolStripMenuItem->Name = L"filesToolStripMenuItem";
1240
			this->filesToolStripMenuItem->Size = System::Drawing::Size(123, 22);
1241
			this->filesToolStripMenuItem->Text = L"Files";
1242
			this->filesToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::filesToolStripMenuItem_Click);
1243
			// 
1244
			// ToolExtract
1245
			// 
1246
			this->ToolExtract->Enabled = false;
1247
			this->ToolExtract->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ToolExtract.Image")));
1248
			this->ToolExtract->ImageTransparentColor = System::Drawing::Color::Magenta;
1249
			this->ToolExtract->Name = L"ToolExtract";
1250
			this->ToolExtract->Size = System::Drawing::Size(93, 51);
1251
			this->ToolExtract->Text = L"Extract Selected";
1252
			this->ToolExtract->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageAboveText;
1253
			this->ToolExtract->Click += gcnew System::EventHandler(this, &Form1::ToolExtract_Click);
1254
			// 
1255
			// ToolExtractAll2
1256
			// 
1257
			this->ToolExtractAll2->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->toolStripMenuItem1, 
1258
				this->toolStripMenuItem2});
1259
			this->ToolExtractAll2->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ToolExtractAll2.Image")));
1260
			this->ToolExtractAll2->ImageTransparentColor = System::Drawing::Color::Magenta;
1261
			this->ToolExtractAll2->Name = L"ToolExtractAll2";
1262
			this->ToolExtractAll2->Size = System::Drawing::Size(72, 51);
1263
			this->ToolExtractAll2->Text = L"Extract All";
1264
			this->ToolExtractAll2->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageAboveText;
1265
			// 
1266
			// toolStripMenuItem1
1267
			// 
1268
			this->toolStripMenuItem1->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripMenuItem1.Image")));
1269
			this->toolStripMenuItem1->Name = L"toolStripMenuItem1";
1270
			this->toolStripMenuItem1->Size = System::Drawing::Size(123, 22);
1271
			this->toolStripMenuItem1->Text = L"Packages";
1272
			this->toolStripMenuItem1->Click += gcnew System::EventHandler(this, &Form1::toolStripMenuItem1_Click);
1273
			// 
1274
			// toolStripMenuItem2
1275
			// 
1276
			this->toolStripMenuItem2->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripMenuItem2.Image")));
1277
			this->toolStripMenuItem2->Name = L"toolStripMenuItem2";
1278
			this->toolStripMenuItem2->Size = System::Drawing::Size(123, 22);
1279
			this->toolStripMenuItem2->Text = L"Files";
1280
			this->toolStripMenuItem2->Click += gcnew System::EventHandler(this, &Form1::toolStripMenuItem2_Click);
1281
			// 
1282
			// toolStripButton1
1283
			// 
1284
			this->toolStripButton1->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"toolStripButton1.Image")));
1285
			this->toolStripButton1->ImageTransparentColor = System::Drawing::Color::Magenta;
1286
			this->toolStripButton1->Name = L"toolStripButton1";
1287
			this->toolStripButton1->Size = System::Drawing::Size(63, 51);
1288
			this->toolStripButton1->Text = L"Extract All";
1289
			this->toolStripButton1->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageAboveText;
1290
			this->toolStripButton1->Click += gcnew System::EventHandler(this, &Form1::toolStripButton1_Click);
1291
			// 
1292
			// toolStripSeparator4
1293
			// 
1294
			this->toolStripSeparator4->Name = L"toolStripSeparator4";
1295
			this->toolStripSeparator4->Size = System::Drawing::Size(6, 54);
1296
			// 
1297
			// ToolPaste
1298
			// 
1299
			this->ToolPaste->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ToolPaste.Image")));
1300
			this->ToolPaste->ImageTransparentColor = System::Drawing::Color::Magenta;
1301
			this->ToolPaste->Name = L"ToolPaste";
1302
			this->ToolPaste->Size = System::Drawing::Size(39, 51);
1303
			this->ToolPaste->Text = L"Paste";
1304
			this->ToolPaste->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageAboveText;
1305
			this->ToolPaste->Click += gcnew System::EventHandler(this, &Form1::ToolPaste_Click);
1306
			// 
1307
			// toolStripSeparator7
1308
			// 
1309
			this->toolStripSeparator7->Name = L"toolStripSeparator7";
1310
			this->toolStripSeparator7->Size = System::Drawing::Size(6, 54);
1311
			// 
1312
			// ToolInfo
1313
			// 
1314
			this->ToolInfo->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ToolInfo.Image")));
1315
			this->ToolInfo->ImageTransparentColor = System::Drawing::Color::Magenta;
1316
			this->ToolInfo->Name = L"ToolInfo";
1317
			this->ToolInfo->Size = System::Drawing::Size(79, 51);
1318
			this->ToolInfo->Text = L"Package Info";
1319
			this->ToolInfo->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageAboveText;
1320
			this->ToolInfo->Click += gcnew System::EventHandler(this, &Form1::ToolInfo_Click);
1321
			// 
1322
			// tabControl1
1323
			// 
1324
			this->tabControl1->Dock = System::Windows::Forms::DockStyle::Fill;
1325
			this->tabControl1->ImageList = this->imageList1;
1326
			this->tabControl1->Location = System::Drawing::Point(0, 0);
1327
			this->tabControl1->Name = L"tabControl1";
1328
			this->tabControl1->SelectedIndex = 0;
1329
			this->tabControl1->Size = System::Drawing::Size(725, 23);
1330
			this->tabControl1->TabIndex = 3;
1331
			this->tabControl1->SelectedIndexChanged += gcnew System::EventHandler(this, &Form1::tabControl1_SelectedIndexChanged);
1332
			// 
1333
			// imageList1
1334
			// 
1335
			this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imageList1.ImageStream")));
1336
			this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
1337
			this->imageList1->Images->SetKeyName(0, L"standard");
1338
			this->imageList1->Images->SetKeyName(1, L"multi");
1339
			// 
1340
			// panel1
1341
			// 
1342
			this->panel1->Controls->Add(this->tabControl1);
1343
			this->panel1->Controls->Add(this->button1);
1344
			this->panel1->Dock = System::Windows::Forms::DockStyle::Top;
1345
			this->panel1->Location = System::Drawing::Point(0, 78);
1346
			this->panel1->Name = L"panel1";
1347
			this->panel1->Size = System::Drawing::Size(746, 23);
1348
			this->panel1->TabIndex = 5;
1349
			// 
1350
			// button1
1351
			// 
1352
			this->button1->Dock = System::Windows::Forms::DockStyle::Right;
1353
			this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 8.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, 
1354
				static_cast<System::Byte>(0)));
1355
			this->button1->ForeColor = System::Drawing::Color::Red;
1356
			this->button1->Location = System::Drawing::Point(725, 0);
1357
			this->button1->Name = L"button1";
1358
			this->button1->Size = System::Drawing::Size(21, 23);
1359
			this->button1->TabIndex = 4;
1360
			this->button1->Text = L"X";
1361
			this->button1->UseVisualStyleBackColor = true;
1362
			this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
1363
			// 
1364
			// toolTip1
1365
			// 
1366
			this->toolTip1->ToolTipIcon = System::Windows::Forms::ToolTipIcon::Info;
1367
			this->toolTip1->ToolTipTitle = L"Close All";
1368
			// 
1369
			// timer1
1370
			// 
1371
			this->timer1->Enabled = true;
1372
			this->timer1->Interval = 500;
1373
			this->timer1->Tick += gcnew System::EventHandler(this, &Form1::timer1_Tick);
1374
			// 
1375
			// statusStrip1
1376
			// 
1377
			this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->StatusFiles});
1378
			this->statusStrip1->Location = System::Drawing::Point(0, 541);
1379
			this->statusStrip1->Name = L"statusStrip1";
1380
			this->statusStrip1->Size = System::Drawing::Size(746, 22);
1381
			this->statusStrip1->TabIndex = 7;
1382
			this->statusStrip1->Text = L"statusStrip1";
1383
			// 
1384
			// StatusFiles
1385
			// 
1386
			this->StatusFiles->Name = L"StatusFiles";
1387
			this->StatusFiles->Size = System::Drawing::Size(79, 17);
1388
			this->StatusFiles->Text = L"Files: 1 (10KB)";
1389
			// 
1390
			// contextMenuStrip1
1391
			// 
1392
			this->contextMenuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(2) {this->packageToolStripMenuItem, 
1393
				this->fileToolStripMenuItem1});
1394
			this->contextMenuStrip1->Name = L"contextMenuStrip1";
1395
			this->contextMenuStrip1->Size = System::Drawing::Size(119, 48);
1396
			// 
1397
			// packageToolStripMenuItem
1398
			// 
1399
			this->packageToolStripMenuItem->Name = L"packageToolStripMenuItem";
1400
			this->packageToolStripMenuItem->Size = System::Drawing::Size(118, 22);
1401
			this->packageToolStripMenuItem->Text = L"Package";
1402
			// 
1403
			// fileToolStripMenuItem1
1404
			// 
1405
			this->fileToolStripMenuItem1->Name = L"fileToolStripMenuItem1";
1406
			this->fileToolStripMenuItem1->Size = System::Drawing::Size(118, 22);
1407
			this->fileToolStripMenuItem1->Text = L"File";
1408
			// 
1409
			// Form1
1410
			// 
1411
			this->AllowDrop = true;
1412
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
1413
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
1414
			this->AutoValidate = System::Windows::Forms::AutoValidate::EnableAllowFocusChange;
1415
			this->BackColor = System::Drawing::SystemColors::Control;
1416
			this->ClientSize = System::Drawing::Size(746, 563);
1417
			this->Controls->Add(this->statusStrip1);
1418
			this->Controls->Add(this->panel1);
1419
			this->Controls->Add(this->toolStrip1);
1420
			this->Controls->Add(this->menuStrip1);
1421
			this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
1422
			this->IsMdiContainer = true;
1423
			this->MainMenuStrip = this->menuStrip1;
1424
			this->Name = L"Form1";
1425
			this->Text = L"SPK Explorer";
1426
			this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
1427
			this->DragDrop += gcnew System::Windows::Forms::DragEventHandler(this, &Form1::Form1_DragDrop);
1428
			this->DragOver += gcnew System::Windows::Forms::DragEventHandler(this, &Form1::Form1_DragOver);
1429
			this->menuStrip1->ResumeLayout(false);
1430
			this->menuStrip1->PerformLayout();
1431
			this->toolStrip1->ResumeLayout(false);
1432
			this->toolStrip1->PerformLayout();
1433
			this->panel1->ResumeLayout(false);
1434
			this->statusStrip1->ResumeLayout(false);
1435
			this->statusStrip1->PerformLayout();
1436
			this->contextMenuStrip1->ResumeLayout(false);
1437
			this->ResumeLayout(false);
1438
			this->PerformLayout();
1439
 
1440
		}
1441
#pragma endregion
1442
	private: System::Void tabControl1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
1443
			 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
1444
			 for ( int i = 0; i < children->Length; i++ )
1445
			 {
1446
				 SpkForm ^childForm = (SpkForm ^)children[i];
1447
				 if ( childForm->TabPage()->Equals(tabControl1->SelectedTab) )
1448
				 {
1449
					 childForm->Select();
1450
					 break;
1451
				 }
1452
			 }
1453
			 }
1454
private: System::Void Event_Open(System::Object^  sender, System::EventArgs^  e) {
1455
			System::Windows::Forms::ToolStripMenuItem ^item = cli::safe_cast<System::Windows::Forms::ToolStripMenuItem ^>(sender);
1456
			if ( item->Tag == "$DIR" )
1457
			{
1458
				FolderBrowserDialog ^fbd = gcnew FolderBrowserDialog;
1459
				fbd->Description = "Select the path to load all valid files from";
1460
				if ( fbd->ShowDialog(this) == System::Windows::Forms::DialogResult::OK )
1461
					this->OpenDirectory(fbd->SelectedPath);
1462
			}
1463
			else
1464
			{
1465
				this->Open(cli::safe_cast<System::String ^>(item->Tag), true, false);
1466
			}
1467
		}
1468
private: System::Void openToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1469
			 this->Open();
1470
		 }
1471
private: System::Void toolStripSplitButton1_ButtonClick(System::Object^  sender, System::EventArgs^  e) {
1472
			 this->Open();
1473
		 }
1474
private: System::Void exitToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1475
			 this->Close();
1476
		 }
1477
private: System::Void detailsToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1478
			this->ChangeView(System::Windows::Forms::View::Details);
1479
			this->detailsToolStripMenuItem->Checked = true;
1480
			this->detailsToolStripMenuItem->CheckState = System::Windows::Forms::CheckState::Indeterminate;
1481
		 }
1482
private: System::Void listToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1483
			this->ChangeView(System::Windows::Forms::View::List);
1484
			this->listToolStripMenuItem->Checked = true;
1485
			this->listToolStripMenuItem->CheckState = System::Windows::Forms::CheckState::Indeterminate;
1486
		 }
1487
private: System::Void largeIconToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1488
			this->ChangeView(System::Windows::Forms::View::LargeIcon);
1489
			this->largeIconToolStripMenuItem->Checked = true;
1490
			this->largeIconToolStripMenuItem->CheckState = System::Windows::Forms::CheckState::Indeterminate;
1491
		 }
1492
private: System::Void toolStripButton1_Click(System::Object^  sender, System::EventArgs^  e) {
1493
			 this->ExtractAll();
1494
		 }
1495
private: System::Void ToolExtract_Click(System::Object^  sender, System::EventArgs^  e) {
1496
			 this->ExtractSelected();
1497
		 }
1498
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
1499
			 if ( m_iLocX != -1 && m_iLocY != -1 )
1500
				this->Location = System::Drawing::Point(m_iLocX, m_iLocY);
1501
			this->UpdateDropDownOpen();
1502
		 }
1503
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
1504
			 this->CloseAll();
1505
		 }
1506
private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {
1507
			 if ( IO::File::Exists(IO::Path::GetTempPath() + "\\spkexplorer_load.dat") )
1508
				 this->LoadFiles(IO::Path::GetTempPath() + "\\spkexplorer_load.dat");
1509
		 }
1510
private: System::Void toolStripButton2_Click(System::Object^  sender, System::EventArgs^  e) {
1511
			 this->AddFile();
1512
		 }
1513
private: System::Void ToolRemove_Click(System::Object^  sender, System::EventArgs^  e) {
1514
			 this->RemoveSelected();
1515
		 }
1516
private: System::Void Form1_DragOver(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e) {
1517
			e->Effect = DragDropEffects::None;
1518
 
1519
			if (e->Data->GetDataPresent(DataFormats::FileDrop)) 
1520
			{
1521
				cli::array<String ^> ^a = (cli::array<String ^> ^)e->Data->GetData(DataFormats::FileDrop, false);
1522
				int i;
1523
				for(i = 0; i < a->Length; i++)
1524
				{
1525
					if ( String::Compare(IO::FileInfo(a[i]).Extension, ".xsp", true) == 0 || String::Compare(IO::FileInfo(a[i]).Extension, ".spk", true) == 0 )
1526
					{
1527
						e->Effect = DragDropEffects::Copy;
1528
						break;
1529
					}
1530
				}
1531
			}
1532
		}
1533
private: System::Void Form1_DragDrop(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e) {
1534
			if (e->Data->GetDataPresent(DataFormats::FileDrop)) 
1535
			{
1536
				cli::array<String ^> ^a = (cli::array<String ^> ^)e->Data->GetData(DataFormats::FileDrop, false);
1537
				this->OpenFiles(a, true, true);
1538
			}
1539
		 }
1540
private: System::Void ToolPaste_Click(System::Object^  sender, System::EventArgs^  e) {
1541
			SpkForm ^child = this->GetActiveChild();
1542
			if ( child )
1543
				child->PasteFiles(m_lCopiedFiles);
1544
		 }
1545
private: System::Void maximisedToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1546
			SpkForm ^child = this->GetActiveChild();
1547
			if ( child )
1548
				child->WindowState = FormWindowState::Maximized;
1549
		 }
1550
private: System::Void cascadeToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1551
			 this->LayoutMdi(MdiLayout::Cascade);
1552
		 }
1553
private: System::Void tileVerticallyToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1554
			 this->LayoutMdi(MdiLayout::TileVertical);
1555
		 }
1556
private: System::Void tileHorizontalToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1557
			 this->LayoutMdi(MdiLayout::TileHorizontal);
1558
		 }
1559
private: System::Void closeAllToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1560
			 this->CloseAll();
1561
		 }
1562
private: System::Void WindowSelectEvent(System::Object^  sender, System::EventArgs^  e) {
1563
			 ToolStripMenuItem ^menu = cli::safe_cast<ToolStripMenuItem ^>(sender);
1564
			 if ( menu )
1565
			 {
1566
				 cli::array<System::Windows::Forms::Form ^> ^children = this->MdiChildren;
1567
				 for ( int i = 0; i < children->Length; i++ )
1568
				 {
1569
					 SpkForm ^childForm = (SpkForm ^)children[i];
1570
					 if ( childForm->MenuItem() == menu )
1571
					 {
1572
						 childForm->Select();
1573
						 break;
1574
					 }
1575
				 }
1576
 
1577
			 }
1578
		 }
1579
private: System::Void ToolInfo_Click(System::Object^  sender, System::EventArgs^  e) {
1580
			SpkForm ^child = this->GetActiveChild();
1581
			if ( child )
1582
			{
1583
				PackageInfo ^info = gcnew PackageInfo(child->GetPackage(), 44);
1584
				info->ShowDialog(this);
1585
			}
1586
		 }
1587
private: System::Void filesToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1588
			 this->ExtractSelected();
1589
		 }
1590
private: System::Void packagesToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
1591
			 this->ExtractSelectedPackage();
1592
		 }
1593
private: System::Void toolStripMenuItem1_Click(System::Object^  sender, System::EventArgs^  e) {
1594
			 this->ExtractAllPackage();
1595
		 }
1596
private: System::Void toolStripMenuItem2_Click(System::Object^  sender, System::EventArgs^  e) {
1597
			 this->ExtractAll();
1598
		 }
1599
private: System::Void toolStripMenuItem4_Click(System::Object^  sender, System::EventArgs^  e) {
1600
			 this->AddFile();
1601
		 }
1602
private: System::Void toolStripMenuItem3_Click(System::Object^  sender, System::EventArgs^  e) {
1603
			 this->AddPackage();
1604
		 }
1605
private: System::Void toolStripMenuItem6_Click(System::Object^  sender, System::EventArgs^  e) {
1606
			 this->RemoveSelected();
1607
		 }
1608
private: System::Void toolStripMenuItem5_Click(System::Object^  sender, System::EventArgs^  e) {
1609
			 this->RemoveSelectedPackage();
1610
		 }
1611
};
1612
}
1613