Subversion Repositories spk

Rev

Rev 122 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
121 cycrow 1
#pragma once
2
 
3
#include <spk.h>
4
 
5
namespace PluginManager {
6
 
7
	using namespace System;
8
	using namespace System::ComponentModel;
9
	using namespace System::Collections;
10
	using namespace System::Windows::Forms;
11
	using namespace System::Data;
12
	using namespace System::Drawing;
13
 
14
	/// <summary>
15
	/// Summary for DirectoryControl
16
	/// </summary>
17
	public ref class DirectoryControl : public System::Windows::Forms::Form
18
	{
19
	public:
20
		DirectoryControl(CPackages *packages, Utils::CStringList *currentDirs, Utils::CStringList *removedDirs);
21
 
22
		void AddFoundDir(const Utils::String &dir);
23
		void FindAllAddons(const Utils::String &exe, bool checkBase);
24
		void getAllDirs(Utils::CStringList *currentDirs, Utils::CStringList *removedDirs);
25
		void UpdateGameDirs();
26
		void UpdateFoundDirs();
27
 
28
		Utils::CStringList *directories();
29
		Utils::CStringList *removeDirectories();
30
 
31
	protected:
32
		/// <summary>
33
		/// Clean up any resources being used.
34
		/// </summary>
35
		~DirectoryControl();
36
 
37
	protected:
38
	private: System::Windows::Forms::GroupBox^  groupBox1;
39
	private: System::Windows::Forms::Panel^  panel1;
40
	private: System::Windows::Forms::Button^  button1;
41
	private: System::Windows::Forms::Button^  removeButton;
42
	private: System::Windows::Forms::ImageList^  imageListGames;
43
	private: System::ComponentModel::IContainer^  components;
44
 
45
	private:
46
		/// <summary>
47
		/// Required designer variable.
48
		/// </summary>
49
		Utils::CStringList *_lDirs;
50
		Utils::CStringList *_lRemoveDirs;
51
		Utils::CStringList *_lFoundDirs;
52
		CPackages *_packages;
53
 
54
	private: System::Windows::Forms::GroupBox^  groupBox2;
55
	private: System::Windows::Forms::Panel^  panel2;
56
	private: System::Windows::Forms::ListView^  listView2;
57
	private: System::Windows::Forms::SplitContainer^  splitContainer1;
58
	private: System::Windows::Forms::Panel^  panel3;
59
	private: System::Windows::Forms::Button^  buttonAccept;
60
 
61
	private: System::Windows::Forms::Button^  ButtonAddFound;
62
 
63
	private: System::Windows::Forms::ColumnHeader^  ColumnDir2;
64
	private: System::Windows::Forms::ColumnHeader^  ColumnGame2;
65
	private: System::Windows::Forms::ColumnHeader^  ColumnLang2;
66
	private: System::Windows::Forms::ColumnHeader^  ColumnID2;
67
	private: System::Windows::Forms::ListView^  listView1;
68
	private: System::Windows::Forms::ColumnHeader^  ColumnDirectory;
69
	private: System::Windows::Forms::ColumnHeader^  ColumnGame;
70
	private: System::Windows::Forms::ColumnHeader^  ColumnStatus;
71
	private: System::Windows::Forms::ColumnHeader^  ColumnLang;
72
	private: System::Windows::Forms::ColumnHeader^  ColumnID;
73
	private: System::Windows::Forms::ColumnHeader^  columnAddon2;
74
	private: System::Windows::Forms::ColumnHeader^  columnAddon;
75
	private: System::Windows::Forms::Button^  buttonCancel;
76
 
77
#pragma region Windows Form Designer generated code
78
		/// <summary>
79
		/// Required method for Designer support - do not modify
80
		/// the contents of this method with the code editor.
81
		/// </summary>
82
		void InitializeComponent(void)
83
		{
84
			this->components = (gcnew System::ComponentModel::Container());
85
			System::ComponentModel::ComponentResourceManager^  resources = (gcnew System::ComponentModel::ComponentResourceManager(DirectoryControl::typeid));
86
			this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
87
			this->listView1 = (gcnew System::Windows::Forms::ListView());
88
			this->ColumnDirectory = (gcnew System::Windows::Forms::ColumnHeader());
89
			this->ColumnGame = (gcnew System::Windows::Forms::ColumnHeader());
90
			this->ColumnStatus = (gcnew System::Windows::Forms::ColumnHeader());
91
			this->ColumnLang = (gcnew System::Windows::Forms::ColumnHeader());
92
			this->columnAddon = (gcnew System::Windows::Forms::ColumnHeader());
93
			this->ColumnID = (gcnew System::Windows::Forms::ColumnHeader());
94
			this->panel1 = (gcnew System::Windows::Forms::Panel());
95
			this->removeButton = (gcnew System::Windows::Forms::Button());
96
			this->button1 = (gcnew System::Windows::Forms::Button());
97
			this->imageListGames = (gcnew System::Windows::Forms::ImageList(this->components));
98
			this->groupBox2 = (gcnew System::Windows::Forms::GroupBox());
99
			this->listView2 = (gcnew System::Windows::Forms::ListView());
100
			this->ColumnDir2 = (gcnew System::Windows::Forms::ColumnHeader());
101
			this->ColumnGame2 = (gcnew System::Windows::Forms::ColumnHeader());
102
			this->ColumnLang2 = (gcnew System::Windows::Forms::ColumnHeader());
103
			this->columnAddon2 = (gcnew System::Windows::Forms::ColumnHeader());
104
			this->ColumnID2 = (gcnew System::Windows::Forms::ColumnHeader());
105
			this->panel2 = (gcnew System::Windows::Forms::Panel());
106
			this->ButtonAddFound = (gcnew System::Windows::Forms::Button());
107
			this->splitContainer1 = (gcnew System::Windows::Forms::SplitContainer());
108
			this->panel3 = (gcnew System::Windows::Forms::Panel());
109
			this->buttonCancel = (gcnew System::Windows::Forms::Button());
110
			this->buttonAccept = (gcnew System::Windows::Forms::Button());
111
			this->groupBox1->SuspendLayout();
112
			this->panel1->SuspendLayout();
113
			this->groupBox2->SuspendLayout();
114
			this->panel2->SuspendLayout();
115
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer1))->BeginInit();
116
			this->splitContainer1->Panel1->SuspendLayout();
117
			this->splitContainer1->Panel2->SuspendLayout();
118
			this->splitContainer1->SuspendLayout();
119
			this->panel3->SuspendLayout();
120
			this->SuspendLayout();
121
			// 
122
			// groupBox1
123
			// 
124
			this->groupBox1->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
125
			this->groupBox1->Controls->Add(this->listView1);
126
			this->groupBox1->Controls->Add(this->panel1);
127
			this->groupBox1->Dock = System::Windows::Forms::DockStyle::Fill;
128
			this->groupBox1->Location = System::Drawing::Point(0, 0);
129
			this->groupBox1->Name = L"groupBox1";
130
			this->groupBox1->Size = System::Drawing::Size(1084, 325);
131
			this->groupBox1->TabIndex = 1;
132
			this->groupBox1->TabStop = false;
133
			this->groupBox1->Text = L"Current Directories";
134
			// 
135
			// listView1
136
			// 
137
			this->listView1->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(6) {
138
				this->ColumnDirectory,
139
					this->ColumnGame, this->ColumnStatus, this->ColumnLang, this->columnAddon, this->ColumnID
140
			});
141
			this->listView1->Dock = System::Windows::Forms::DockStyle::Fill;
142
			this->listView1->FullRowSelect = true;
143
			this->listView1->HideSelection = false;
144
			this->listView1->Location = System::Drawing::Point(3, 18);
145
			this->listView1->Name = L"listView1";
146
			this->listView1->Size = System::Drawing::Size(1078, 253);
147
			this->listView1->TabIndex = 0;
148
			this->listView1->UseCompatibleStateImageBehavior = false;
149
			this->listView1->View = System::Windows::Forms::View::Details;
150
			this->listView1->SelectedIndexChanged += gcnew System::EventHandler(this, &DirectoryControl::listView1_SelectedIndexChanged);
151
			this->listView1->DoubleClick += gcnew System::EventHandler(this, &DirectoryControl::listView1_DoubleClick);
152
			// 
153
			// ColumnDirectory
154
			// 
155
			this->ColumnDirectory->Text = L"Directory";
156
			this->ColumnDirectory->Width = 211;
157
			// 
158
			// ColumnGame
159
			// 
160
			this->ColumnGame->Text = L"Game";
161
			// 
162
			// ColumnStatus
163
			// 
164
			this->ColumnStatus->Text = L"Status";
165
			// 
166
			// ColumnLang
167
			// 
168
			this->ColumnLang->Text = L"Language";
169
			// 
170
			// columnAddon
171
			// 
172
			this->columnAddon->Text = L"Addon";
173
			// 
174
			// ColumnID
175
			// 
176
			this->ColumnID->Text = L"";
177
			// 
178
			// panel1
179
			// 
180
			this->panel1->Controls->Add(this->removeButton);
181
			this->panel1->Controls->Add(this->button1);
182
			this->panel1->Dock = System::Windows::Forms::DockStyle::Bottom;
183
			this->panel1->Location = System::Drawing::Point(3, 271);
184
			this->panel1->Name = L"panel1";
185
			this->panel1->Size = System::Drawing::Size(1078, 51);
186
			this->panel1->TabIndex = 2;
187
			// 
188
			// removeButton
189
			// 
190
			this->removeButton->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"removeButton.Image")));
191
			this->removeButton->Location = System::Drawing::Point(201, 0);
192
			this->removeButton->Name = L"removeButton";
193
			this->removeButton->Size = System::Drawing::Size(194, 48);
194
			this->removeButton->TabIndex = 1;
195
			this->removeButton->Text = L"Remove Selected";
196
			this->removeButton->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
197
			this->removeButton->UseVisualStyleBackColor = true;
198
			this->removeButton->Click += gcnew System::EventHandler(this, &DirectoryControl::removeButton_Click);
199
			// 
200
			// button1
201
			// 
202
			this->button1->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"button1.Image")));
203
			this->button1->Location = System::Drawing::Point(0, 0);
204
			this->button1->Name = L"button1";
205
			this->button1->Size = System::Drawing::Size(195, 50);
206
			this->button1->TabIndex = 0;
207
			this->button1->Text = L"Add New Directory";
208
			this->button1->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
209
			this->button1->UseVisualStyleBackColor = true;
210
			this->button1->Click += gcnew System::EventHandler(this, &DirectoryControl::button1_Click);
211
			// 
212
			// imageListGames
213
			// 
214
			this->imageListGames->ImageStream = (cli::safe_cast<System::Windows::Forms::ImageListStreamer^>(resources->GetObject(L"imageListGames.ImageStream")));
215
			this->imageListGames->TransparentColor = System::Drawing::Color::Transparent;
216
			this->imageListGames->Images->SetKeyName(0, L"X2");
217
			this->imageListGames->Images->SetKeyName(1, L"X3");
218
			this->imageListGames->Images->SetKeyName(2, L"X3TC");
219
			this->imageListGames->Images->SetKeyName(3, L"X3AP");
220
			this->imageListGames->Images->SetKeyName(4, L"X3FL");
221
			// 
222
			// groupBox2
223
			// 
224
			this->groupBox2->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
225
			this->groupBox2->Controls->Add(this->listView2);
226
			this->groupBox2->Controls->Add(this->panel2);
227
			this->groupBox2->Dock = System::Windows::Forms::DockStyle::Fill;
228
			this->groupBox2->Location = System::Drawing::Point(0, 0);
229
			this->groupBox2->Name = L"groupBox2";
230
			this->groupBox2->Size = System::Drawing::Size(1084, 321);
231
			this->groupBox2->TabIndex = 2;
232
			this->groupBox2->TabStop = false;
233
			this->groupBox2->Text = L"Available Directories";
234
			// 
235
			// listView2
236
			// 
237
			this->listView2->Columns->AddRange(gcnew cli::array< System::Windows::Forms::ColumnHeader^  >(5) {
238
				this->ColumnDir2, this->ColumnGame2,
239
					this->ColumnLang2, this->columnAddon2, this->ColumnID2
240
			});
241
			this->listView2->Dock = System::Windows::Forms::DockStyle::Fill;
242
			this->listView2->FullRowSelect = true;
243
			this->listView2->HideSelection = false;
244
			this->listView2->Location = System::Drawing::Point(3, 18);
245
			this->listView2->Name = L"listView2";
246
			this->listView2->Size = System::Drawing::Size(1078, 251);
247
			this->listView2->TabIndex = 0;
248
			this->listView2->UseCompatibleStateImageBehavior = false;
249
			this->listView2->View = System::Windows::Forms::View::Details;
250
			this->listView2->SelectedIndexChanged += gcnew System::EventHandler(this, &DirectoryControl::listView2_SelectedIndexChanged);
251
			this->listView2->DoubleClick += gcnew System::EventHandler(this, &DirectoryControl::listView2_DoubleClick);
252
			// 
253
			// ColumnDir2
254
			// 
255
			this->ColumnDir2->Text = L"Directory";
256
			// 
257
			// ColumnGame2
258
			// 
259
			this->ColumnGame2->Text = L"Game";
260
			// 
261
			// ColumnLang2
262
			// 
263
			this->ColumnLang2->Text = L"Language";
264
			// 
265
			// columnAddon2
266
			// 
267
			this->columnAddon2->Text = L"Addon";
268
			// 
269
			// ColumnID2
270
			// 
271
			this->ColumnID2->Text = L"";
272
			// 
273
			// panel2
274
			// 
275
			this->panel2->Controls->Add(this->ButtonAddFound);
276
			this->panel2->Dock = System::Windows::Forms::DockStyle::Bottom;
277
			this->panel2->Location = System::Drawing::Point(3, 269);
278
			this->panel2->Name = L"panel2";
279
			this->panel2->Size = System::Drawing::Size(1078, 49);
280
			this->panel2->TabIndex = 1;
281
			// 
282
			// ButtonAddFound
283
			// 
284
			this->ButtonAddFound->Image = (cli::safe_cast<System::Drawing::Image^>(resources->GetObject(L"ButtonAddFound.Image")));
285
			this->ButtonAddFound->Location = System::Drawing::Point(0, 3);
286
			this->ButtonAddFound->Name = L"ButtonAddFound";
287
			this->ButtonAddFound->Size = System::Drawing::Size(260, 46);
288
			this->ButtonAddFound->TabIndex = 0;
289
			this->ButtonAddFound->Text = L"Add Selected Directory";
290
			this->ButtonAddFound->TextImageRelation = System::Windows::Forms::TextImageRelation::ImageBeforeText;
291
			this->ButtonAddFound->UseVisualStyleBackColor = true;
292
			this->ButtonAddFound->Click += gcnew System::EventHandler(this, &DirectoryControl::ButtonAddFound_Click);
293
			// 
294
			// splitContainer1
295
			// 
296
			this->splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
297
			this->splitContainer1->Location = System::Drawing::Point(0, 0);
298
			this->splitContainer1->Name = L"splitContainer1";
299
			this->splitContainer1->Orientation = System::Windows::Forms::Orientation::Horizontal;
300
			// 
301
			// splitContainer1.Panel1
302
			// 
303
			this->splitContainer1->Panel1->Controls->Add(this->groupBox1);
304
			// 
305
			// splitContainer1.Panel2
306
			// 
307
			this->splitContainer1->Panel2->Controls->Add(this->groupBox2);
308
			this->splitContainer1->Size = System::Drawing::Size(1084, 650);
309
			this->splitContainer1->SplitterDistance = 325;
310
			this->splitContainer1->TabIndex = 4;
311
			// 
312
			// panel3
313
			// 
314
			this->panel3->Controls->Add(this->buttonCancel);
315
			this->panel3->Controls->Add(this->buttonAccept);
316
			this->panel3->Dock = System::Windows::Forms::DockStyle::Bottom;
317
			this->panel3->Location = System::Drawing::Point(0, 650);
318
			this->panel3->Name = L"panel3";
319
			this->panel3->Size = System::Drawing::Size(1084, 41);
320
			this->panel3->TabIndex = 5;
321
			// 
322
			// buttonCancel
323
			// 
324
			this->buttonCancel->DialogResult = System::Windows::Forms::DialogResult::Cancel;
325
			this->buttonCancel->Dock = System::Windows::Forms::DockStyle::Right;
326
			this->buttonCancel->Location = System::Drawing::Point(934, 0);
327
			this->buttonCancel->Name = L"buttonCancel";
328
			this->buttonCancel->Size = System::Drawing::Size(75, 41);
329
			this->buttonCancel->TabIndex = 1;
330
			this->buttonCancel->Text = L"Cancel";
331
			this->buttonCancel->UseVisualStyleBackColor = true;
332
			// 
333
			// buttonAccept
334
			// 
335
			this->buttonAccept->DialogResult = System::Windows::Forms::DialogResult::OK;
336
			this->buttonAccept->Dock = System::Windows::Forms::DockStyle::Right;
337
			this->buttonAccept->Location = System::Drawing::Point(1009, 0);
338
			this->buttonAccept->Name = L"buttonAccept";
339
			this->buttonAccept->Size = System::Drawing::Size(75, 41);
340
			this->buttonAccept->TabIndex = 0;
341
			this->buttonAccept->Text = L"Accept";
342
			this->buttonAccept->UseVisualStyleBackColor = true;
343
			// 
344
			// DirectoryControl
345
			// 
346
			this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);
347
			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
348
			this->ClientSize = System::Drawing::Size(1084, 691);
349
			this->Controls->Add(this->splitContainer1);
350
			this->Controls->Add(this->panel3);
351
			this->Name = L"DirectoryControl";
352
			this->Text = L"Directory Control";
353
			this->groupBox1->ResumeLayout(false);
354
			this->panel1->ResumeLayout(false);
355
			this->groupBox2->ResumeLayout(false);
356
			this->panel2->ResumeLayout(false);
357
			this->splitContainer1->Panel1->ResumeLayout(false);
358
			this->splitContainer1->Panel2->ResumeLayout(false);
359
			(cli::safe_cast<System::ComponentModel::ISupportInitialize^>(this->splitContainer1))->EndInit();
360
			this->splitContainer1->ResumeLayout(false);
361
			this->panel3->ResumeLayout(false);
362
			this->ResumeLayout(false);
363
 
364
		}
365
#pragma endregion
366
 
367
	private: System::Void listView1_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e);
368
	private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e);
369
	private: System::Void removeButton_Click(System::Object^  sender, System::EventArgs^  e);
370
	private: System::Void listView2_SelectedIndexChanged(System::Object^  sender, System::EventArgs^  e);
371
	private: System::Void ButtonAddFound_Click(System::Object^  sender, System::EventArgs^  e);
372
	private: System::Void listView1_DoubleClick(System::Object^  sender, System::EventArgs^  e);
373
	private: System::Void listView2_DoubleClick(System::Object^  sender, System::EventArgs^  e);
374
};
375
}