Subversion Repositories spk

Rev

Rev 1 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 cycrow 1
#pragma once
2
 
3
using namespace System;
4
using namespace System::ComponentModel;
5
using namespace System::Collections;
6
using namespace System::Windows::Forms;
7
using namespace System::Data;
8
using namespace System::Drawing;
9
 
10
#include "../../common/listviewsorter.h"
11
 
12
namespace SpkExplorer {
13
 
14
	/// <summary>
15
	/// Summary for SpkForm
16
	///
17
	/// WARNING: If you change the name of this class, you will need to change the
18
	///          'Resource File Name' property for the managed resource compiler tool
19
	///          associated with all .resx files this class depends on.  Otherwise,
20
	///          the designers will not be able to interact properly with localized
21
	///          resources associated with this form.
22
	/// </summary>
23
	public ref class SpkForm : public System::Windows::Forms::Form
24
	{
25
	public:
26
		SpkForm(System::Windows::Forms::Form ^parent, System::Windows::Forms::TabControl ^ctrl, System::Windows::Forms::TabPage ^page)
27
		{
28
			InitializeComponent();
29
			this->AllowDrop = true;
30
 
31
			ImageList ^list1 = gcnew ImageList();
32
			ImageList ^list2 = gcnew ImageList();
33
			list1->ImageSize.Height = 32;
34
			list1->ImageSize.Width = 32;
35
			list2->ImageSize.Height = 16;
36
			list2->ImageSize.Width = 16;
37
 
38
			this->AddImage("$IMAGELIST:script.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_SCRIPT)));
39
			this->AddImage("$IMAGELIST:textfile.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_TEXT)));
40
			this->AddImage("$IMAGELIST:readme.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_README)));
41
			this->AddImage("$IMAGELIST:map.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_MAP)));
42
			this->AddImage("$IMAGELIST:mods.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_MOD)));
43
			this->AddImage("$IMAGELIST:uninstall.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_UNINSTALL)));
44
			this->AddImage("$IMAGELIST:sound.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_SOUND)));
45
			this->AddImage("$IMAGELIST:extras.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_EXTRA)));
46
			this->AddImage("$IMAGELIST:screenshot.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_SCREEN)));
47
			this->AddImage("$IMAGELIST:backup.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_BACKUP)));
48
			this->AddImage("$IMAGELIST:mission.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_MISSION)));
49
			this->AddImage("$IMAGELIST:advert.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_ADVERT)));
50
			this->AddImage("$IMAGELIST:shipother.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_SHIPOTHER)));
51
			this->AddImage("$IMAGELIST:shipmodel.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_SHIPMODEL)));
52
			this->AddImage("$IMAGELIST:shipscene.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_SHIPSCENE)));
53
			this->AddImage("$IMAGELIST:cockpitscene.png", list1, SystemStringFromCyString(CyString::Number(FILETYPE_COCKPITSCENE)));
54
 
55
			this->AddImage("$IMAGELIST:script.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_SCRIPT)));
56
			this->AddImage("$IMAGELIST:textfile.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_TEXT)));
57
			this->AddImage("$IMAGELIST:readme.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_README)));
58
			this->AddImage("$IMAGELIST:map.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_MAP)));
59
			this->AddImage("$IMAGELIST:mods.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_MOD)));
60
			this->AddImage("$IMAGELIST:uninstall.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_UNINSTALL)));
61
			this->AddImage("$IMAGELIST:sound.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_SOUND)));
62
			this->AddImage("$IMAGELIST:extras.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_EXTRA)));
63
			this->AddImage("$IMAGELIST:screenshot.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_SCREEN)));
64
			this->AddImage("$IMAGELIST:backup.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_BACKUP)));
65
			this->AddImage("$IMAGELIST:mission.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_MISSION)));
66
			this->AddImage("$IMAGELIST:advert.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_ADVERT)));
67
			this->AddImage("$IMAGELIST:shipother.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_SHIPOTHER)));
68
			this->AddImage("$IMAGELIST:shipmodel.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_SHIPMODEL)));
69
			this->AddImage("$IMAGELIST:shipscene.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_SHIPSCENE)));
70
			this->AddImage("$IMAGELIST:cockpitscene.png", list2, SystemStringFromCyString(CyString::Number(FILETYPE_COCKPITSCENE)));
71
 
72
			listView1->LargeImageList = list1;
73
			listView1->SmallImageList = list2;
74
 
75
			m_bLoading = false;
76
			this->MdiParent = parent;
77
			m_pTabCtrl = ctrl;
78
			m_pTabPage = page;
79
 
80
			m_bSortingAsc = true;
81
			m_iSortingCol = 1;
82
			m_bSortingAsc2 = true;
83
			m_iSortingCol2 = 1;
84
			m_pListItem = nullptr;
85
 
86
			this->Closing += gcnew CancelEventHandler(this, &SpkForm::Event_Closing);
87
			this->Activated += gcnew System::EventHandler(this, &SpkForm::Event_Activated);
88
			this->listView1->ColumnClick += gcnew ColumnClickEventHandler(this, &SpkForm::SortList);
89
			this->contextMenuStrip1->Opening += gcnew CancelEventHandler(this, &SpkExplorer::SpkForm::OpenContextMenu);
90
			this->listView1->DragOver += gcnew DragEventHandler(this, &SpkExplorer::SpkForm::DragEnterEvent);
91
			this->listView1->ItemDrag += gcnew ItemDragEventHandler(this, &SpkExplorer::SpkForm::ItemDragEvent);
92
 
93
			m_pSelectedPackage = NULL;
94
			m_pPackage = NULL;
95
			m_pMultiPackage = NULL;
96
		}
97
 
98
		bool ReadSelectedMultiPackage();
99
		bool ReadMultiPackage();
100
		bool IsMultiPackage() { return (m_pMultiPackage) ? true : false; }
101
		void SetToolButton(ToolStripMenuItem ^menu)
102
		{
103
			m_pMenuItem = menu;
104
		} 
105
		bool IsSelected();
106
		bool IsPackageSelected();
107
 
108
		void	UpdateView(bool onlyPackage);
109
 
110
		System::Windows::Forms::TabControl ^TabControl() { return m_pTabCtrl; }
111
		System::Windows::Forms::TabPage ^TabPage() { return m_pTabPage; }
112
		ToolStripMenuItem ^MenuItem() { return m_pMenuItem; }
113
 
114
		bool CheckFilename(System::String ^filename);
115
		void SetMultiPackage(CMultiSpkFile *p, System::String ^filename);
116
		void SetPackage(CBaseFile *p, System::String ^filename);
117
		void AddFile(C_File *file);
118
		void AddMultiFile(SMultiSpkFile *file);
119
		System::String ^GetExtractDir(bool package);
120
 
121
		CBaseFile *GetPackage() { return m_pPackage; }
122
		CMultiSpkFile *GetMultiPackage() { return m_pMultiPackage; }
123
 
124
		void ChangeView(System::Windows::Forms::View view)
125
		{
126
			this->listView1->View = view;
127
		}
128
 
129
		void	DroppedFile(C_File *file);
130
		void	DraggedFile(C_File *file);
131
 
132
		void WritePackage();
133
		bool ReadPackageFiles(bool all);
134
 
135
		void PasteFiles(CLinkList<C_File> *list);
136
		void RestoreCut(CLinkList<C_File> *file);
137
		void RemoveItem(ListViewItem ^item);
138
		void RemoveSelected();
139
		void RemoveSelectedPackage();
140
		void ExtractSelected(System::String ^toDir);
141
		void ExtractSelectedPackage(System::String ^toDir);
142
		void ExtractAll(System::String ^toDir);
143
		void ExtractAllPackage(System::String ^toDir);
144
	private: System::Windows::Forms::ContextMenuStrip^  contextMenuStrip1;
145
	private: System::Windows::Forms::ToolStripMenuItem^  extractToolStripMenuItem;
146
	private: System::Windows::Forms::ToolStripMenuItem^  ContextName;
147
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator1;
148
private: System::Windows::Forms::ImageList^  imageList1;
149
 
150
 
151
	private: System::Windows::Forms::ToolStripMenuItem^  deleteToolStripMenuItem;
152
	private: System::Windows::Forms::ToolStripSeparator^  toolStripSeparator2;
153
	private: System::Windows::Forms::ToolStripMenuItem^  ToolCopy;
154
	private: System::Windows::Forms::ToolStripMenuItem^  ToolPaste;
155
	private: System::Windows::Forms::ToolStripMenuItem^  ToolCut;
156
private: System::Windows::Forms::SplitContainer^  splitContainer1;
157
private: System::Windows::Forms::ListView^  listView2;
158
private: System::Windows::Forms::ColumnHeader^  columnHeader5;
159
private: System::Windows::Forms::ColumnHeader^  columnHeader6;
160
private: System::Windows::Forms::ColumnHeader^  columnHeader7;
161
private: System::Windows::Forms::ColumnHeader^  columnHeader8;
162
 
163
 
164
	public: 
165
 
166
 
167
	protected:
168
		System::String ^m_sFilename;
169
 
170
		/// <summary>
171
		/// Clean up any resources being used.
172
		/// </summary>
173
		~SpkForm()
174
		{
175
			delete m_pMenuItem;
176
			if (components)
177
			{
178
				delete components;
179
			}
180
		}
181
	private: System::Windows::Forms::ColumnHeader^  columnHeader1;
182
	protected: 
183
	private: System::Windows::Forms::ColumnHeader^  columnHeader2;
184
	private: System::Windows::Forms::ColumnHeader^  columnHeader3;
185
	private: System::Windows::Forms::ColumnHeader^  columnHeader4;
186
	private: System::Windows::Forms::ListView^  listView1;
187
	protected: 
188
 
189
	private:
190
		void	AddImage(System::String ^filename, ImageList ^list, System::String ^key);
191
		void	SelectedCheck();
192
		void	DoExtract(CLinkList<C_File> *list, System::String ^toDir, int game);
193
		void	DoPackageExtract(CLinkList<SMultiSpkFile> *list, System::String ^toDir);
194
		void	CopyFile();
195
		void	CutFile();
196
		void	PasteFile();
197
		void	DropGetDirectories(String ^dir, CyStringList *list, bool packages);
198
		void	RunFile(ListViewItem ^item);
199
 
200
		ListViewItem ^FindSelectedItem();
201
		C_File *GetFileFromItem(ListViewItem ^item);
202
 
203
		System::Void OpenContextMenu(System::Object ^Sender, CancelEventArgs ^E);
204
		System::Void DragEnterEvent(System::Object ^Sender, DragEventArgs ^E);
205
		System::Void ItemDragEvent(System::Object ^Sender, ItemDragEventArgs ^E);
206
 
207
		bool								 m_bSortingAsc;
208
		int									 m_iSortingCol;
209
		bool								 m_bSortingAsc2;
210
		int									 m_iSortingCol2;
211
		bool								 m_bLoading;
212
		SMultiSpkFile						*m_pSelectedPackage;
213
		CBaseFile							*m_pPackage;
214
		CMultiSpkFile						*m_pMultiPackage;
215
		System::Windows::Forms::TabControl	^m_pTabCtrl;
216
		System::Windows::Forms::TabPage		^m_pTabPage;
217
		ListViewItem						^m_pListItem;
218
		ToolStripMenuItem					^m_pMenuItem;
219
	private: System::ComponentModel::IContainer^  components;
220
 
221
		/// <summary>
222
		/// Required designer variable.
223
		/// </summary>
224
 
225
 
226
#pragma region Windows Form Designer generated code
227
		/// <summary>
228
		/// Required method for Designer support - do not modify
229
		/// the contents of this method with the code editor.
230
		/// </summary>
231
		void InitializeComponent(void)
232
		{
233
			this->components = (gcnew System::ComponentModel::Container());
234
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(SpkForm::typeid));
235
			this->listView1 = (gcnew System::Windows::Forms::ListView());
236
			this->columnHeader1 = (gcnew System::Windows::Forms::ColumnHeader());
237
			this->columnHeader2 = (gcnew System::Windows::Forms::ColumnHeader());
238
			this->columnHeader3 = (gcnew System::Windows::Forms::ColumnHeader());
239
			this->columnHeader4 = (gcnew System::Windows::Forms::ColumnHeader());
240
			this->contextMenuStrip1 = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
241
			this->ContextName = (gcnew System::Windows::Forms::ToolStripMenuItem());
242
			this->toolStripSeparator1 = (gcnew System::Windows::Forms::ToolStripSeparator());
243
			this->extractToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
244
			this->deleteToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
245
			this->toolStripSeparator2 = (gcnew System::Windows::Forms::ToolStripSeparator());
246
			this->ToolCut = (gcnew System::Windows::Forms::ToolStripMenuItem());
247
			this->ToolCopy = (gcnew System::Windows::Forms::ToolStripMenuItem());
248
			this->ToolPaste = (gcnew System::Windows::Forms::ToolStripMenuItem());
249
			this->imageList1 = (gcnew System::Windows::Forms::ImageList(this->components));
250
			this->splitContainer1 = (gcnew System::Windows::Forms::SplitContainer());
251
			this->listView2 = (gcnew System::Windows::Forms::ListView());
252
			this->columnHeader5 = (gcnew System::Windows::Forms::ColumnHeader());
253
			this->columnHeader6 = (gcnew System::Windows::Forms::ColumnHeader());
254
			this->columnHeader7 = (gcnew System::Windows::Forms::ColumnHeader());
255
			this->columnHeader8 = (gcnew System::Windows::Forms::ColumnHeader());
256
			this->contextMenuStrip1->SuspendLayout();
257
			this->splitContainer1->Panel1->SuspendLayout();
258
			this->splitContainer1->Panel2->SuspendLayout();
259
			this->splitContainer1->SuspendLayout();
260
			this->SuspendLayout();
261
			// 
262
			// listView1
263
			// 
264
			this->listView1->AllowDrop = true;
265
			this->listView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(5) {this->columnHeader1, this->columnHeader2, 
266
				this->columnHeader3, this->columnHeader4, this->columnHeader8});
267
			this->listView1->ContextMenuStrip = this->contextMenuStrip1;
268
			this->listView1->Dock = System::Windows::Forms::DockStyle::Fill;
269
			this->listView1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, 
270
				static_cast<System::Byte>(0)));
271
			this->listView1->FullRowSelect = true;
272
			this->listView1->Location = System::Drawing::Point(0, 0);
273
			this->listView1->Margin = System::Windows::Forms::Padding(20);
274
			this->listView1->Name = L"listView1";
275
			this->listView1->Size = System::Drawing::Size(458, 192);
276
			this->listView1->TabIndex = 0;
277
			this->listView1->TileSize = System::Drawing::Size(64, 64);
278
			this->listView1->UseCompatibleStateImageBehavior = false;
279
			this->listView1->View = System::Windows::Forms::View::Details;
280
			this->listView1->VirtualListSize = 10;
281
			this->listView1->MouseDoubleClick += gcnew System::Windows::Forms::MouseEventHandler(this, &SpkForm::listView1_MouseDoubleClick);
282
			this->listView1->SelectedIndexChanged += gcnew System::EventHandler(this, &SpkForm::listView1_SelectedIndexChanged);
283
			this->listView1->DragDrop += gcnew System::Windows::Forms::DragEventHandler(this, &SpkForm::listView1_DragDrop);
284
			// 
285
			// columnHeader1
286
			// 
287
			this->columnHeader1->Text = L"File";
288
			// 
289
			// columnHeader2
290
			// 
291
			this->columnHeader2->Text = L"Size";
292
			// 
293
			// columnHeader3
294
			// 
295
			this->columnHeader3->Text = L"Type";
296
			// 
297
			// columnHeader4
298
			// 
299
			this->columnHeader4->Text = L"Last Modified";
300
			// 
301
			// contextMenuStrip1
302
			// 
303
			this->contextMenuStrip1->ImageScalingSize = System::Drawing::Size(24, 24);
304
			this->contextMenuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(8) {this->ContextName, 
305
				this->toolStripSeparator1, this->extractToolStripMenuItem, this->deleteToolStripMenuItem, this->toolStripSeparator2, this->ToolCut, 
306
				this->ToolCopy, this->ToolPaste});
307
			this->contextMenuStrip1->Name = L"contextMenuStrip1";
308
			this->contextMenuStrip1->Size = System::Drawing::Size(118, 196);
309
			// 
310
			// ContextName
311
			// 
312
			this->ContextName->Name = L"ContextName";
313
			this->ContextName->Size = System::Drawing::Size(117, 30);
314
			this->ContextName->Text = L"Name";
315
			this->ContextName->Click += gcnew System::EventHandler(this, &SpkForm::ContextName_Click);
316
			// 
317
			// toolStripSeparator1
318
			// 
319
			this->toolStripSeparator1->Name = L"toolStripSeparator1";
320
			this->toolStripSeparator1->Size = System::Drawing::Size(114, 6);
321
			// 
322
			// extractToolStripMenuItem
323
			// 
324
			this->extractToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"extractToolStripMenuItem.Image")));
325
			this->extractToolStripMenuItem->Name = L"extractToolStripMenuItem";
326
			this->extractToolStripMenuItem->Size = System::Drawing::Size(117, 30);
327
			this->extractToolStripMenuItem->Text = L"Extract";
328
			this->extractToolStripMenuItem->Click += gcnew System::EventHandler(this, &SpkForm::extractToolStripMenuItem_Click);
329
			// 
330
			// deleteToolStripMenuItem
331
			// 
332
			this->deleteToolStripMenuItem->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"deleteToolStripMenuItem.Image")));
333
			this->deleteToolStripMenuItem->Name = L"deleteToolStripMenuItem";
334
			this->deleteToolStripMenuItem->Size = System::Drawing::Size(117, 30);
335
			this->deleteToolStripMenuItem->Text = L"Delete";
336
			this->deleteToolStripMenuItem->Click += gcnew System::EventHandler(this, &SpkForm::deleteToolStripMenuItem_Click);
337
			// 
338
			// toolStripSeparator2
339
			// 
340
			this->toolStripSeparator2->Name = L"toolStripSeparator2";
341
			this->toolStripSeparator2->Size = System::Drawing::Size(114, 6);
342
			// 
343
			// ToolCut
344
			// 
345
			this->ToolCut->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ToolCut.Image")));
346
			this->ToolCut->Name = L"ToolCut";
347
			this->ToolCut->Size = System::Drawing::Size(117, 30);
348
			this->ToolCut->Text = L"Cut";
349
			this->ToolCut->Click += gcnew System::EventHandler(this, &SpkForm::ToolCut_Click);
350
			// 
351
			// ToolCopy
352
			// 
353
			this->ToolCopy->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ToolCopy.Image")));
354
			this->ToolCopy->Name = L"ToolCopy";
355
			this->ToolCopy->Size = System::Drawing::Size(117, 30);
356
			this->ToolCopy->Text = L"Copy";
357
			this->ToolCopy->Click += gcnew System::EventHandler(this, &SpkForm::ToolCopy_Click);
358
			// 
359
			// ToolPaste
360
			// 
361
			this->ToolPaste->Enabled = false;
362
			this->ToolPaste->Image = (cli::safe_cast<System::Drawing::Image^  >(resources->GetObject(L"ToolPaste.Image")));
363
			this->ToolPaste->Name = L"ToolPaste";
364
			this->ToolPaste->Size = System::Drawing::Size(117, 30);
365
			this->ToolPaste->Text = L"Paste";
366
			this->ToolPaste->Click += gcnew System::EventHandler(this, &SpkForm::ToolPaste_Click);
367
			// 
368
			// imageList1
369
			// 
370
			this->imageList1->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^  >(resources->GetObject(L"imageList1.ImageStream")));
371
			this->imageList1->TransparentColor = System::Drawing::Color::Transparent;
372
			this->imageList1->Images->SetKeyName(0, L"advert.png");
373
			this->imageList1->Images->SetKeyName(1, L"backup.png");
374
			this->imageList1->Images->SetKeyName(2, L"cockpitscene.png");
375
			this->imageList1->Images->SetKeyName(3, L"extras.png");
376
			this->imageList1->Images->SetKeyName(4, L"map.png");
377
			this->imageList1->Images->SetKeyName(5, L"mission.png");
378
			this->imageList1->Images->SetKeyName(6, L"mods.png");
379
			this->imageList1->Images->SetKeyName(7, L"readme.png");
380
			this->imageList1->Images->SetKeyName(8, L"screenshot.png");
381
			this->imageList1->Images->SetKeyName(9, L"script.png");
382
			this->imageList1->Images->SetKeyName(10, L"shipmodel.png");
383
			this->imageList1->Images->SetKeyName(11, L"shipother.png");
384
			this->imageList1->Images->SetKeyName(12, L"shipscene.png");
385
			this->imageList1->Images->SetKeyName(13, L"sound.png");
386
			this->imageList1->Images->SetKeyName(14, L"textfile.png");
387
			this->imageList1->Images->SetKeyName(15, L"uninstall.png");
388
			this->imageList1->Images->SetKeyName(16, L"package");
389
			// 
390
			// splitContainer1
391
			// 
392
			this->splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
393
			this->splitContainer1->Location = System::Drawing::Point(0, 0);
394
			this->splitContainer1->Name = L"splitContainer1";
395
			this->splitContainer1->Orientation = System::Windows::Forms::Orientation::Horizontal;
396
			// 
397
			// splitContainer1.Panel1
398
			// 
399
			this->splitContainer1->Panel1->Controls->Add(this->listView2);
400
			// 
401
			// splitContainer1.Panel2
402
			// 
403
			this->splitContainer1->Panel2->Controls->Add(this->listView1);
404
			this->splitContainer1->Size = System::Drawing::Size(458, 391);
405
			this->splitContainer1->SplitterDistance = 195;
406
			this->splitContainer1->TabIndex = 1;
407
			// 
408
			// listView2
409
			// 
410
			this->listView2->AllowDrop = true;
411
			this->listView2->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(3) {this->columnHeader5, this->columnHeader6, 
412
				this->columnHeader7});
413
			this->listView2->ContextMenuStrip = this->contextMenuStrip1;
414
			this->listView2->Dock = System::Windows::Forms::DockStyle::Fill;
415
			this->listView2->FullRowSelect = true;
416
			this->listView2->HideSelection = false;
417
			this->listView2->LargeImageList = this->imageList1;
418
			this->listView2->Location = System::Drawing::Point(0, 0);
419
			this->listView2->Name = L"listView2";
420
			this->listView2->Size = System::Drawing::Size(458, 195);
421
			this->listView2->SmallImageList = this->imageList1;
422
			this->listView2->TabIndex = 0;
423
			this->listView2->UseCompatibleStateImageBehavior = false;
424
			this->listView2->View = System::Windows::Forms::View::Details;
425
			this->listView2->SelectedIndexChanged += gcnew System::EventHandler(this, &SpkForm::listView2_SelectedIndexChanged);
426
			this->listView2->DragDrop += gcnew System::Windows::Forms::DragEventHandler(this, &SpkForm::listView2_DragDrop);
427
			this->listView2->ColumnClick += gcnew System::Windows::Forms::ColumnClickEventHandler(this, &SpkForm::listView2_ColumnClick);
428
			this->listView2->DragOver += gcnew System::Windows::Forms::DragEventHandler(this, &SpkForm::listView2_DragOver);
429
			// 
430
			// columnHeader5
431
			// 
432
			this->columnHeader5->Text = L"Filename";
433
			// 
434
			// columnHeader6
435
			// 
436
			this->columnHeader6->Text = L"File Type";
437
			// 
438
			// columnHeader7
439
			// 
440
			this->columnHeader7->Text = L"Size";
441
			// 
442
			// columnHeader8
443
			// 
444
			this->columnHeader8->Text = L"Game";
445
			// 
446
			// SpkForm
447
			// 
448
			this->AllowDrop = true;
449
			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
450
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
451
			this->AutoValidate = System::Windows::Forms::AutoValidate::EnableAllowFocusChange;
452
			this->ClientSize = System::Drawing::Size(458, 391);
453
			this->Controls->Add(this->splitContainer1);
454
			this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
455
			this->Icon = (cli::safe_cast<System::Drawing::Icon^  >(resources->GetObject(L"$this.Icon")));
456
			this->Name = L"SpkForm";
457
			this->ShowIcon = false;
458
			this->ShowInTaskbar = false;
459
			this->SizeGripStyle = System::Windows::Forms::SizeGripStyle::Hide;
460
			this->Text = L"SpkForm";
461
			this->contextMenuStrip1->ResumeLayout(false);
462
			this->splitContainer1->Panel1->ResumeLayout(false);
463
			this->splitContainer1->Panel2->ResumeLayout(false);
464
			this->splitContainer1->ResumeLayout(false);
465
			this->ResumeLayout(false);
466
 
467
		}
468
#pragma endregion
469
	private: System::Void Event_Activated(System::Object^  sender, System::EventArgs^  e);
470
	private: System::Void Event_Closing(System::Object^  sender, CancelEventArgs^  e);
471
private: System::Void SortList(System::Object ^Sender, ColumnClickEventArgs ^E)
472
	{
473
		if ( E->Column == m_iSortingCol )
474
		{
475
			m_bSortingAsc = !m_bSortingAsc;
476
			this->listView1->ListViewItemSorter = gcnew ListViewItemComparer(E->Column, !m_bSortingAsc);
477
		}
478
		else
479
		{
480
			m_bSortingAsc = true;
481
			this->listView1->ListViewItemSorter = gcnew ListViewItemComparer(E->Column, !m_bSortingAsc);
482
		}
483
		this->listView1->Sort();
484
		m_iSortingCol = E->Column;
485
	}
486
private: System::Void listView1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
487
			this->SelectedCheck();
488
		 }
489
private: System::Void extractToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
490
			if ( !m_pListItem )
491
				return;
492
 
493
			C_File *f =  this->GetFileFromItem(m_pListItem);
494
			if ( f )
495
			{
496
				CLinkList<C_File> list;
497
				list.push_back(f);
498
				this->DoExtract(&list, this->GetExtractDir(false), -1);
499
				list.clear();
500
			}
501
		 }
502
private: System::Void ToolCopy_Click(System::Object^  sender, System::EventArgs^  e) {
503
			 this->CopyFile();
504
		 }
505
private: System::Void ToolPaste_Click(System::Object^  sender, System::EventArgs^  e) {
506
			 this->PasteFile();
507
		 }
508
private: System::Void ToolCut_Click(System::Object^  sender, System::EventArgs^  e) {
509
			 this->CutFile();
510
		 }
511
private: System::Void listView1_DragDrop(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e);
512
private: System::Void ContextName_Click(System::Object^  sender, System::EventArgs^  e) {
513
			 this->RunFile(m_pListItem);
514
		 }
515
private: System::Void listView1_MouseDoubleClick(System::Object^  sender, System::Windows::Forms::MouseEventArgs^  e) {
516
			Point ^mousePoint = this->listView1->PointToClient(this->listView1->MousePosition);
517
			this->RunFile(this->listView1->GetItemAt(mousePoint->X, mousePoint->Y));
518
		 }
519
private: System::Void listView2_ColumnClick(System::Object^  sender, System::Windows::Forms::ColumnClickEventArgs^  E) {
520
			if ( E->Column == m_iSortingCol2 )
521
			{
522
				m_bSortingAsc2 = !m_bSortingAsc2;
523
				this->listView2->ListViewItemSorter = gcnew ListViewItemComparer(E->Column, !m_bSortingAsc2);
524
			}
525
			else
526
			{
527
				m_bSortingAsc2 = true;
528
				this->listView2->ListViewItemSorter = gcnew ListViewItemComparer(E->Column, !m_bSortingAsc2);
529
			}
530
			this->listView2->Sort();
531
			m_iSortingCol2 = E->Column;
532
		 }
533
private: System::Void listView2_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e) {
534
			this->SelectedCheck();
535
		 }
536
private: System::Void listView2_DragOver(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e) {
537
			e->Effect = DragDropEffects::None;
538
			if ( e->Data->GetDataPresent(DataFormats::FileDrop) )
539
			{
540
				cli::array<String ^> ^a = (cli::array<String ^> ^)e->Data->GetData(DataFormats::FileDrop, false);
541
				int i;
542
				for(i = 0; i < a->Length; i++)
543
				{
544
					if ( String::Compare(IO::FileInfo(a[i]).Extension, ".xsp", true) == 0 || String::Compare(IO::FileInfo(a[i]).Extension, ".spk", true) == 0 )
545
					{
546
						e->Effect = DragDropEffects::Copy;
547
						break;
548
					}
549
				}
550
			}
551
		 }
552
private: System::Void listView2_DragDrop(System::Object^  sender, System::Windows::Forms::DragEventArgs^  e);
553
private: System::Void deleteToolStripMenuItem_Click(System::Object^  sender, System::EventArgs^  e) {
554
			if ( !m_pListItem )
555
				return;
556
 
557
			this->RemoveItem(m_pListItem);
558
		 }
559
};
560
}